Last week I attended the HL7 FHIR DevDays 2018 in Amsterdam, the “most important and largest FHIR only event in the world” organised by Firely. It’s been awesome: a lot of interesting and inspiring sessions, exciting projects and a vibrant and friendly community.
FHIR (Fast Healthcare Interoperability Resources) is an HL7 standard for exchanging healthcare information electronically. I was much impressed by the fantastic community working on and with FHIR, everyone really committed to making a difference for people health with the support of technology.
After organising it last year and delivered a talk about getting started with plugin development, this year I’ve been to WordCamp Torino 2018 to talk about the process to secure web applications based on WordPress.
In 2000, the internationally renowned security technologist Bruce Schneier wrote: “Security is a process, not a product”. In the same essay, he wondered: “Will we ever learn?”. Apparently not.
How many times have you considered your WordPress application security only once completed? How many times have you installed a security plugin and thought it was enough? Securing a web application doesn’t mean installing a plugin just before deployment. Not at all.
I’m very passionate about security and I’d like to share my thoughts with you. My focus will be the security awareness related to web applications. Is WordPress secure? I will answer this question very clearly. And you’re not gonna like it!
Last winter, I joined the team organising the WordCamp Torino 2017 as the lead for the website group. In this post, I’d like to write some tips and tricks for managing a WordCamp website, considering the challenges that we had to face.
The first thing to do when starting working on a WordCamp website is setting up a local environment. WordCamp.org is part of the WordPress Meta Environment. You can choose to install either the whole Meta project or just the WordCamp website.
Exactly two years ago, at this same time, I was coming home from Milan after attending the first Italian WordPress Contributor Day. I didn’t know then what it would have meant to me, but it was the beginning of something awesome.
I started using WordPress as a CMS in 2009, but it was just in 2015, in Milan, that I found out the Community and the several opportunities to contribute to this successful open source project. Have a look at the Make area to read more about the different teams working on WordPress.
In the previous article, we got to know Keycloak, an open source project for identity and access management developed by the RedHat Community. We went through how to install it, boot it and how to access the Keycloak Admin Console for the first time.
Continuing from where we left, in this new article I’d like to talk about how to configure Keycloak so that we can later use it for managing authentication and authorization for web applications and services. We’ll learn how to create a new realm, define roles and add users.
Throughout this series, we’re going to see more features and details about Keycloak, but I suggest you check the helpful and detailed official documentation for any doubt or curiosity.
1. Access Control, Authentication and Authorization
Managing authentication and authorization is an essential task in every good-designed web application or service. Keycloak makes it very easy and practical, letting us focus on the application business logic rather than on the implementation of security features.
Before going on, it is worth briefly recalling the definition of some fundamental security properties (from NIST glossary):
Access Control: “The process of granting or denying specific requests to: 1) obtain and use information and related information processing services; and 2) enter specific physical facilities (e.g., federal buildings, military establishments, border crossing entrances)”.
Authentication: “Verifying the identity of a user, process, or device, often as a prerequisite to allowing access to resources in an information system”.
Authorization: “Access privileges granted to a user, program, or process or the act of granting those privileges”.
Lately, I’ve been working with Keycloak, so I decided to better delve into it and write about it.
This article is the first of a series where I’d like to introduce Keycloak as a solution to manage authentication and authorization, how to install it and which are the fundamental concepts and configurations.
Then I’d like to explain how to use it to secure Spring Boot, Spring Security and AngularJS applications and services, analyse the implementation when using a relational database to store users and finally how to manage users from Java thanks to the Admin REST API.
1. What is Keycloak?
Keycloak is an open source project developed and maintained by the RedHat Community.
“Keycloak is an open source Identity and Access Management solution aimed at modern applications and services. It makes it easy to secure applications and services with little to no code.”
It offers a broad set of features, like SSO, authentication and authorization, social login, multifactor authentication and centralised user management. I suggest you check the official documentation to get all the details.
Throughout this series we’ll make use of the following features:
Admin Console to configure the Keycloak server and create realms, roles, users and clients;
Single Sign-On (SSO) using the Open ID Connect (OIDC) authentication and authorization protocol;
Client Adapters to integrate Spring Boot, Spring Security and AngularJS with Keycloak;
Setting up HTTPS for Spring Boot requires two steps:
Getting an SSL certificate;
Configuring SSL in Spring Boot.
We can generate an SSL certificate ourselves (self-signed certificate). Its use is intended just for development and testing purposes. In production, you should use a certificate issued by a trusted Certificate Authority (CA). Whether you’re going to generate a self-signed certificate or you have already got one by a CA, I’ll show you how to enable HTTPS in a Spring Boot application.