active-directory-realm.asciidoc 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. [role="xpack"]
  2. [[active-directory-realm]]
  3. === Active Directory user authentication
  4. You can configure {stack} {security-features} to communicate with Active
  5. Directory to authenticate users. See <<ad-realm-configuration>>.
  6. The {security-features} use LDAP to communicate with Active Directory, so
  7. `active_directory` realms are similar to <<ldap-realm, `ldap` realms>>. Like
  8. LDAP directories, Active Directory stores users and groups hierarchically. The
  9. directory's hierarchy is built from containers such as the _organizational unit_
  10. (`ou`), _organization_ (`o`), and _domain controller_ (`dc`).
  11. The path to an entry is a _Distinguished Name_ (DN) that uniquely identifies a
  12. user or group. User and group names typically have attributes such as a
  13. _common name_ (`cn`) or _unique ID_ (`uid`). A DN is specified as a string, for
  14. example `"cn=admin,dc=example,dc=com"` (white spaces are ignored).
  15. The {security-features} supports only Active Directory security groups. You
  16. cannot map distribution groups to roles.
  17. NOTE: When you use Active Directory for authentication, the username entered by
  18. the user is expected to match the `sAMAccountName` or `userPrincipalName`,
  19. not the common name.
  20. The Active Directory realm authenticates users using an LDAP bind request. After
  21. authenticating the user, the realm then searches to find the user's entry in
  22. Active Directory. Once the user has been found, the Active Directory realm then
  23. retrieves the user's group memberships from the `tokenGroups` attribute on the
  24. user's entry in Active Directory.
  25. [[ad-realm-configuration]]
  26. ==== Configuring an Active Directory realm
  27. include::configuring-active-directory-realm.asciidoc[]
  28. [[ad-user-metadata]]
  29. ==== User metadata in Active Directory realms
  30. When a user is authenticated via an Active Directory realm, the following
  31. properties are populated in the user's _metadata_:
  32. |=======================
  33. | Field | Description
  34. | `ldap_dn` | The distinguished name of the user.
  35. | `ldap_groups` | The distinguished name of each of the groups that were
  36. resolved for the user (regardless of whether those
  37. groups were mapped to a role).
  38. |=======================
  39. This metadata is returned in the
  40. <<security-api-authenticate,authenticate API>> and can be used with
  41. <<templating-role-query, templated queries>> in roles.
  42. Additional metadata can be extracted from the Active Directory server by configuring
  43. the `metadata` setting on the Active Directory realm.
  44. [[ad-load-balancing]]
  45. ==== Load balancing and failover
  46. The `load_balance.type` setting can be used at the realm level to configure how
  47. the {security-features} should interact with multiple Active Directory servers.
  48. Two modes of operation are supported: failover and load balancing.
  49. See
  50. <<load-balancing>>.
  51. [[active-directory-ssl]]
  52. ==== Setting up SSL between Elasticsearch and Active Directory
  53. See
  54. <<tls-active-directory>>.