Quote passwords to prevent interpreting leading special chars

Closes #667
This commit is contained in:
Antoine Cotten 2022-02-11 19:06:13 +01:00
parent b77b7fb66a
commit ca98168da1
No known key found for this signature in database
GPG Key ID: 94637E68D4A79DD0
9 changed files with 16 additions and 18 deletions

View File

@ -65,13 +65,12 @@ jobs:
# Change password of 'elastic' user from 'changeme' to 'testpasswd' in config files # Change password of 'elastic' user from 'changeme' to 'testpasswd' in config files
sed -i -e 's/\(xpack.monitoring.elasticsearch.username:\) elastic/\1 logstash_system/g' -e 's/\(xpack.monitoring.elasticsearch.password:\) changeme/\1 testpasswd/g' logstash/config/logstash.yml
sed -i 's/\(password =>\) "changeme"/\1 "testpasswd"/g' logstash/pipeline/logstash.conf sed -i 's/\(password =>\) "changeme"/\1 "testpasswd"/g' logstash/pipeline/logstash.conf
sed -i 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' kibana/config/kibana.yml sed -i 's/\(elasticsearch.password:\) '\''changeme'\''/\1 testpasswd/g' kibana/config/kibana.yml
sed -i -e 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' -e 's/\(secret_management.encryption_keys:\)/\1 [test-encrypt]/g' extensions/enterprise-search/config/enterprise-search.yml sed -i -e 's/\(elasticsearch.password:\) '\''changeme'\''/\1 testpasswd/g' -e 's/\(secret_management.encryption_keys:\)/\1 [test-encrypt]/g' extensions/enterprise-search/config/enterprise-search.yml
sed -i 's/\(password:\) changeme/\1 testpasswd/g' extensions/apm-server/config/apm-server.yml sed -i 's/\(password:\) '\''changeme'\''/\1 testpasswd/g' extensions/apm-server/config/apm-server.yml
sed -i 's/\(password:\) changeme/\1 testpasswd/g' extensions/metricbeat/config/metricbeat.yml sed -i 's/\(password:\) '\''changeme'\''/\1 testpasswd/g' extensions/metricbeat/config/metricbeat.yml
sed -i 's/\(password:\) changeme/\1 testpasswd/g' extensions/filebeat/config/filebeat.yml sed -i 's/\(password:\) '\''changeme'\''/\1 testpasswd/g' extensions/filebeat/config/filebeat.yml
# Run Elasticsearch and wait for its availability # Run Elasticsearch and wait for its availability
@ -286,9 +285,8 @@ jobs:
# Change password of 'elastic' user from 'changeme' to 'testpasswd' in config files # Change password of 'elastic' user from 'changeme' to 'testpasswd' in config files
sed -i -e 's/\(xpack.monitoring.elasticsearch.username:\) elastic/\1 logstash_system/g' -e 's/\(xpack.monitoring.elasticsearch.password:\) changeme/\1 testpasswd/g' logstash/config/logstash.yml
sed -i 's/\(password =>\) "changeme"/\1 "testpasswd"/g' logstash/pipeline/logstash.conf sed -i 's/\(password =>\) "changeme"/\1 "testpasswd"/g' logstash/pipeline/logstash.conf
sed -i 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' kibana/config/kibana.yml sed -i 's/\(elasticsearch.password:\) '\''changeme'\''/\1 testpasswd/g' kibana/config/kibana.yml
# Run Elasticsearch and wait for its availability # Run Elasticsearch and wait for its availability

View File

@ -13,8 +13,8 @@ services:
- "9200:9200" - "9200:9200"
- "9300:9300" - "9300:9300"
environment: environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m" ES_JAVA_OPTS: -Xmx256m -Xms256m
ELASTIC_PASSWORD: changeme ELASTIC_PASSWORD: 'changeme'
# Use single node discovery in order to disable production mode and avoid bootstrap checks. # Use single node discovery in order to disable production mode and avoid bootstrap checks.
# see: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html # see: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
discovery.type: single-node discovery.type: single-node
@ -35,7 +35,7 @@ services:
- "5000:5000/udp" - "5000:5000/udp"
- "9600:9600" - "9600:9600"
environment: environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m" LS_JAVA_OPTS: -Xmx256m -Xms256m
networks: networks:
- elk - elk
depends_on: depends_on:

View File

@ -5,4 +5,4 @@ output:
elasticsearch: elasticsearch:
hosts: ['http://elasticsearch:9200'] hosts: ['http://elasticsearch:9200']
username: elastic username: elastic
password: changeme password: 'changeme'

View File

@ -5,7 +5,7 @@ client:
hosts: hosts:
- elasticsearch - elasticsearch
port: 9200 port: 9200
http_auth: elastic:changeme http_auth: 'elastic:changeme'
logging: logging:
loglevel: INFO loglevel: INFO

View File

@ -22,7 +22,7 @@ kibana.host: http://localhost:5601
# Elasticsearch URL and credentials # Elasticsearch URL and credentials
elasticsearch.host: http://elasticsearch:9200 elasticsearch.host: http://elasticsearch:9200
elasticsearch.username: elastic elasticsearch.username: elastic
elasticsearch.password: changeme elasticsearch.password: 'changeme'
# Allow Enterprise Search to modify Elasticsearch settings. Used to enable auto-creation of Elasticsearch indexes. # Allow Enterprise Search to modify Elasticsearch settings. Used to enable auto-creation of Elasticsearch indexes.
allow_es_settings_modification: true allow_es_settings_modification: true

View File

@ -13,7 +13,7 @@ services:
read_only: true read_only: true
environment: environment:
JAVA_OPTS: -Xmx2g -Xms2g JAVA_OPTS: -Xmx2g -Xms2g
ENT_SEARCH_DEFAULT_PASSWORD: changeme ENT_SEARCH_DEFAULT_PASSWORD: 'changeme'
ports: ports:
- '3002:3002' - '3002:3002'
networks: networks:

View File

@ -20,7 +20,7 @@ processors:
output.elasticsearch: output.elasticsearch:
hosts: ['http://elasticsearch:9200'] hosts: ['http://elasticsearch:9200']
username: elastic username: elastic
password: changeme password: 'changeme'
## HTTP endpoint for health checking ## HTTP endpoint for health checking
## https://www.elastic.co/guide/en/beats/filebeat/current/http-endpoint.html ## https://www.elastic.co/guide/en/beats/filebeat/current/http-endpoint.html

View File

@ -34,7 +34,7 @@ processors:
output.elasticsearch: output.elasticsearch:
hosts: ['http://elasticsearch:9200'] hosts: ['http://elasticsearch:9200']
username: elastic username: elastic
password: changeme password: 'changeme'
## HTTP endpoint for health checking ## HTTP endpoint for health checking
## https://www.elastic.co/guide/en/beats/metricbeat/current/http-endpoint.html ## https://www.elastic.co/guide/en/beats/metricbeat/current/http-endpoint.html

View File

@ -10,4 +10,4 @@ monitoring.ui.container.elasticsearch.enabled: true
## X-Pack security credentials ## X-Pack security credentials
# #
elasticsearch.username: kibana_system elasticsearch.username: kibana_system
elasticsearch.password: changeme elasticsearch.password: 'changeme'