“Security is one of the most incredible features provided by Elasticsearch, Kibana, and Logstash. The ELK stack comes configured with security features such as SSL/TLS encryption, user permissions, and roles.
Therefore, when performing requests to Elasticsearch, the request includes an authentication token in the incoming request. Elasticsearch extracts and uses this token to authorize and complete the requested action.
Elasticsearch will deny the token and return an error if no authentication token is missing from the request.
However, sometimes you may need to allow the anonymous request. Although this is a serious security issue and should not be implemented in production, it can benefit the development mode.”
Hence, in this tutorial, we will show you how you can configure and enable anonymous login in Elasticsearch.
Elasticsearch Enable Anonymous User
To enable we need to assign one or more roles in the Elasticsearch configuration file.
For example, to allow anonymous access for es_anonymous_user user, edit the Elasticsearch config file:
Add the configuration as:
anonymous:
username: anonymous_user
roles: admin
authz_exception: true
The configuration specifies anonymous login for the specified username. As mentioned, this defaults to _es_anonymous_user unless specified.
The roles define the roles associated with the anonymous username. In this case, we assign administrator roles to the anonymous user (Not recommended).
Finally, we specify if exceptions should be returned. If true, the request returns HTTP 403 if the anonymous user performs actions to which they do not have permission.
To enable an anonymous user in kibana, add the following entry in kibana.yml.
basic.basic1:
order: 0
anonymous.anonymous1:
order: 1
credentials:
username: "anonymous_service_account"
password: "anonymous_service_account_password"
Save and reload the services.
Termination
This article describes how to enable anonymous access for Elasticsearch and Kibana by editing their respective configuration files.