The Light Directory Access Protocol (LDAP) is a lightweight version of the directory access protocol based on the X.500 standard. An LDAP service provides user authentication and authorization. Using the Security plugin for Open Distro for Elasticsearch, CSS adds Active Directory as an authentication backend for clusters, connecting them seamlessly to the LDAP service. This topic describes the steps needed to connect a CSS cluster to an LDAP service.
It also describes how to enable LDAP authentication for a CSS cluster to allow access by LDAP users of specific roles.
Only Elasticsearch 7.10.2 security-mode clusters can be accessed through LDAP.
If Status is Succeeded in the parameter change list, the change has been saved. Up to 20 change records can be displayed.
Parameter | Description |
|---|---|
IP Address | Enter the IP address of the LDAP server. If the LDAP service on the ECS is used, enter the IP address of the ECS. |
Subnet Mask | Enter the subnet mask of the LDAP server. If the LDAP service on the ECS is used, enter the subnet mask of the ECS. |
The CN, OU, and DC must be provided in the correct order. Otherwise, authentication will fail.
PUT _opendistro/_security/api/securityconfig/config{"dynamic": {"authc": {"basic_internal_auth_domain": {"description": "Authenticate via HTTP Basic against internal users database","http_enabled": true,"transport_enabled": true,"order": 1,"http_authenticator": {"type": "basic","challenge": true},"authentication_backend": {"type": "intern"}},"ldap": {"description": "Authenticate via LDAP or Active Directory","http_enabled": true,"transport_enabled": true,"order": 2,"http_authenticator": {"type": "basic","challenge": false},"authentication_backend": {"type": "ldap","config": {"enable_ssl": false,"enable_start_tls": false,"enable_ssl_client_auth": false,"verify_hostnames": true,"hosts": ["10.0.XXX.XXX:389"],"bind_dn": "CN=adminAD,DC=test,DC=ldap,DC=com","password": "<password>","userbase": "OU=ITDepartment,DC=test,DC=ldap,DC=com","usersearch": "(sAMAccountName={0})","username_attribute": "uid"}}}},"authz": {"roles_from_myldap": {"description": "Authorize via LDAP or Active Directory","http_enabled": true,"transport_enabled": true,"authorization_backend": {"type": "ldap","config": {"enable_ssl": false,"enable_start_tls": false,"enable_ssl_client_auth": false,"verify_hostnames": true,"hosts": ["10.0.XXX.XXX:389"],"bind_dn": "CN=adminAD,DC=test,DC=ldap,DC=com","password": "<password>","rolebase": "OU=groups,DC=test,DC=ldap,DC=com","rolesearch": "(member={0})","userroleattribute": null,"userrolename": "disabled","rolename": "CN","resolve_nested_roles": true,"userbase": "OU=ITDepartment,DC=test,DC=ldap,DC=com","usersearch": "(uid={0})"}}}}}}
The parameters in Table 2 need to be modified based on the actual environment.
Parameter | Description |
|---|---|
hosts | Address of the LDAP service. The port number is 389. If the LDAP service on the ECS is used, enter the IP address of the ECS. |
bind_dn | It is similar to the LDAP user name (CN - OU - DC) and is used to access the LDAP server. Select a user name from the user data of the LDAP service. |
password | Password of the LDAP user configured using bind_dn. |
userbase | After the LDAP service is connected, the DN that the user belongs to is obtained. In this example, all user information in the ITDepartment directory is synchronized. |
rolebase | The collection of permissions that can be configured for the userbase user group of the LDAP service. |
The rolebase permissions group of the LDAP server must be mapped to the roles in the Elasticsearch cluster. Figure 1 illustrates the mapping. For details about the configuration, see Creating Users for an Elasticsearch Cluster and Granting Cluster Access.
Figure 1 Permissions mapping

Figure 2 Permissions mapping

If the login is successful, the configuration is successful, and users can access the Elasticsearch cluster through LDAP. The specific permissions authorized are controlled by role permissions configured in Elasticsearch.