tls-ldap.asciidoc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. [role="xpack"]
  2. [[tls-ldap]]
  3. ==== Encrypting communications between {es} and LDAP
  4. To protect the user credentials that are sent for authentication in an LDAP
  5. realm, it's highly recommended to encrypt communications between {es} and your
  6. LDAP server. Connecting via SSL/TLS ensures that the identity of the LDAP server
  7. is authenticated before {es} transmits the user credentials and the
  8. contents of the connection are encrypted. Clients and nodes that connect via
  9. TLS to the LDAP server need to have the LDAP server's certificate or the
  10. server's root CA certificate installed in their keystore or truststore.
  11. For more information, see <<configuring-ldap-realm>>.
  12. . Configure the realm's TLS settings on each node to trust certificates signed
  13. by the CA that signed your LDAP server certificates. The following example
  14. demonstrates how to trust a CA certificate, `cacert.pem`, located within the
  15. {es} configuration directory (ES_PATH_CONF):
  16. +
  17. --
  18. [source,shell]
  19. --------------------------------------------------
  20. xpack:
  21. security:
  22. authc:
  23. realms:
  24. ldap:
  25. ldap1:
  26. order: 0
  27. url: "ldaps://ldap.example.com:636"
  28. ssl:
  29. certificate_authorities: [ "ES_PATH_CONF/cacert.pem" ]
  30. --------------------------------------------------
  31. The CA certificate must be a PEM encoded.
  32. NOTE: You can also specify the individual server certificates rather than the CA
  33. certificate, but this is only recommended if you have a single LDAP server or
  34. the certificates are self-signed.
  35. --
  36. . Set the `url` attribute in the realm configuration to specify the LDAPS
  37. protocol and the secure port number. For example, `url: ldaps://ldap.example.com:636`.
  38. . Restart {es}.
  39. NOTE: By default, when you configure {es} to connect to an LDAP server
  40. using SSL/TLS, it attempts to verify the hostname or IP address
  41. specified with the `url` attribute in the realm configuration with the
  42. values in the certificate. If the values in the certificate and realm
  43. configuration do not match, {es} does not allow a connection to the
  44. LDAP server. This is done to protect against man-in-the-middle attacks. If
  45. necessary, you can disable this behavior by setting the
  46. `ssl.verification_mode` property to `certificate`.