Add wazuh image using filebeat-oss

This commit is contained in:
Manuel Gutierrez
2020-08-18 16:29:55 +02:00
parent 67e259a681
commit d8b186aa52
12 changed files with 485 additions and 0 deletions
@@ -0,0 +1,29 @@
#!/usr/bin/with-contenv bash
# Wazuh App Copyright (C) 2020 Wazuh Inc. (License GPLv2)
set -e
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