Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 32ce4b1

Browse files
committed
Move SSL/TLS setup to it's own document
1 parent 88f270b commit 32ce4b1

File tree

2 files changed

+76
-72
lines changed

2 files changed

+76
-72
lines changed

README.md

+1-72
Original file line numberDiff line numberDiff line change
@@ -370,79 +370,8 @@ These can either be set to a user declared in the file based realm, with admin p
370370

371371
#### X-Pack Security SSL/TLS
372372

373-
The role allows configuring HTTP and transport layer SSL/TLS for the cluster. You will need to generate and provide your own PKCS12 or PEM encoded certificates as described in [Encrypting communications in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/configuring-tls.html#configuring-tls).
373+
* To configure your cluster with SSL/TLS for HTTP and/or transport communications follow the [SSL/TLS setup procedure](./docs/ssl-tls-setup.md)
374374

375-
The following should be configured to ensure a security-enabled cluster successfully forms:
376-
377-
* `es_enable_http_ssl` Default `false`. Setting this to `true` will enable HTTP client SSL/TLS
378-
* `es_enable_transport_ssl` - Default `false`. Setting this to `true` will enable transport layer SSL/TLS
379-
380-
When using a [PKCS12](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#security-http-pkcs12-files) keystore and truststore:
381-
382-
* `es_ssl_keystore` path to your PKCS12 keystore (can be the same as `es_ssl_truststore`)
383-
* `es_ssl_keystore_password` set this if your keystore is protected with a password
384-
* `es_ssl_truststore` path to your PKCS12 keystore (can be the same as `es_ssl_keystore`)
385-
* `es_ssl_truststore_password` set this if your truststore is protected with a password
386-
387-
When using [PEM encoded](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#_pem_encoded_files_3) certificates:
388-
389-
* `es_ssl_key` path to your SSL key
390-
* `es_ssl_key_password` set this if your SSL key is protected with a password
391-
* `es_ssl_certificate` the path to your SSL certificate
392-
393-
##### Generating an SSL keystore
394-
395-
With a password:
396-
397-
```shell
398-
$ bin/elasticsearch-certutil ca --out ./my-ca.p12 --pass "ca_password"
399-
$ bin/elasticsearch-certutil cert --ca ./my-ca.p12 --ca-pass "ca_password" --out ./my-keystore.p12 --pass "keystore_password"
400-
```
401-
402-
Without a password:
403-
404-
```shell
405-
$ bin/elasticsearch-certutil ca --out ./my-ca.p12 --pass ""
406-
$ bin/elasticsearch-certutil cert --ca ./my-ca.p12 --out ./my-keystore.p12 --pass ""
407-
```
408-
409-
##### Additional optional SSL/TLS configuration
410-
411-
* `es_ssl_certificate_path` Default `{{ es_conf_dir }}/certs`. The location where certificates should be stored on the ES node.
412-
* `es_ssl_verification_mode` Default `certificate`. See [SSL verification_mode](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#ssl-tls-settings) for options.
413-
* `es_ssl_certificate_authority` PEM encoded certificate file that should be trusted.
414-
* `es_validate_certs` Default `yes`. Determines if ansible should validate SSL certificates when performing actions over HTTPS. e.g. installing templates and managing native users.
415-
416-
##### Example SSL/TLS configuration
417-
418-
```yaml
419-
- name: Elasticsearch with SSL/TLS enabled
420-
hosts: localhost
421-
roles:
422-
- role: elastic.elasticsearch
423-
vars:
424-
es_config:
425-
node.name: "node1"
426-
cluster.name: "custom-cluster"
427-
discovery.seed_hosts: "localhost:9301"
428-
http.port: 9201
429-
transport.port: 9301
430-
node.data: false
431-
node.master: true
432-
bootstrap.memory_lock: true
433-
xpack.security.authc.realms.file.file1.order: 0
434-
xpack.security.authc.realms.native.native1.order: 1
435-
es_heap_size: 1g
436-
es_api_basic_auth_username: elastic
437-
es_api_basic_auth_password: changeme
438-
es_enable_http_ssl: true
439-
es_enable_transport_ssl: true
440-
es_ssl_keystore: "files/certs/my-keystore.p12"
441-
es_ssl_truststore: "files/certs/my-truststore.p12"
442-
es_ssl_keystore_password: "keystore_password"
443-
es_ssl_truststore_password: "truststore_password"
444-
es_validate_certs: no
445-
```
446375

447376
### Additional Configuration
448377

docs/ssl-tls-setup.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# X-Pack Security SSL/TLS
2+
3+
The role allows configuring HTTP and transport layer SSL/TLS for the cluster. You will need to generate and provide your own PKCS12 or PEM encoded certificates as described in [Encrypting communications in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/configuring-tls.html#configuring-tls).
4+
5+
The following should be configured to ensure a security-enabled cluster successfully forms:
6+
7+
* `es_enable_http_ssl` Default `false`. Setting this to `true` will enable HTTP client SSL/TLS
8+
* `es_enable_transport_ssl` - Default `false`. Setting this to `true` will enable transport layer SSL/TLS
9+
10+
When using a [PKCS12](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#security-http-pkcs12-files) keystore and truststore:
11+
12+
* `es_ssl_keystore` path to your PKCS12 keystore (can be the same as `es_ssl_truststore`)
13+
* `es_ssl_keystore_password` set this if your keystore is protected with a password
14+
* `es_ssl_truststore` path to your PKCS12 keystore (can be the same as `es_ssl_keystore`)
15+
* `es_ssl_truststore_password` set this if your truststore is protected with a password
16+
17+
When using [PEM encoded](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#_pem_encoded_files_3) certificates:
18+
19+
* `es_ssl_key` path to your SSL key
20+
* `es_ssl_key_password` set this if your SSL key is protected with a password
21+
* `es_ssl_certificate` the path to your SSL certificate
22+
23+
## Generating an SSL keystore
24+
25+
With a password:
26+
27+
```shell
28+
$ bin/elasticsearch-certutil ca --out ./my-ca.p12 --pass "ca_password"
29+
$ bin/elasticsearch-certutil cert --ca ./my-ca.p12 --ca-pass "ca_password" --out ./my-keystore.p12 --pass "keystore_password"
30+
```
31+
32+
Without a password:
33+
34+
```shell
35+
$ bin/elasticsearch-certutil ca --out ./my-ca.p12 --pass ""
36+
$ bin/elasticsearch-certutil cert --ca ./my-ca.p12 --out ./my-keystore.p12 --pass ""
37+
```
38+
39+
## Additional optional SSL/TLS configuration
40+
41+
* `es_ssl_certificate_path` Default `{{ es_conf_dir }}/certs`. The location where certificates should be stored on the ES node.
42+
* `es_ssl_verification_mode` Default `certificate`. See [SSL verification_mode](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#ssl-tls-settings) for options.
43+
* `es_ssl_certificate_authority` PEM encoded certificate file that should be trusted.
44+
* `es_validate_certs` Default `yes`. Determines if ansible should validate SSL certificates when performing actions over HTTPS. e.g. installing templates and managing native users.
45+
46+
## Example SSL/TLS configuration
47+
48+
```yaml
49+
- name: Elasticsearch with SSL/TLS enabled
50+
hosts: localhost
51+
roles:
52+
- role: elastic.elasticsearch
53+
vars:
54+
es_config:
55+
node.name: "node1"
56+
cluster.name: "custom-cluster"
57+
discovery.seed_hosts: "localhost:9301"
58+
http.port: 9201
59+
transport.port: 9301
60+
node.data: false
61+
node.master: true
62+
bootstrap.memory_lock: true
63+
xpack.security.authc.realms.file.file1.order: 0
64+
xpack.security.authc.realms.native.native1.order: 1
65+
es_heap_size: 1g
66+
es_api_basic_auth_username: elastic
67+
es_api_basic_auth_password: changeme
68+
es_enable_http_ssl: true
69+
es_enable_transport_ssl: true
70+
es_ssl_keystore: "files/certs/my-keystore.p12"
71+
es_ssl_truststore: "files/certs/my-truststore.p12"
72+
es_ssl_keystore_password: "keystore_password"
73+
es_ssl_truststore_password: "truststore_password"
74+
es_validate_certs: no
75+
```

0 commit comments

Comments
 (0)