Skip to content

Instantly share code, notes, and snippets.

@Simonx123
Forked from Callonski/xpac_elasticsearch.sh
Created September 7, 2020 01:04
Show Gist options
  • Save Simonx123/33fad2997bbb268593d0ad789f4757b9 to your computer and use it in GitHub Desktop.
Save Simonx123/33fad2997bbb268593d0ad789f4757b9 to your computer and use it in GitHub Desktop.
################### X-PAC SECURITY FEATURES #######################
gsutil cp "my-gcs-bucket-with-elastic-certificates" /etc/elasticsearch
gsutil cp "${ca_bucket}http.p12" /etc/elasticsearch
chmod 777 /etc/elasticsearch
cat <<EOT >> /etc/elasticsearch/elasticsearch.yml
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: /etc/elasticsearch/http.p12
xpack.security.http.ssl.keystore.secure_password: ''
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.audit.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/elastic-certificates.p12
EOT
echo "${elastic_pw}" | sudo ./bin/elasticsearch-keystore add -xf bootstrap.password
systemctl restart elasticsearch.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment