diff --git a/.travis.yml b/.travis.yml index 94d477a..3f30de5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,10 @@ before_script: # Build images - docker-compose build - # Use built-in users - - sed -i 's/\(elasticsearch.username:\) elastic/\1 kibana/g' kibana/config/kibana.yml - - sed -i 's/\(xpack.monitoring.elasticsearch.username:\) elastic/\1 logstash_system/g' logstash/config/logstash.yml + # Use built-in users with passwords set by 'elasticsearch-setup-passwords.exp' + - sed -i -e 's/\(elasticsearch.username:\) elastic/\1 kibana/g' -e 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' kibana/config/kibana.yml + - 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 script: # Compose diff --git a/.travis/elasticsearch-setup-passwords.exp b/.travis/elasticsearch-setup-passwords.exp index b5ff68d..4b72292 100755 --- a/.travis/elasticsearch-setup-passwords.exp +++ b/.travis/elasticsearch-setup-passwords.exp @@ -2,7 +2,7 @@ # List of expected users with dummy password set user "(elastic|apm_system|kibana|logstash_system|beats_system|remote_monitoring_user)" -set password "changeme" +set password "testpasswd" # Find elasticsearch container id set MODE [lindex $argv 0] diff --git a/.travis/run-tests.sh b/.travis/run-tests.sh index 26e24a8..defc569 100755 --- a/.travis/run-tests.sh +++ b/.travis/run-tests.sh @@ -58,10 +58,10 @@ if [ "$#" -ge 1 ]; then fi log 'Waiting for Elasticsearch readiness' -poll_ready elasticsearch 'http://localhost:9200/' 'elastic:changeme' +poll_ready elasticsearch 'http://localhost:9200/' 'elastic:testpasswd' log 'Waiting for Kibana readiness' -poll_ready kibana 'http://localhost:5601/api/status' 'kibana:changeme' +poll_ready kibana 'http://localhost:5601/api/status' 'kibana:testpasswd' log 'Waiting for Logstash readiness' poll_ready logstash 'http://localhost:9600/_node/pipelines/main?pretty' @@ -72,11 +72,11 @@ curl -X POST -D- 'http://localhost:5601/api/saved_objects/index-pattern' \ -s -w '\n' \ -H 'Content-Type: application/json' \ -H "kbn-version: ${ELK_VERSION}" \ - -u elastic:changeme \ + -u elastic:testpasswd \ -d '{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}' log 'Searching index pattern via Kibana API' -response="$(curl 'http://localhost:5601/api/saved_objects/_find?type=index-pattern' -s -u elastic:changeme)" +response="$(curl 'http://localhost:5601/api/saved_objects/_find?type=index-pattern' -s -u elastic:testpasswd)" echo "$response" count="$(jq -rn --argjson data "${response}" '$data.total')" if [[ $count -ne 1 ]]; then @@ -85,14 +85,14 @@ if [[ $count -ne 1 ]]; then fi log 'Sending message to Logstash TCP input' -echo 'dockerelk' | nc localhost 5000 +echo 'dockerelk' | nc -q0 localhost 5000 sleep 1 -curl -X POST 'http://localhost:9200/_refresh' -u elastic:changeme \ +curl -X POST 'http://localhost:9200/_refresh' -u elastic:testpasswd \ -s -w '\n' log 'Searching message in Elasticsearch' -response="$(curl 'http://localhost:9200/_count?q=message:dockerelk&pretty' -s -u elastic:changeme)" +response="$(curl 'http://localhost:9200/_count?q=message:dockerelk&pretty' -s -u elastic:testpasswd)" echo "$response" count="$(jq -rn --argjson data "${response}" '$data.count')" if [[ $count -ne 1 ]]; then