You can configure X-Pack security to communicate with a Lightweight Directory Access
Protocol (LDAP) server to authenticate users. To integrate with LDAP, you
ldap realm and map LDAP groups to user roles in the
role mapping file.
LDAP stores users and groups hierarchically, similar to the way folders are
grouped in a file system. An LDAP directory’s hierarchy is built from containers
such as the organizational unit (
ou), organization (
domain controller (
The path to an entry is a Distinguished Name (DN) that uniquely identifies a
user or group. User and group names typically have attributes such as a
common name (
cn) or unique ID (
uid). A DN is specified as a string,
"cn=admin,dc=example,dc=com" (white spaces are ignored).
ldap realm supports two modes of operation, a user search mode
and a mode with specific templates for user DNs.
load_balance.type setting can be used at the realm level to configure how
X-Pack security should interact with multiple LDAP servers. X-Pack security supports both
failover and load balancing modes of operation.
An integral part of a realm authentication process is to resolve the roles associated with the authenticated user. Roles define the privileges a user has in the cluster.
Since with the
ldap realm the users are managed externally in the LDAP server,
the expectation is that their roles are managed there as well. If fact, LDAP
supports the notion of groups, which often represent user roles for different
systems in the organization.
ldap realm enables you to map LDAP users to roles via their LDAP
groups, or other metadata. This role mapping can be configured via the
add role mapping API or by using a file stored
on each node. When a user authenticates with LDAP, the privileges
for that user are the union of all privileges defined by the roles to which
the user is mapped. For more information, see
Configuring an LDAP Realm.
When a user is authenticated via an LDAP realm, the following properties are populated in the user’s metadata:
The distinguished name of the user.
The distinguished name of each of the groups that were resolved for the user (regardless of whether those groups were mapped to a role).
This metadata is returned in the authenticate API, and can be used with templated queries in roles.
Additional fields can be included in the user’s metadata by configuring
metadata setting on the LDAP realm. This metadata is available for use
role mapping API
templated role queries