Search Guard comes as two separate plugins: One plugin for the Elasticsearch backend, and one plugin for Kibana frontend. Traditionally, both plugins had a separate configuration, and it was your task to make sure that the Elasticsearch and the Kibana configuration matched.
For example, if you wanted to uses OIDC as login method, part of the configuration had to be placed in sg_config.yml, and some configuration had to be placed in kibana.yml.
# Enable OpenID authentication
# the ID of the OpenID Connect client in your IdP
searchguard.openid.client_id: "<client id>"
# the client secret of the OpenID Connect client
searchguard.openid.client_secret: "<client secret>"
# optional: the scope of the identity token
searchguard.openid.scope: "profile email"
# optional: the logout URL of your IdP
# Only necessary if your IdP does not publish the logout url
# in the metadata
This of course is error-prone since you need to make sure both configs are in sync. In addition, because parts of the configuration are stored in kibana.yml, any change required a restart of Kibana.
Moreover, this approach only supported one login method: You could choose between password-based authentication and SSO authentication, but you could not have both. There was also no support for multiple Identity Providers.
Let's see how we can implement this with Search Guard FLX.
New Configuration Structure
Search Guard FLX now stores also the configuration for Kibana in the Search Guard configuration index. This means:
All configuration settings are stored in one central place. No more thinking about where to configure a particular aspect of your security settings.
Hot-reloadable: Now also the Kibana configuration benefits from the hot-reload capabilities of the Search Guard configuration. Change your frontend settings in real-time and without restarting Kibana
Support for multiple authentication types in Kibana
The configuration is now split between Elasticsearch and Kibana like:
sg_authc.yml Contains the configuration relevant for Elasticsearch. This file replaces the former sg_config.yml.
sg_frontend_authc.yml Contains the configuration that is only relevant for Kibana
Setting up multiple authentication types
Basic Setup: Internal user database
Let's start with setting up authentication based on username and password. In our example, we use the internal user database, but you might as well use LDAP.
First, let's configure Elasticsearch to use the internal user database. For this, just add the following to sg_authc.yml:
- type: basic/internal_users_db
In sg_frontend_authc.yml, add:
- type: basic
And then upload the configuration with sgctl. If your configuration files are located in the directly "my-sg-config" the call looks like this:
./sgctl.sh update-config ./my-sg-config
If you now open Kibana you are welcomed with the usual login screen:
Adding OIDC to Kibana
The next thing we want to do is add OIDC authentication. We want to give the user the choice of whether to use OIDC for login, or plain old username and password.
For this, we add our OIDC configuration to sg_frontend_authc.yml:
Search Guard is a trademark of floragunn GmbH, registered in the U.S. and in other countries. Elasticsearch, Kibana, Logstash, and Beats are trademarks of Elasticsearch BV, registered in the U.S. and in other countries. Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.