Hello,
I used this script to generate the certificates:
#!/bin/bash
echo â**********â
echo â* Root CAâ
openssl genrsa -out root-ca-key.pem 2048"
openssl req -days 3650 -new -x509 -sha256 -key root-ca-key.pem -out root-ca.pem -subj â/C=DE/L=Berlin/O=Company/CN=root-caââ
echo â**********â
echo â* Admin certâ
echo âcreate: admin-key-temp.pemâ
openssl genrsa -out admin-key-temp.pem 2048
echo âcreate: admin-key.pemâ
openssl pkcs8 -inform PEM -outform PEM -in admin-key-temp.pem -topk8 -nocrypt -v1 PBE-SHA1-3DES -out admin-key.pem
echo âcreate: admin.csrâ
openssl req -days 3650 -new -key admin-key.pem -out admin.csr -subj â/C=US/L=NewYork/O=CompanyUS/CN=adminâ
echo âcreate: admin.pemâ
openssl x509 -req -days 3650 -in admin.csr -CA root-ca.pem -CAkey root-ca-key.pem -CAcreateserial -sha256 -out admin.pem
echo â**********â
echo â* Node certâ
echo âcreate: node-key-temp.pemâ
openssl genrsa -out node-key-temp.pem 2048
echo âcreate: node-key.pemâ
openssl pkcs8 -inform PEM -outform PEM -in node-key-temp.pem -topk8 -nocrypt -v1 PBE-SHA1-3DES -out node-key.pem
echo âcreate: node.csrâ
openssl req -days 3650 -new -key node-key.pem -out node.csr -subj â/C=DE/L=Berlin/O=Company/CN=*.elasticsearchâ
echo âcreate: node.pemâ
openssl x509 -req -days 3650 -in node.csr -CA root-ca.pem -CAkey root-ca-key.pem -CAcreateserial -sha256 -out node.pem
echo â**********â
echo â* Kibana certâ
echo âcreate: kibana-key-temp.pemâ
openssl genrsa -out kibana-key-temp.pem 2048
echo âcreate: kibana-key.pemâ
openssl pkcs8 -inform PEM -outform PEM -in kibana-key-temp.pem -topk8 -nocrypt -v1 PBE-SHA1-3DES -out kibana-key.pem
echo âcreate: kibana.csrâ
openssl req -days 3650 -new -key kibana-key.pem -out kibana.csr -subj â/C=DE/L=Berlin/O=Company/CN=kibanaâ
echo âcreate: kibana.pemâ
openssl x509 -req -days 3650 -in kibana.csr -CA root-ca.pem -CAkey root-ca-key.pem -CAcreateserial -sha256 -out kibana.pem
echo â*** Ende ***â
And here is my Elasticsearch.yml:
cluster.name: âk8s-logsâ
network.host: 0.0.0.0
path.repo: [â/var/nfsâ]
opendistro_security.ssl.transport.pemcert_filepath: node.pem
opendistro_security.ssl.transport.pemkey_filepath: node-key.pem
opendistro_security.ssl.transport.pemtrustedcas_filepath: root-ca.pem
opendistro_security.ssl.transport.enforce_hostname_verification: false
opendistro_security.ssl.http.enabled: true
opendistro_security.ssl.http.pemcert_filepath: node.pem
opendistro_security.ssl.http.pemkey_filepath: node-key.pem
opendistro_security.ssl.http.pemtrustedcas_filepath: root-ca.pem
#opendistro_security.allow_unsafe_democertificates: true
opendistro_security.allow_default_init_securityindex: true
opendistro_security.authcz.admin_dn:
- âCN=admin,O=CompanyUS,L=NewYork,C=USâ
opendistro_security.nodes_dn:
-
âCN=*.elasticsearch,O=Company,L=Berlin,C=DEâ
-
âCN=kibana,O=Company,L=Berlin,C=DEâ
-
âCN=*,O=Company,L=Berlin,C=DEâ
-
âCN=k8s-logs*â
-
â/CN=.*regex/â
opendistro_security.audit.type: internal_elasticsearch
opendistro_security.enable_snapshot_restore_privilege: true
opendistro_security.check_snapshot_restore_write_privileges: true
opendistro_security.restapi.roles_enabled: [âall_accessâ, âsecurity_rest_api_accessâ]
cluster.routing.allocation.disk.threshold_enabled: false
node.max_local_storage_nodes: 3
For test environments you can use the demo certificates (already included in the docker image).
Btw: OpenIDconnect is sill not working.
Best regards
Lorenz