Skip to content

Commit 01a6dae

Browse files
lcawljkakavastvernum
authored
[DOCS] Adds certutil http command to TLS setup steps (elastic#51241)
Co-Authored-By: Ioannis Kakavas <[email protected]> Co-Authored-By: Tim Vernum <[email protected]>
1 parent 576bcf1 commit 01a6dae

File tree

3 files changed

+70
-39
lines changed

3 files changed

+70
-39
lines changed

x-pack/docs/en/security/securing-communications/node-certificates.asciidoc

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[node-certificates]]
2-
==== Generating Node Certificates
2+
==== Generating node certificates
33

44
TLS requires X.509 certificates to perform encryption and authentication of the
55
application that is being communicated with. In order for the communication
@@ -75,12 +75,27 @@ signing requests (CSR) for the nodes in your cluster. For more information, see
7575
<<certutil>>.
7676
--
7777

78-
. Copy the node certificate to the appropriate locations.
78+
. Optional: Generate additional certificates specifically for encrypting HTTP
79+
client communications.
7980
+
8081
--
81-
Copy the applicable `.p12` file into a directory within the {es} configuration
82-
directory on each node. For example, `/home/es/config/certs`. There is no need
83-
to copy the CA file to this directory.
82+
For example, use the `elasticsearch-certutil http` command:
83+
84+
[source,shell]
85+
----------------------------------------------------------
86+
bin/elasticsearch-certutil http
87+
----------------------------------------------------------
88+
89+
This command guides you through the process of generating the appropriate
90+
certificates for use in {es} and {kib}. If you created a CA for your cluster,
91+
you can re-use it by supplying its location when prompted.
92+
--
93+
94+
. Copy the node certificates to the appropriate locations.
95+
+
96+
--
97+
Copy the applicable files into the {es} configuration directory on each
98+
node.
8499

85100
For each additional Elastic product that you want to configure, copy the
86101
certificates to the relevant configuration directory.

x-pack/docs/en/security/securing-communications/tls-http.asciidoc

+47-31
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,63 @@
11
[role="xpack"]
22
[[tls-http]]
3-
==== Encrypting HTTP Client communications
3+
==== Encrypting HTTP client communications
44

55
When {security-features} are enabled, you can optionally use TLS to ensure that
66
communication between HTTP clients and the cluster is encrypted.
77

88
NOTE: Enabling TLS on the HTTP layer is strongly recommended but is not required.
99
If you enable TLS on the HTTP layer in {es}, then you might need to make
10-
configuration changes in other parts of the Elastic Stack and in any {es}
11-
clients that you use.
10+
configuration changes in other parts of the {stack} and in any {es} clients that
11+
you use.
1212

1313
. If you have not done so already, <<node-certificates,generate node certificates>>.
14+
+
15+
--
16+
In particular, you need the files that are generated by the following command:
17+
18+
[source,shell]
19+
----------------------------------------------------------
20+
bin/elasticsearch-certutil http
21+
----------------------------------------------------------
22+
23+
This command generates a zip file that contains certificates and keys for use in
24+
{es} and {kib}. Each folder contains a readme that explains how to use the files.
25+
--
26+
27+
. Verify that you've copied the output files to the appropriate locations, as
28+
specified in the readme files.
29+
+
30+
--
31+
For example, copy the `http.p12` file from the `elasticsearch` folder into a
32+
directory within the {es} configuration directory on each node. If you chose to
33+
generate one certificate per node, copy the appropriate `http.p12` file to each
34+
node. If you want to use {kib} to access this cluster, copy the
35+
`elasticsearch-ca.pem` file from the `kibana` folder into the {kib}
36+
configuration directory.
37+
--
1438

1539
. Enable TLS and specify the information required to access the node’s
16-
certificate.
40+
certificate. For example:
1741

