@@ -8,31 +8,38 @@ recommended approach for validating certificate authenticity in an {es} cluster
8
8
is to trust the certificate authority (CA) that signed the certificate. By doing
9
9
this, as nodes are added to your cluster they just need to use a certificate
10
10
signed by the same CA and the node is automatically allowed to join the cluster.
11
- Additionally, it is recommended that the certificates contain subject alternative
12
- names (SAN) that correspond to the node's IP address and DNS name so that
13
- hostname verification can be performed.
11
+ Additionally, it is recommended that the certificates contain subject
12
+ alternative names (SAN) that correspond to the node's IP address and DNS name
13
+ so that hostname verification can be performed.
14
14
15
15
The {ref}/certutil.html[`elasticsearch-certutil`] command simplifies the process
16
16
of generating certificates for the {stack}. It takes care of generating a CA and
17
17
signing certificates with the CA. It can be used interactively or in a silent
18
18
mode through the use of an input file. It also supports generation of
19
19
certificate signing requests (CSR), so that a commercial- or
20
- organization-specific CA can be used to sign the certificates. For example:
20
+ organization-specific CA can be used to sign the certificates.
21
21
22
- . Optional: Create a certificate authority for your {es} cluster.
22
+ NOTE: If you choose not to use `elasticsearch-certutil`, the certificates that
23
+ you obtain must allow for both `clientAuth` and `serverAuth` if the extended key
24
+ usage extension is present. The certificates need to be in PEM or PKCS#12
25
+ format. Although not required, it is highly recommended that the certificate
26
+ contain the DNS names and/or IP addresses of the node so that hostname
27
+ verification can be used.
28
+
29
+ . *Optional*: Create a certificate authority for your {es} cluster.
23
30
+
24
31
--
25
- For example, use the `elasticsearch-certutil ca` command:
32
+ Use the <<certutil-ca, `elasticsearch-certutil ca`>> command:
26
33
27
34
[source,shell]
28
- ----------------------------------------------------------
35
+ ----
29
36
bin/elasticsearch-certutil ca
30
- ----------------------------------------------------------
37
+ ----
31
38
32
39
You can configure the cluster to trust all nodes that have a certificate that
33
40
has been signed by this CA.
34
41
35
- The command outputs a single file, with a default name of `elastic-stack-ca.p12`.
42
+ The command outputs a single file with a default name of `elastic-stack-ca.p12`.
36
43
This file is a PKCS#12 keystore that contains the public certificate for your CA
37
44
and the private key that is used to sign the certificates for each node.
38
45
@@ -44,66 +51,66 @@ retain a copy of the file and remember its password.
44
51
. Generate a certificate and private key for each node in your cluster.
45
52
+
46
53
--
47
- For example, use the `elasticsearch-certutil cert` command:
54
+ Use the <<certutil-cert, `elasticsearch-certutil cert`>> command:
48
55
49
56
[source,shell]
50
- ----------------------------------------------------------
57
+ ----
51
58
bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
52
- ----------------------------------------------------------
59
+ ----
60
+ You are prompted for a password. You can enter a password for your
61
+ certificate and key, or you can leave the password blank.
62
+
53
63
The output is a single PKCS#12 keystore that includes the node certificate, node
54
64
key, and CA certificate.
55
65
56
- You are also prompted for a password. You can enter a password for your
57
- certificate and key, or you can leave the password blank by pressing Enter .
66
+ IMPORTANT: Secure all output files, which contain the private keys
67
+ for your instance .
58
68
59
- By default `elasticsearch-certutil` generates certificates that have no hostname
60
- information in them (that is, they do not have any Subject Alternative Name
61
- fields). This means that you can use the certificate for every node in your
62
- cluster, but you must turn off hostname verification as shown in the
63
- configuration below.
69
+ The `elasticsearch-certutil` command generates certificates that have no
70
+ hostname information in them such as SAN fields. This
71
+ means that you can use the certificate for every node in your cluster, but you
72
+ must turn off hostname verification.
64
73
65
74
If you want to use hostname verification within your cluster, run the
66
75
`elasticsearch-certutil cert` command once for each of your nodes and provide
67
76
the `--name`, `--dns` and `--ip` options.
68
77
69
- NOTE: You should secure the output files, since they contain the private keys
70
- for your instance.
71
-
72
78
Alternatively, if you want to use a commercial or organization-specific CA,
73
- you can use the `elasticsearch-certutil csr` command to generate certificate
74
- signing requests (CSR) for the nodes in your cluster. For more information, see
75
- <<certutil>>.
79
+ you can use the <<certutil-csr,`elasticsearch-certutil csr`>> command to
80
+ generate certificate signing requests (CSR) for the nodes in your cluster.
76
81
--
77
82
78
- . Optional: Generate additional certificates specifically for encrypting HTTP
79
- client communications.
83
+ . * Optional* : Generate additional certificates specifically for encrypting HTTP
84
+ client communications.
80
85
+
81
86
--
82
- For example, use the `elasticsearch-certutil http` command:
87
+ Use the <<certutil-http, `elasticsearch-certutil http`>> command:
83
88
84
89
[source,shell]
85
- ----------------------------------------------------------
90
+ ----
86
91
bin/elasticsearch-certutil http
87
- ----------------------------------------------------------
92
+ ----
88
93
89
94
This command guides you through the process of generating the appropriate
90
95
certificates for use in {es} and {kib}. If you created a CA for your cluster,
91
96
you can re-use it by supplying its location when prompted.
92
97
--
93
98
94
- . Copy the node certificates to the appropriate locations.
99
+ . Copy the node certificate to the appropriate locations.
100
+
101
+ .. Create a folder in the configuration directory on each {es} node to contain
102
+ your security certificates. For example, create a `certs` folder in the
103
+ `/home/es/config/certs` directory.
95
104
+
96
- --
97
- Copy the applicable files into the {es} configuration directory on each
98
- node.
105
+ NOTE: The <<config-files-location,{es} configuration directory>> varies
106
+ depending on your {es} installation.
99
107
100
- For each additional Elastic product that you want to configure, copy the
101
- certificates to the relevant configuration directory.
102
- --
108
+ .. Copy the node certificates into the `certs` directory that you created in the
109
+ previous step.
103
110
104
- NOTE: If you choose not to use `elasticsearch-certutil`, the certificates that
105
- you obtain must allow for both `clientAuth` and `serverAuth` if the extended key
106
- usage extension is present. The certificates need to be in PEM or PKCS#12
107
- format. Although not required, it is highly recommended that the certificate
108
- contain the DNS names and/or IP addresses of the node so that hostname
109
- verification can be used .
111
+ .. Copy the `.p12` keystore file into the {es} configuration directory. {es}
112
+ will fail to start if the keystore file is located anywhere except this
113
+ directory.
114
+
115
+ .. For each additional Elastic product that you want to configure, copy the
116
+ certificates to the relevant configuration directory .
0 commit comments