2018-02-15 14:41:01 -05:00
|
|
|
|
[role="xpack"]
|
|
|
|
|
[[tls-http]]
|
|
|
|
|
==== Encrypting HTTP Client Communications
|
2018-01-12 14:35:16 -05:00
|
|
|
|
|
2018-02-15 14:41:01 -05:00
|
|
|
|
When {security} is enabled, you can optionally use TLS to ensure that
|
|
|
|
|
communication between HTTP clients and the cluster is encrypted.
|
2018-01-12 14:35:16 -05:00
|
|
|
|
|
2018-02-15 14:41:01 -05:00
|
|
|
|
NOTE: Enabling TLS on the HTTP layer is strongly recommended but is not required.
|
|
|
|
|
If you enable TLS on the HTTP layer in {es}, then you might need to make
|
|
|
|
|
configuration changes in other parts of the Elastic Stack and in any {es}
|
|
|
|
|
clients that you use.
|
|
|
|
|
|
|
|
|
|
. If you have not done so already, <<node-certificates,generate node certificates>>.
|
|
|
|
|
|
|
|
|
|
. Enable TLS and specify the information required to access the node’s
|
|
|
|
|
certificate.
|
2018-01-12 14:35:16 -05:00
|
|
|
|
|
|
|
|
|
** If the certificate is in PKCS#12 format, add the following information to the
|
|
|
|
|
`elasticsearch.yml` file on each node:
|
|
|
|
|
+
|
|
|
|
|
--
|
2018-02-15 14:41:01 -05:00
|
|
|
|
[source, yaml]
|
|
|
|
|
--------------------------------------------------
|
|
|
|
|
xpack.security.http.ssl.enabled: true
|
|
|
|
|
xpack.security.http.ssl.keystore.path: certs/elastic-certificates.p12 <1>
|
|
|
|
|
xpack.security.http.ssl.truststore.path: certs/elastic-certificates.p12 <2>
|
|
|
|
|
--------------------------------------------------
|
2018-01-12 14:35:16 -05:00
|
|
|
|
<1> If you created a separate certificate for each node, then you might need to
|
|
|
|
|
customize this path on each node. If the filename matches the node name, you can
|
|
|
|
|
use the `certs/${node.name}.p12` format, for example.
|
2018-04-10 18:57:08 -04:00
|
|
|
|
<2> The `elasticsearch-certutil` output includes the CA certificate inside the
|
|
|
|
|
PKCS#12 keystore, therefore the keystore can also be used as the truststore.
|
|
|
|
|
This name should match the `keystore.path` value.
|
2018-01-12 14:35:16 -05:00
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
** If the certificate is in PEM format, add the following information to the
|
|
|
|
|
`elasticsearch.yml` file on each node:
|
|
|
|
|
+
|
|
|
|
|
--
|
|
|
|
|
[source, yaml]
|
|
|
|
|
--------------------------------------------------
|
2018-02-15 14:41:01 -05:00
|
|
|
|
xpack.security.http.ssl.enabled: true
|
2018-05-14 16:07:27 -04:00
|
|
|
|
xpack.security.http.ssl.key: /home/es/config/node01.key <1>
|
|
|
|
|
xpack.security.http.ssl.certificate: /home/es/config/node01.crt <2>
|
|
|
|
|
xpack.security.http.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <3>
|
2018-01-12 14:35:16 -05:00
|
|
|
|
--------------------------------------------------
|
|
|
|
|
<1> The full path to the node key file. This must be a location within the
|
|
|
|
|
{es} configuration directory.
|
|
|
|
|
<2> The full path to the node certificate. This must be a location within the
|
|
|
|
|
{es} configuration directory.
|
|
|
|
|
<3> An array of paths to the CA certificates that should be trusted. These paths
|
|
|
|
|
must be a location within the {es} configuration directory.
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
. If you secured the node's certificate with a password, add the password to
|
|
|
|
|
your {es} keystore:
|
2018-02-15 14:41:01 -05:00
|
|
|
|
|
|
|
|
|
** If the signed certificate is in PKCS#12 format, use the following commands:
|
2018-01-12 14:35:16 -05:00
|
|
|
|
+
|
|
|
|
|
--
|
|
|
|
|
[source,shell]
|
|
|
|
|
-----------------------------------------------------------
|
2018-02-15 14:41:01 -05:00
|
|
|
|
bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
|
2018-01-12 14:35:16 -05:00
|
|
|
|
|
2018-02-15 14:41:01 -05:00
|
|
|
|
bin/elasticsearch-keystore add xpack.security.http.ssl.truststore.secure_password
|
2018-01-12 14:35:16 -05:00
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
--
|
|
|
|
|
|
2018-02-15 14:41:01 -05:00
|
|
|
|
** If the certificate is in PEM format, use the following commands:
|
2018-01-12 14:35:16 -05:00
|
|
|
|
+
|
|
|
|
|
--
|
2018-02-15 14:41:01 -05:00
|
|
|
|
[source,shell]
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
bin/elasticsearch-keystore add xpack.security.http.ssl.secure_key_passphrase
|
|
|
|
|
-----------------------------------------------------------
|
2018-01-12 14:35:16 -05:00
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
. Restart {es}.
|
|
|
|
|
|
|
|
|
|
NOTE: All TLS-related node settings are considered to be highly sensitive and
|
|
|
|
|
therefore are not exposed via the
|
|
|
|
|
{ref}/cluster-nodes-info.html#cluster-nodes-info[nodes info API] For more
|
|
|
|
|
information about any of these settings, see <<security-settings>>.
|