Guide: Elasticsearch Security

Elasticsearch Authentication

Data access begins with a successful authentication service. This occurs before any authorization or filtering tests get performed and before other applications are allowed to take place in the meantime. So, what do you need to know about setting up authentication in Elasticsearch?

In this article, we will discuss the following:

This is part of our Elasticsearch Security guide.

What is Authentication?

Authentication is the process of identifying and authenticating users. Various systems may require multiple types of identification from the user to verify a user’s identity. To get access to secured resources, a person must first establish their identification, which can get done through passwords, qualifications, or other methods.


When a user logs in to Elasticsearch, the server authenticates them by identifying and validating that the users behind the requests that hit the cluster are who they claim to be. One or more Elasticsearch authentication services are responsible for the authentication process.


The native user administration and authentication support and integration with other user management systems such as LDAP and Active Directory are all available to developers.


Its built-in security features include realms such as native, ldap, active directory, pki, file, saml, oidc, and several other options. It’s possible to create your custom realm and connect it to the server if none of the built-in realms match your demands.


It may be necessary to link your user credentials to the queries made to Elasticsearch if security features get implemented, depending on the realms you’ve established. For example, in the case of realms that accept usernames and passwords, you can include a basic authentication header in your queries.


Two services get provided by the security features: the token service and the API key service. These services allow you to exchange the current authentication for a token or key by utilizing the appropriate API. Afterward, you can use the token or key to authenticate subsequent requests, and it can get used as credentials. To use the API key service, you must enable it. By default, when TLS/SSL gets enabled for HTTP traffic, the token service is enabled.

Elasticsearch Security

Elasticsearch is a search and processing engine that operates near real-time for all data formats. Either structured or unstructured text, quantitative information, or geographic information, Elasticsearch can conveniently keep and classify it in a fashion that allows for quick searches. As free and open-source software, Elasticsearch offers a comprehensive set of security features.


The ability to go far past simple data extraction and analyze the data to find correlations in the data creates a whole new world of possibilities. Moreover, as the information and query volume increase, the network structure of Elasticsearch allows the implementation to expand effortlessly in parallel with the increase.

Elasticsearch Authorization

The Elasticsearch authorization security mechanisms include a stand-alone authentication service system that allows users to rapidly encrypt any node without the need for any additional software through Elasticsearch credentials. In many circumstances, processes that authenticate users are not sufficient. One will also need a mechanism to restrict the data that users may acquire and the processes they can carry out. The arising of this issue is when Elasticsearch comes to play.

Enable Elasticsearch Security

The next question would be how to enable security in Elasticsearch. It is possible to authorize users through the Elasticsearch basic security features. By granting permissions to roles and allocating those responsibilities to users, one can enable Elasticsearch security and its different components.


It is possible to deny access to all other indices by limiting a user’s ability to do access operations on the activities index using the role-based access control technique or the RBAC.


One can also use the Elasticsearch basic security authentication service methods to limit the networks and clients that can join the clusters based on the IP addresses of the networks and clients. One can also restrict access to the network by blocking and allowing specific IP addresses, network segments, or DNS domains to access the cluster.

Elasticsearch Authentication

Authentication is the initial step in gaining access to Elasticsearch, and it is required. Elasticsearch will seek to allocate one or more functions to the authorized user upon successful authentication.

Elasticsearch Login

Begin by running Kibana and logging into it. Make use of the passwords that got created when first setting up the account. Once having logged in, pick the Kibana Dock and travel to the Stack Management area and the security section, as necessary.


Go to users and click on create a user to create a new user. Then, one can do Elasticsearch configure username password. When creating a new user in Kibana, users will get prompted to assign them a role. Then, one can now set Elasticsearch user and password. Changing the Elasticsearch default password on the Elasticsearch server and in the input files if wanting to avoid using the default password.

Elastic Username and Password

Users can be allocated roles either statically or flexibly during the authentication process, depending on the characteristics of the user. In some cases, the user attributes used to assign roles can be the group membership users have in an external network, the suffix of the Elastic username in Elasticsearch, or other user attributes dependent on the domain type that validated the user. Additionally, Elasticsearch includes run as a capability, allowing users to send requests on account of other users without re-authentication.


After the authentication phase completes, the authorization phase will take place.

Kibana API Authentication

The Kibana user-established role gets included with the ELK Stack, and you can use it to allow access to every Kibana functionality across all areas with ease. One can establish a unique role that offers the appropriate Kibana permissions to users to grant them access to only a set of locations or features.


The user gets the privileges associated with the combination of the roles. Hence, assigning both the Kibana user and a custom role that offers Kibana capabilities is inefficient since the Kibana user role has access to all functions in all spaces.

Logstash Elasticsearch Authentication

Logstash consumes data from various sources, alters it, and then transfers it to any choice storage location.


While Elasticsearch is the preferred output since it opens the door to a plethora of searching and analytical options, this is not the only one that you can use. There are different outputs in Logstash that allow users to route data wherever they want, providing them with the flexibility to unlock downstream use cases.


It is essential to secure every piece of data that gets consumed. Elasticsearch API authentication is here to help. With the Elasticsearch authentication plugin, the risks associated with authentication are negated for companies using Elasticsearch.

Elasticsearch Security with Satori

Go here to learn more about how Satori helps secure your cloud data. Elasticsearch support is coming soon, and we’d love to understand your needs.

Last updated on

May 12, 2022

The information provided in this article and elsewhere on this website is meant purely for educational discussion and contains only general information about legal, commercial and other matters. It is not legal advice and should not be treated as such. Information on this website may not constitute the most up-to-date legal or other information. The information in this article is provided “as is” without any representations or warranties, express or implied. We make no representations or warranties in relation to the information in this article and all liability with respect to actions taken or not taken based on the contents of this article are hereby expressly disclaimed. You must not rely on the information in this article as an alternative to legal advice from your attorney or other professional legal services provider. If you have any specific questions about any legal matter you should consult your attorney or other professional legal services provider. This article may contain links to other third-party websites. Such links are only for the convenience of the reader, user or browser; we do not recommend or endorse the contents of any third-party sites.