Merge wazuh container from 3.10-refactor

This commit is contained in:
Manuel Gutierrez
2020-01-09 18:07:33 +01:00
parent 370c59dbe7
commit 6038525d4b
16 changed files with 102 additions and 153 deletions
@@ -0,0 +1,31 @@
#!/usr/bin/with-contenv bash
# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2)
set -e
WAZUH_FILEBEAT_MODULE=wazuh-filebeat-0.1.tar.gz
if [ "$ELASTICSEARCH_URL" != "" ]; then
>&2 echo "Customize Elasticsearch ouput IP"
sed -i 's|http://elasticsearch:9200|'$ELASTICSEARCH_URL'|g' /etc/filebeat/filebeat.yml
fi
# Configure filebeat.yml security settings
if [ "$SSL_CERTIFICATE_AUTHORITIES" != "" ]; then
>&2 echo "Configuring Certificate Authorities."
sed -i 's|#ssl.certificate_authorities:|'ssl.certificate_authorities:\ [\"$SSL_CERTIFICATE_AUTHORITIES\"]'|g' /etc/filebeat/filebeat.yml
fi
if [ "$USERNAME" != "" ]; then
>&2 echo "Configuring username."
sed -i 's|#username:|'username:\ \"$USERNAME\"'|g' /etc/filebeat/filebeat.yml
fi
if [ "$PASSWORD" != "" ]; then
>&2 echo "Configuring password."
sed -i 's|#password:|'password:\ \"$PASSWORD\"'|g' /etc/filebeat/filebeat.yml
fi
chmod go-w /etc/filebeat/filebeat.yml || true
chown root: /etc/filebeat/filebeat.yml || true