Hi everyone,
I'm having a bit of an hard time configuring TLS in a production environment. I already have TLS running on a test environment (with autoconfiguration, using .deb package). At the end of the procedure it prints something like this:
For production cluster deployments you will need to replace ca and HTTP and transport certificates with those from your enterprise CA
So now I'd like to ask:
1- if this will improve security in any meaningful way or (from what I've read) it's just a convenience since the CA would be already present of servers.
2- if it's needed, how can it be configured.
This is what a tried so far (I have a wildcard certificate from a CA):
- configuring pem certificate + key + ca but it complains about a missing keystore when I try to generate an enrollment token:
./bin/elasticsearch-create-enrollment-token -s node --url "https://myfqdn:9200"
Unable to create enrollment token for scope [node]
ERROR: Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration is not configured with a keystore
- creating a keystore with
openssl pkcs12 -export -out keystore.p12 -inkey cert.key -in cert.crt
without password but it fails because of a missing password. - creating the above keystore with a password, added the password with:
./elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password
./elasticsearch-keystore add xpack.security.transport.ssl.trustore.secure_password
./elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
the keystore is created from a file with chained certificate in the correct order. I tried to create one with server certificate + ca certificate + intermediate + root ca (and certificate + ca and certificate only), with
openssl pkcs12 -export -out keystore.p12 -inkey mykey.key -in mycert.crt
if I inspect the keystore:
Keystore type: PKCS12
Keystore provider: SUN
Your keystore contains 1 entry
Alias name: 1
Creation date: Jul 28, 2022
Entry type: PrivateKeyEntry
Certificate chain length: 3
Certificate[1]:
...
I can see 3 certificates in there but elasticsearch doesn't start with the error below:
Caused by: org.elasticsearch.common.ssl.SslConfigException: the truststore [/etc/elasticsearch/certs/xxx.p12] does not contain any trusted certificate entries.
This is (part of) my elasticserch.yml just in case:
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
enabled: true
keystore.path: certs/keystore.p12
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/keystore.p12
truststore.path: certs/keystore.p12
Thanks for your help.