Hi Alfonso,
Again thank you for your answer and the time you investigated.
I tried again this morning and it works. I am unable to say what happened, since the configuration file is the same as last Friday.
But for all users which might have the same problem I post here my production-cluster.yml which works actually.
Just two other questions BTW:
1) The very last section "volumes" (below the nginx section) - is this meant to add the config on the local host? - in example
volumes:
(...)
ossec-etc:/volume/config/ossec/etc ?
(...)
worker-ossec-etc:
(...)
--> I would like now continue to have all the important configuration files on my local host. Or must I just use this file:
- ./production_cluster/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf
?
2) Is it possible to run the containers which run as root by default as non-root user? If so, how must I configure this? And if this is not possilbe, what is best practice to keep a hacker out of my host in case one of the wazuh containers would be hacked? (In example destroy-recreate the wazuh-containers regularly to have security updates?)
production-cluster.yml
==================
# Wazuh App Copyright (C) 2021 Wazuh Inc. (License GPLv2)
version: '3.7'
services:
wazuh-master:
image: wazuh/wazuh-odfe:4.1.2
hostname: wazuh-master
restart: always
ports:
- "1515:1515"
- "514:514/udp"
- "55000:55000"
environment:
- ELASTICSEARCH_URL=
https://myhost.ch:9200 - ELASTIC_USERNAME=admin
- ELASTIC_PASSWORD=hooray-it-works
- FILEBEAT_SSL_VERIFICATION_MODE=full
- SSL_CERTIFICATE_AUTHORITIES=/etc/ssl/myhost.ch.crt
- SSL_CERTIFICATE=/etc/ssl/myhost.ch.crt
- SSL_KEY=/etc/ssl/myhost.ch.key
- API_USERNAME=acme-user
- API_PASSWORD=MyS3cr37P450r.*-
volumes:
- ossec-api-configuration:/var/ossec/api/configuration
- ossec-etc:/var/ossec/etc
- ossec-logs:/var/ossec/logs
- ossec-queue:/var/ossec/queue
- ossec-var-multigroups:/var/ossec/var/multigroups
- ossec-integrations:/var/ossec/integrations
- ossec-active-response:/var/ossec/active-response/bin
- ossec-agentless:/var/ossec/agentless
- ossec-wodles:/var/ossec/wodles
- filebeat-etc:/etc/filebeat
- filebeat-var:/var/lib/filebeat
- /volume/config/certs/OU/myhost.ch.crt:/etc/ssl/myhost.ch.crt
- /volume/config/certs/OU/myhost.ch.key:/etc/ssl/myhost.ch.key
- ./production_cluster/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf
wazuh-worker:
image: wazuh/wazuh-odfe:4.1.2
hostname: wazuh-worker
restart: always
environment:
- ELASTICSEARCH_URL=
https://myhost.ch:9200 - ELASTIC_USERNAME=admin
- ELASTIC_PASSWORD=hooray-it-works
- FILEBEAT_SSL_VERIFICATION_MODE=full
- SSL_CERTIFICATE_AUTHORITIES=/etc/ssl/myhost.ch.crt
- SSL_CERTIFICATE=/etc/ssl/myhost.ch.crt
- SSL_KEY=/etc/ssl/myhost.ch.key
volumes:
- worker-ossec-api-configuration:/var/ossec/api/configuration
- worker-ossec-etc:/var/ossec/etc
- worker-ossec-logs:/var/ossec/logs
- worker-ossec-queue:/var/ossec/queue
- worker-ossec-var-multigroups:/var/ossec/var/multigroups
- worker-ossec-integrations:/var/ossec/integrations
- worker-ossec-active-response:/var/ossec/active-response/bin
- worker-ossec-agentless:/var/ossec/agentless
- worker-ossec-wodles:/var/ossec/wodles
- worker-filebeat-etc:/etc/filebeat
- worker-filebeat-var:/var/lib/filebeat
- /volume/config/certs/OU/myhost.ch.crt:/etc/ssl/myhost.ch.crt
- /volume/config/certs/OU/myhost.ch.key:/etc/ssl/myhost.ch.key
- ./production_cluster/wazuh_cluster/wazuh_worker.conf:/wazuh-config-mount/etc/ossec.conf
elasticsearch:
image: amazon/opendistro-for-elasticsearch:1.12.0
hostname: elasticsearch
restart: always
ports:
- "9200:9200"
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- elastic-data-1:/usr/share/elasticsearch/data
- /volume/config/certs/OU/myhost.ch.crt:/usr/share/elasticsearch/config/myhost.ch.crt
- /volume/config/certs/OU/myhost.ch.key:/usr/share/elasticsearch/config/myhost.ch.key
- ./production_cluster/elastic_opendistro/elasticsearch-node1.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- /volume/config/wazuh/internal_users.yml:/usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml
kibana:
image: wazuh/wazuh-kibana-odfe:4.1.2
hostname: kibana
restart: always
ports:
- 5601:5601
environment:
- ELASTICSEARCH_USERNAME=admin
- ELASTICSEARCH_PASSWORD=hooray-it-works
- SERVER_SSL_ENABLED=true
- SERVER_SSL_CERTIFICATE=/usr/share/kibana/config/myhost.ch.crt
- SERVER_SSL_KEY=/usr/share/kibana/config/myhost.ch.key
- WAZUH_API_URL="
https://wazuh-master"
- API_USERNAME=acme-user
- API_PASSWORD=MyS3cr37P450r.*-
volumes:
- /volume/config/certs/OU/kibana/myhost.ch.crt:/usr/share/kibana/config/myhost.ch.crt
- /volume/config/certs/OU/kibana/myhost.ch.key:/usr/share/kibana/config/myhost.ch.key
depends_on:
- elasticsearch
links:
- elasticsearch:elasticsearch
- wazuh-master:wazuh-master
nginx:
image: nginx:stable
hostname: nginx
restart: always
ports:
- "80:80"
- "443:443"
- "1514:1514"
depends_on:
- wazuh-master
- wazuh-worker
- kibana
links:
- wazuh-master:wazuh-master
- wazuh-worker:wazuh-worker
- kibana:kibana
volumes:
- ./production_cluster/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- /volume/config/certs/OU:/etc/nginx/ssl:ro
volumes:
ossec-api-configuration:
ossec-etc:
ossec-logs:
ossec-queue:
ossec-var-multigroups:
ossec-integrations:
ossec-active-response:
ossec-agentless:
ossec-wodles:
filebeat-etc:
filebeat-var:
worker-ossec-api-configuration:
worker-ossec-etc:
worker-ossec-logs:
worker-ossec-queue:
worker-ossec-var-multigroups:
worker-ossec-integrations:
worker-ossec-active-response:
worker-ossec-agentless:
worker-ossec-wodles:
worker-filebeat-etc:
worker-filebeat-var:
elastic-data-1:
Kind regads,
Birgit