-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[DOCS] Adds certutil http command to TLS setup steps #51241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
6ecb50d
de62baf
2a81dfd
f7fa7a0
7e56887
66a23e4
1c472ec
5070d6a
d6a9314
79673e2
176e459
602156c
5d6f8f4
dda31ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,42 +1,58 @@ | ||||||
[role="xpack"] | ||||||
[[tls-http]] | ||||||
==== Encrypting HTTP Client communications | ||||||
==== Encrypting HTTP client communications | ||||||
|
||||||
When {security-features} are enabled, you can optionally use TLS to ensure that | ||||||
communication between HTTP clients and the cluster is encrypted. | ||||||
|
||||||
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. | ||||||
configuration changes in other parts of the {stack} and in any {es} clients that | ||||||
you use. | ||||||
|
||||||
. If you have not done so already, <<node-certificates,generate node certificates>>. | ||||||
+ | ||||||
-- | ||||||
In particular, you need the files that are generated by the following command: | ||||||
|
||||||
[source,shell] | ||||||
---------------------------------------------------------- | ||||||
bin/elasticsearch-certutil http | ||||||
---------------------------------------------------------- | ||||||
|
||||||
This command generates a zip file that contains certificates and keys for use in {es} and {kib}. Each folder contains a readme that explains how to use the files. | ||||||
-- | ||||||
|
||||||
. Verify that you've copied the output files to the appropriate locations, as | ||||||
specified in the readme files. | ||||||
+ | ||||||
-- | ||||||
For example, copy the `http.p12` file from the `elasticsearch` folder into a | ||||||
directory within the {es} configuration directory on each node. If you chose to | ||||||
generate one certificate per node, copy the appropriate `http.p12` file to each | ||||||
node. If you want to use {kib} to access this cluster, copy the | ||||||
`elasticsearch-ca.pem` file from the `kibana` folder into the {kib} | ||||||
configuration directory. | ||||||
-- | ||||||
|
||||||
. Enable TLS and specify the information required to access the node’s | ||||||
certificate. | ||||||
certificate. Follow the instructions in the readme in the `elasticsearch` folder | ||||||
of the zip file. For example: | ||||||
|
||||||
** If the certificate is in PKCS#12 format, add the following information to the | ||||||
`elasticsearch.yml` file on each node: | ||||||
.. Update the `elasticsearch.yml` file on each node with the location of the | ||||||
certificates. | ||||||
+ | ||||||
-- | ||||||
If the certificates are in PKCS#12 format: | ||||||
|
||||||
[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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tvernum I noticed that the output from the elasticsearch-certutil http command did not mention setting the truststore.path, so I've removed it here too. If it's still required, let me know and I'll re-add it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not required. Technically, setting a truststore would configure which certificates the server would trust if we had clientAuthentication enabled (PKI). We don't need that. It's also used by setup-passwords, but if no truststore is configured, it will assume that the keystore has the correct certificates and trust that, so it all works without needing any special config. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks! |
||||||
xpack.security.http.ssl.keystore.path: "http.p12" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that since we talked about using a certs folder in previous examples, it should be used here too:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should drop the |
||||||
-------------------------------------------------- | ||||||
<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. | ||||||
<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. | ||||||
-- | ||||||
|
||||||
** If the certificate is in PEM format, add the following information to the | ||||||
`elasticsearch.yml` file on each node: | ||||||
+ | ||||||
-- | ||||||
If the certificates are in PEM format: | ||||||
lcawl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
[source, yaml] | ||||||
-------------------------------------------------- | ||||||
xpack.security.http.ssl.enabled: true | ||||||
|
@@ -52,29 +68,29 @@ xpack.security.http.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <3 | |||||
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: | ||||||
|
||||||
** If the signed certificate is in PKCS#12 format, use the following commands: | ||||||
.. If you secured the certificate with a password, add that password to a secure | ||||||
lcawl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
setting in {es}. | ||||||
+ | ||||||
-- | ||||||
If the certificates are in PKCS#12 format: | ||||||
|
||||||
[source,shell] | ||||||
----------------------------------------------------------- | ||||||
bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password | ||||||
|
||||||
bin/elasticsearch-keystore add xpack.security.http.ssl.truststore.secure_password | ||||||
----------------------------------------------------------- | ||||||
-- | ||||||
|
||||||
** If the certificate is in PEM format, use the following commands: | ||||||
+ | ||||||
-- | ||||||
If the certificates are in PEM format: | ||||||
|
||||||
[source,shell] | ||||||
----------------------------------------------------------- | ||||||
bin/elasticsearch-keystore add xpack.security.http.ssl.secure_key_passphrase | ||||||
----------------------------------------------------------- | ||||||
-- | ||||||
|
||||||
. Optional: If you want to use {kib}, follow the instructions in the readme | ||||||
provided by the `elasticsearch-certutil http` command or see | ||||||
{kibana-ref}/configuring-tls.html[Encrypting communications in {kib}]. | ||||||
|
||||||
. Restart {es}. | ||||||
|
||||||
[NOTE] | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.