tls-http.asciidoc 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. [role="xpack"]
  2. [[tls-http]]
  3. ==== Encrypting HTTP client communications
  4. When {security-features} are enabled, you can optionally use TLS to ensure that
  5. communication between HTTP clients and the cluster is encrypted.
  6. Enabling TLS on the HTTP layer is strongly recommended, but is not required.
  7. IMPORTANT: In a <<dev-vs-prod-mode,production environment>>, some {es} features
  8. such as tokens will be disabled unless you enable TLS on the HTTP
  9. layer.
  10. If you enable TLS on the HTTP layer in {es}, you might need to make
  11. configuration changes in other parts of the Elastic Stack and in any {es}
  12. clients that you use. For example, the following changes are typically
  13. necessary:
  14. * Update all clients, tools, and applications that connect to {es} to use the
  15. `https` protocol in their configuration URL. For example, {kib}, {beats}, {ls},
  16. language clients, and custom applications.
  17. * Set trusted certificate authorities. This change is typically required only
  18. if the {es} server certificate is issued by a certificate authority that is not
  19. automatically trusted by the clients, tools, and applications that connect to
  20. {es}.
  21. If you enable advanced TLS features on {es} (such as
  22. `ssl.client_authentication`), additional
  23. configuration could be necessary, but is not typically required in most {es}
  24. deployments.
  25. . If you have not done so already, <<node-certificates,generate node certificates>>.
  26. +
  27. --
  28. In particular, you need the files that are generated by the following command:
  29. [source,shell]
  30. ----------------------------------------------------------
  31. bin/elasticsearch-certutil http
  32. ----------------------------------------------------------
  33. This command generates a zip file that contains certificates and keys for use in
  34. {es} and {kib}. Each folder contains a readme that explains how to use the files.
  35. --
  36. . Verify that you've copied the output files to the appropriate locations, as
  37. specified in the readme files.
  38. +
  39. --
  40. For example, copy the `http.p12` file from the `elasticsearch` folder into a
  41. directory within the {es} configuration directory on each node. If you chose to
  42. generate one certificate per node, copy the appropriate `http.p12` file to each
  43. node. If you want to use {kib} to access this cluster, copy the
  44. `elasticsearch-ca.pem` file from the `kibana` folder into the {kib}
  45. configuration directory.
  46. --
  47. . Enable TLS and specify the information required to access the node’s
  48. certificate. For example:
  49. .. Update the `elasticsearch.yml` file on each node with the location of the
  50. certificates.
  51. +
  52. --
  53. If the certificates are in PKCS#12 format:
  54. [source, yaml]
  55. --------------------------------------------------
  56. xpack.security.http.ssl.enabled: true
  57. xpack.security.http.ssl.keystore.path: "http.p12"
  58. --------------------------------------------------
  59. If you have certificates in PEM format:
  60. [source, yaml]
  61. --------------------------------------------------
  62. xpack.security.http.ssl.enabled: true
  63. xpack.security.http.ssl.key: /home/es/config/node1_http.key <1>
  64. xpack.security.http.ssl.certificate: /home/es/config/node1_http.crt <2>
  65. xpack.security.http.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <3>
  66. --------------------------------------------------
  67. <1> The full path to the node key file. This must be a location within the
  68. {es} configuration directory.
  69. <2> The full path to the node certificate. This must be a location within the
  70. {es} configuration directory.
  71. <3> An array of paths to the CA certificates that should be trusted. These paths
  72. must be a location within the {es} configuration directory.
  73. --
  74. .. If you secured the keystore or the private key with a password, add that password to a secure
  75. setting in {es}.
  76. +
  77. --
  78. If the certificates are in PKCS#12 format:
  79. [source,shell]
  80. -----------------------------------------------------------
  81. bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
  82. -----------------------------------------------------------
  83. If the certificates are in PEM format:
  84. [source,shell]
  85. -----------------------------------------------------------
  86. bin/elasticsearch-keystore add xpack.security.http.ssl.secure_key_passphrase
  87. -----------------------------------------------------------
  88. --
  89. . Optional: If you want to use {kib}, follow the instructions in the readme
  90. provided by the `elasticsearch-certutil http` command or see
  91. {kibana-ref}/configuring-tls.html[Encrypting communications in {kib}].
  92. . Restart {es}.
  93. [NOTE]
  94. ===============================
  95. * All TLS-related node settings are considered to be highly sensitive and
  96. therefore are not exposed via the
  97. <<cluster-nodes-info,nodes info API>> For more
  98. information about any of these settings, see <<security-settings>>.
  99. * {es} monitors all files such as certificates, keys, keystores, or truststores
  100. that are configured as values of TLS-related node settings. If you update any of
  101. these files (for example, when your hostnames change or your certificates are
  102. due to expire), {es} reloads them. The files are polled for changes at
  103. a frequency determined by the global {es} `resource.reload.interval.high`
  104. setting, which defaults to 5 seconds.
  105. ===============================