tls-transport.asciidoc 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. [role="xpack"]
  2. [[tls-transport]]
  3. ==== Encrypting communications between nodes in a cluster
  4. The transport networking layer is used for internal communication between nodes
  5. in a cluster. When {security-features} are enabled, you must use TLS to ensure
  6. that communication between the nodes is encrypted.
  7. . <<node-certificates,Generate node certificates>>.
  8. . Enable TLS and specify the information required to access the node’s
  9. certificate.
  10. ** If the signed certificate is in PKCS#12 format, add the following information to the
  11. `elasticsearch.yml` file on each node:
  12. +
  13. --
  14. [source,yaml]
  15. -----------------------------------------------------------
  16. xpack.security.transport.ssl.enabled: true
  17. xpack.security.transport.ssl.verification_mode: certificate <1>
  18. xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12 <2>
  19. xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12 <3>
  20. -----------------------------------------------------------
  21. <1> If you used the `--dns` or `--ip` options with the `elasticsearch-certutil cert` command
  22. and you want to enable strict hostname checking, set the verification mode to
  23. `full`.
  24. See <<ssl-tls-settings, `xpack.security.transport.ssl.verification_mode`>> for a description of these values.
  25. <2> If you created a separate certificate for each node, then you might need to
  26. customize this path on each node. If the filename matches the node name, you can
  27. use the `certs/${node.name}.p12` format, for example.
  28. <3> The `elasticsearch-certutil` outputs a PKCS#12 keystore which includes the
  29. CA certificate as a trusted certificate entry. This allows for the keystore to
  30. also be used as a truststore. In this case, the path value should match
  31. the `keystore.path` value.
  32. Note, however, that this is not the general rule. There are keystores that cannot be
  33. used as trustores, only
  34. {ref}/security-settings.html#pkcs12-truststore-note[specifically crafted ones can]
  35. --
  36. ** If the certificate is in PEM format, add the following information to the
  37. `elasticsearch.yml` file on each node:
  38. +
  39. --
  40. [source, yaml]
  41. --------------------------------------------------
  42. xpack.security.transport.ssl.enabled: true
  43. xpack.security.transport.ssl.verification_mode: certificate <1>
  44. xpack.security.transport.ssl.key: /home/es/config/node01.key <2>
  45. xpack.security.transport.ssl.certificate: /home/es/config/node01.crt <3>
  46. xpack.security.transport.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <4>
  47. --------------------------------------------------
  48. <1> If you used the `--dns` or `--ip` options with the `elasticsearch-certutil cert` command
  49. and you want to enable strict hostname checking, set the verification mode to
  50. `full`.
  51. See <<ssl-tls-settings, `xpack.security.transport.ssl.verification_mode`>> for a description of these values.
  52. <2> The full path to the node key file. This must be a location within the
  53. {es} configuration directory.
  54. <3> The full path to the node certificate. This must be a location within the
  55. {es} configuration directory.
  56. <4> An array of paths to the CA certificates that should be trusted. These paths
  57. must be a location within the {es} configuration directory.
  58. --
  59. . If you secured the node's certificate with a password, add the password to
  60. your {es} keystore:
  61. ** If the signed certificate is in PKCS#12 format, use the following commands:
  62. +
  63. --
  64. [source,shell]
  65. -----------------------------------------------------------
  66. bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password
  67. bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password
  68. -----------------------------------------------------------
  69. --
  70. ** If the certificate is in PEM format, use the following commands:
  71. +
  72. --
  73. [source,shell]
  74. -----------------------------------------------------------
  75. bin/elasticsearch-keystore add xpack.security.transport.ssl.secure_key_passphrase
  76. -----------------------------------------------------------
  77. --
  78. . Restart {es}.
  79. +
  80. --
  81. You must perform a full cluster restart. Nodes which are configured to use TLS
  82. cannot communicate with nodes that are using unencrypted networking (and
  83. vice-versa). After enabling TLS you must restart all nodes in order to maintain
  84. communication across the cluster.
  85. --
  86. [NOTE]
  87. ===============================
  88. * All TLS-related node settings are considered to be highly sensitive and
  89. therefore are not exposed via the
  90. {ref}/cluster-nodes-info.html#cluster-nodes-info[nodes info API] For more
  91. information about any of these settings, see <<security-settings>>.
  92. * {es} monitors all files such as certificates, keys, keystores, or truststores
  93. that are configured as values of TLS-related node settings. If you update any of
  94. these files (for example, when your hostnames change or your certificates are
  95. due to expire), {es} reloads them. The files are polled for changes at
  96. a frequency determined by the global {es} `resource.reload.interval.high`
  97. setting, which defaults to 5 seconds.
  98. ===============================