18-
** If the certificate is in PKCS#12 format, add the following information to the
19-
`elasticsearch.yml` file on each node:
42+
.. Update the `elasticsearch.yml` file on each node with the location of the
43+
certificates.
2044
+
2145
--
46+
If the certificates are in PKCS#12 format:
47+
2248
[source, yaml]
2349
--------------------------------------------------
2450
xpack.security.http.ssl.enabled: true
25-
xpack.security.http.ssl.keystore.path: certs/elastic-certificates.p12 <1>
26-
xpack.security.http.ssl.truststore.path: certs/elastic-certificates.p12 <2>
51+
xpack.security.http.ssl.keystore.path: "http.p12"
2752
--------------------------------------------------
28-
<1> If you created a separate certificate for each node, then you might need to
29-
customize this path on each node. If the filename matches the node name, you can
30-
use the `certs/${node.name}.p12` format, for example.
31-
<2> The `elasticsearch-certutil` output includes the CA certificate inside the
32-
PKCS#12 keystore, therefore the keystore can also be used as the truststore.
33-
This name should match the `keystore.path` value.
34-
--
3553

36-
** If the certificate is in PEM format, add the following information to the
37-
`elasticsearch.yml` file on each node:
38-
+
39-
--
54+
If you have certificates in PEM format:
55+
4056
[source, yaml]
4157
--------------------------------------------------
4258
xpack.security.http.ssl.enabled: true
43-
xpack.security.http.ssl.key: /home/es/config/node01.key <1>
44-
xpack.security.http.ssl.certificate: /home/es/config/node01.crt <2>
59+
xpack.security.http.ssl.key: /home/es/config/node1_http.key <1>
60+
xpack.security.http.ssl.certificate: /home/es/config/node1_http.crt <2>
4561
xpack.security.http.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <3>
4662
--------------------------------------------------
4763
<1> The full path to the node key file. This must be a location within the
@@ -52,29 +68,29 @@ xpack.security.http.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <3
5268
must be a location within the {es} configuration directory.
5369
--
5470

55-
. If you secured the node's certificate with a password, add the password to
56-
your {es} keystore:
57-
58-
** If the signed certificate is in PKCS#12 format, use the following commands:
71+
.. If you secured the keystore or the private key with a password, add that password to a secure
72+
setting in {es}.
5973
+
6074
--
75+
If the certificates are in PKCS#12 format:
76+
6177
[source,shell]
6278
-----------------------------------------------------------
6379
bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
64-
65-
bin/elasticsearch-keystore add xpack.security.http.ssl.truststore.secure_password
6680
-----------------------------------------------------------
67-
--
6881

69-
** If the certificate is in PEM format, use the following commands:
70-
+
71-
--
82+
If the certificates are in PEM format:
83+
7284
[source,shell]
7385
-----------------------------------------------------------
7486
bin/elasticsearch-keystore add xpack.security.http.ssl.secure_key_passphrase
7587
-----------------------------------------------------------
7688
--
7789

90+
. Optional: If you want to use {kib}, follow the instructions in the readme
91+
provided by the `elasticsearch-certutil http` command or see
92+
{kibana-ref}/configuring-tls.html[Encrypting communications in {kib}].
93+
7894
. Restart {es}.
7995

8096
[NOTE]

x-pack/docs/en/security/securing-communications/tls-transport.asciidoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ certificate.
1919
-----------------------------------------------------------
2020
xpack.security.transport.ssl.enabled: true
2121
xpack.security.transport.ssl.verification_mode: certificate <1>
22-
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12 <2>
23-
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12 <3>
22+
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12 <2>
23+
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12 <3>
2424
-----------------------------------------------------------
2525
<1> If you used the `--dns` or `--ip` options with the `elasticsearch-certutil cert` command
2626
and you want to enable strict hostname checking, set the verification mode to
@@ -29,7 +29,7 @@ See <<ssl-tls-settings, `xpack.security.transport.ssl.verification_mode`>> for a
2929

3030
<2> If you created a separate certificate for each node, then you might need to
3131
customize this path on each node. If the filename matches the node name, you can
32-
use the `certs/${node.name}.p12` format, for example.
32+
use the `${node.name}.p12` format, for example.
3333
<3> The `elasticsearch-certutil` outputs a PKCS#12 keystore which includes the
3434
CA certificate as a trusted certificate entry. This allows for the keystore to
3535
also be used as a truststore. In this case, the path value should match

0 commit comments

Comments
 (0)