From 6095a29a6ffdcd6c2e86803be84b7ecabc4a456b Mon Sep 17 00:00:00 2001 From: Gabriele Rizzo Date: Fri, 27 Nov 2026 07:03:29 +0100 Subject: [PATCH] Add Wazuh (#5715) Co-authored-by: nmfretz --- wazuh/certs.yml.template | 16 + wazuh/data/certs/.gitkeep | 0 wazuh/data/dashboard/config/.gitkeep | 0 wazuh/data/dashboard/custom/.gitkeep | 0 wazuh/data/filebeat/etc/.gitkeep | 0 wazuh/data/filebeat/var/.gitkeep | 0 wazuh/data/indexer/.gitkeep | 0 wazuh/data/manager/active-response/.gitkeep | 0 wazuh/data/manager/agentless/.gitkeep | 0 wazuh/data/manager/api-configuration/.gitkeep | 0 wazuh/data/manager/etc/.gitkeep | 0 wazuh/data/manager/integrations/.gitkeep | 0 wazuh/data/manager/logs/.gitkeep | 0 wazuh/data/manager/multigroups/.gitkeep | 0 wazuh/data/manager/queue/.gitkeep | 0 wazuh/data/manager/wodles/.gitkeep | 0 wazuh/docker-compose.yml | 145 ++++++++ wazuh/exports.sh | 5 + wazuh/internal_users.yml.template | 3 + wazuh/opensearch.yml.template | 37 +++ wazuh/opensearch_dashboards.yml.template | 14 + wazuh/ossec.conf.template | 311 ++++++++++++++++++ wazuh/umbrel-app.yml | 54 +++ 23 files changed, 585 insertions(+) create mode 100644 wazuh/certs.yml.template create mode 100644 wazuh/data/certs/.gitkeep create mode 100644 wazuh/data/dashboard/config/.gitkeep create mode 100644 wazuh/data/dashboard/custom/.gitkeep create mode 100644 wazuh/data/filebeat/etc/.gitkeep create mode 100644 wazuh/data/filebeat/var/.gitkeep create mode 100644 wazuh/data/indexer/.gitkeep create mode 100644 wazuh/data/manager/active-response/.gitkeep create mode 100644 wazuh/data/manager/agentless/.gitkeep create mode 100644 wazuh/data/manager/api-configuration/.gitkeep create mode 100644 wazuh/data/manager/etc/.gitkeep create mode 100644 wazuh/data/manager/integrations/.gitkeep create mode 100644 wazuh/data/manager/logs/.gitkeep create mode 100644 wazuh/data/manager/multigroups/.gitkeep create mode 100644 wazuh/data/manager/queue/.gitkeep create mode 100644 wazuh/data/manager/wodles/.gitkeep create mode 100644 wazuh/docker-compose.yml create mode 100644 wazuh/exports.sh create mode 100644 wazuh/internal_users.yml.template create mode 100644 wazuh/opensearch.yml.template create mode 100644 wazuh/opensearch_dashboards.yml.template create mode 100644 wazuh/ossec.conf.template create mode 100644 wazuh/umbrel-app.yml diff --git a/wazuh/certs.yml.template b/wazuh/certs.yml.template new file mode 100644 index 000000000..c3e017be1 --- /dev/null +++ b/wazuh/certs.yml.template @@ -0,0 +1,16 @@ +nodes: + # Wazuh indexer server nodes + indexer: + - name: wazuh.indexer + ip: wazuh.indexer + + # Wazuh server nodes + # Use node_type only with more than one Wazuh manager + server: + - name: wazuh.manager + ip: wazuh.manager + + # Wazuh dashboard node + dashboard: + - name: wazuh.dashboard + ip: wazuh.dashboard diff --git a/wazuh/data/certs/.gitkeep b/wazuh/data/certs/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/dashboard/config/.gitkeep b/wazuh/data/dashboard/config/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/dashboard/custom/.gitkeep b/wazuh/data/dashboard/custom/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/filebeat/etc/.gitkeep b/wazuh/data/filebeat/etc/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/filebeat/var/.gitkeep b/wazuh/data/filebeat/var/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/indexer/.gitkeep b/wazuh/data/indexer/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/active-response/.gitkeep b/wazuh/data/manager/active-response/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/agentless/.gitkeep b/wazuh/data/manager/agentless/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/api-configuration/.gitkeep b/wazuh/data/manager/api-configuration/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/etc/.gitkeep b/wazuh/data/manager/etc/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/integrations/.gitkeep b/wazuh/data/manager/integrations/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/logs/.gitkeep b/wazuh/data/manager/logs/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/multigroups/.gitkeep b/wazuh/data/manager/multigroups/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/queue/.gitkeep b/wazuh/data/manager/queue/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/data/manager/wodles/.gitkeep b/wazuh/data/manager/wodles/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/wazuh/docker-compose.yml b/wazuh/docker-compose.yml new file mode 100644 index 000000000..761a1da51 --- /dev/null +++ b/wazuh/docker-compose.yml @@ -0,0 +1,145 @@ +services: + app_proxy: + environment: + APP_HOST: wazuh_wazuh.dashboard_1 + APP_PORT: 5601 + + wazuh.certs-generator: + image: wazuh/wazuh-certs-generator:0.0.5@sha256:1be9f9abfb6a37ac7bd3d6d707e1b43589c2b81b23c01a46992e93832795abf9 + # Generate the certificates on first start only, so the stack keeps its identity. + entrypoint: sh -c "[ -f /certificates/root-ca.pem ] || /entrypoint.sh" + restart: on-failure + environment: + CERT_TOOL_VERSION: "4.14" + volumes: + - ${APP_DATA_DIR}/data/certs:/certificates + - ${APP_DATA_DIR}/certs.yml:/config/certs.yml:ro + + wazuh.indexer: + image: wazuh/wazuh-indexer:4.14.11@sha256:6855bea0a883fda201cba1b9969a744d01559bb4ee05aa4703b937edee0c11e5 + hostname: wazuh.indexer + restart: on-failure + depends_on: + wazuh.certs-generator: + condition: service_completed_successfully + environment: + OPENSEARCH_JAVA_OPTS: "-Xms1g -Xmx1g" + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + healthcheck: + test: ["CMD-SHELL", "curl -fks --cert config/certs/admin.pem --key config/certs/admin-key.pem https://localhost:9200/_cluster/health"] + interval: 20s + timeout: 10s + retries: 15 + start_period: 60s + volumes: + - ${APP_DATA_DIR}/data/indexer:/var/lib/wazuh-indexer + - ${APP_DATA_DIR}/data/certs:/usr/share/wazuh-indexer/config/certs:ro + - ${APP_DATA_DIR}/opensearch.yml:/usr/share/wazuh-indexer/config/opensearch.yml:ro + - ${APP_DATA_DIR}/internal_users.yml:/usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml:ro + + # Sets the indexer passwords from the Umbrel-derived secrets on every start. + wazuh.indexer-users: + image: wazuh/wazuh-indexer:4.14.11@sha256:6855bea0a883fda201cba1b9969a744d01559bb4ee05aa4703b937edee0c11e5 + restart: on-failure + depends_on: + wazuh.indexer: + condition: service_healthy + environment: + ADMIN_PASSWORD: ${APP_PASSWORD} + DASHBOARD_PASSWORD: ${APP_WAZUH_DASHBOARD_PASSWORD} + entrypoint: + - /bin/bash + - -c + - | + set -e + put_user() { + curl -fsS --cacert /certs/root-ca.pem --cert /certs/admin.pem --key /certs/admin-key.pem \ + -X PUT -H "Content-Type: application/json" -d "$$2" \ + "https://wazuh.indexer:9200/_plugins/_security/api/internalusers/$$1" + echo + } + put_user admin "{\"password\": \"$$ADMIN_PASSWORD\", \"backend_roles\": [\"admin\"]}" + put_user kibanaserver "{\"password\": \"$$DASHBOARD_PASSWORD\"}" + volumes: + - ${APP_DATA_DIR}/data/certs:/certs:ro + + wazuh.manager: + image: wazuh/wazuh-manager:4.14.11@sha256:3d0e5752ea98cb3b036530074cd9851dce6ab1fa01122e0d939226b766389a6d + hostname: wazuh.manager + restart: on-failure + depends_on: + wazuh.indexer-users: + condition: service_completed_successfully + # Copy the packaged ossec.conf in on first start only, so changes made in the dashboard survive restarts. + entrypoint: + - /bin/bash + - -c + - | + if [ -e /var/ossec/etc/ossec.conf ]; then + rm -rf /wazuh-config-mount + else + mkdir -p /wazuh-config-mount/etc && cp /wazuh-default/ossec.conf /wazuh-config-mount/etc/ossec.conf + fi + exec /init + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 655360 + hard: 655360 + ports: + # Agent connection and enrollment + - "1514:1514" + - "1515:1515" + environment: + INDEXER_URL: https://wazuh.indexer:9200 + INDEXER_USERNAME: admin + INDEXER_PASSWORD: ${APP_PASSWORD} + FILEBEAT_SSL_VERIFICATION_MODE: full + SSL_CERTIFICATE_AUTHORITIES: /etc/wazuh-certs/root-ca-manager.pem + SSL_CERTIFICATE: /etc/wazuh-certs/wazuh.manager.pem + SSL_KEY: /etc/wazuh-certs/wazuh.manager-key.pem + API_USERNAME: wazuh-wui + API_PASSWORD: ${APP_WAZUH_API_PASSWORD} + volumes: + - ${APP_DATA_DIR}/data/manager/api-configuration:/var/ossec/api/configuration + - ${APP_DATA_DIR}/data/manager/etc:/var/ossec/etc + - ${APP_DATA_DIR}/data/manager/logs:/var/ossec/logs + - ${APP_DATA_DIR}/data/manager/queue:/var/ossec/queue + - ${APP_DATA_DIR}/data/manager/multigroups:/var/ossec/var/multigroups + - ${APP_DATA_DIR}/data/manager/integrations:/var/ossec/integrations + - ${APP_DATA_DIR}/data/manager/active-response:/var/ossec/active-response/bin + - ${APP_DATA_DIR}/data/manager/agentless:/var/ossec/agentless + - ${APP_DATA_DIR}/data/manager/wodles:/var/ossec/wodles + - ${APP_DATA_DIR}/data/filebeat/etc:/etc/filebeat + - ${APP_DATA_DIR}/data/filebeat/var:/var/lib/filebeat + - ${APP_DATA_DIR}/data/certs:/etc/wazuh-certs:ro + - ${APP_DATA_DIR}/ossec.conf:/wazuh-default/ossec.conf:ro + + wazuh.dashboard: + image: wazuh/wazuh-dashboard:4.14.11@sha256:38ad3289540e4c5d42a4e434c82299f092ae8aeb1e10bc28a472fdc268ffb752 + hostname: wazuh.dashboard + restart: on-failure + depends_on: + wazuh.indexer-users: + condition: service_completed_successfully + wazuh.manager: + condition: service_started + environment: + WAZUH_API_URL: https://wazuh.manager + DASHBOARD_USERNAME: kibanaserver + DASHBOARD_PASSWORD: ${APP_WAZUH_DASHBOARD_PASSWORD} + API_USERNAME: wazuh-wui + API_PASSWORD: ${APP_WAZUH_API_PASSWORD} + volumes: + - ${APP_DATA_DIR}/data/dashboard/config:/usr/share/wazuh-dashboard/data/wazuh/config + - ${APP_DATA_DIR}/data/dashboard/custom:/usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom + - ${APP_DATA_DIR}/data/certs:/usr/share/wazuh-dashboard/certs:ro + - ${APP_DATA_DIR}/opensearch_dashboards.yml:/usr/share/wazuh-dashboard/config/opensearch_dashboards.yml:ro diff --git a/wazuh/exports.sh b/wazuh/exports.sh new file mode 100644 index 000000000..6d1fe3e24 --- /dev/null +++ b/wazuh/exports.sh @@ -0,0 +1,5 @@ +export APP_WAZUH_DASHBOARD_PASSWORD="$(derive_entropy "${app_entropy_identifier}-kibanaserver-password")" + +# The Wazuh API only accepts passwords with upper case, lower case, digit and symbol characters. +wazuh_api_secret="$(derive_entropy "${app_entropy_identifier}-api-password")" +export APP_WAZUH_API_PASSWORD="Umbrel.${wazuh_api_secret:0:32}" diff --git a/wazuh/internal_users.yml.template b/wazuh/internal_users.yml.template new file mode 100644 index 000000000..2592d8c71 --- /dev/null +++ b/wazuh/internal_users.yml.template @@ -0,0 +1,3 @@ +_meta: + type: "internalusers" + config_version: 2 diff --git a/wazuh/opensearch.yml.template b/wazuh/opensearch.yml.template new file mode 100644 index 000000000..53cbf5970 --- /dev/null +++ b/wazuh/opensearch.yml.template @@ -0,0 +1,37 @@ +network.host: "0.0.0.0" +node.name: "wazuh.indexer" +cluster.name: "wazuh-cluster" +path.data: /var/lib/wazuh-indexer +path.logs: /var/log/wazuh-indexer +discovery.type: single-node +compatibility.override_main_response_version: true +plugins.security.ssl.http.pemcert_filepath: /usr/share/wazuh-indexer/config/certs/wazuh.indexer.pem +plugins.security.ssl.http.pemkey_filepath: /usr/share/wazuh-indexer/config/certs/wazuh.indexer-key.pem +plugins.security.ssl.http.pemtrustedcas_filepath: /usr/share/wazuh-indexer/config/certs/root-ca.pem +plugins.security.ssl.transport.pemcert_filepath: /usr/share/wazuh-indexer/config/certs/wazuh.indexer.pem +plugins.security.ssl.transport.pemkey_filepath: /usr/share/wazuh-indexer/config/certs/wazuh.indexer-key.pem +plugins.security.ssl.transport.pemtrustedcas_filepath: /usr/share/wazuh-indexer/config/certs/root-ca.pem +plugins.security.ssl.http.enabled: true +plugins.security.ssl.transport.enforce_hostname_verification: false +plugins.security.ssl.transport.resolve_hostname: false +plugins.security.ssl.http.enabled_ciphers: + - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +plugins.security.ssl.http.enabled_protocols: + - "TLSv1.2" +plugins.security.authcz.admin_dn: +- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US" +plugins.security.check_snapshot_restore_write_privileges: true +plugins.security.enable_snapshot_restore_privilege: true +plugins.security.nodes_dn: +- "CN=wazuh.indexer,OU=Wazuh,O=Wazuh,L=California,C=US" +plugins.security.restapi.roles_enabled: +- "all_access" +- "security_rest_api_access" +plugins.security.system_indices.enabled: true +plugins.security.system_indices.indices: [".opendistro-alerting-config", ".opendistro-alerting-alert*", ".opendistro-anomaly-results*", ".opendistro-anomaly-detector*", ".opendistro-anomaly-checkpoints", ".opendistro-anomaly-detection-state", ".opendistro-reports-*", ".opendistro-notifications-*", ".opendistro-notebooks", ".opensearch-observability", ".opendistro-asynchronous-search-response*", ".replication-metadata-store"] +plugins.security.allow_default_init_securityindex: true +cluster.routing.allocation.disk.threshold_enabled: false +node.store.allow_mmap: false diff --git a/wazuh/opensearch_dashboards.yml.template b/wazuh/opensearch_dashboards.yml.template new file mode 100644 index 000000000..dfcc46cfd --- /dev/null +++ b/wazuh/opensearch_dashboards.yml.template @@ -0,0 +1,14 @@ +server.host: 0.0.0.0 +server.port: 5601 +opensearch.hosts: https://wazuh.indexer:9200 +opensearch.ssl.verificationMode: certificate +opensearch.requestHeadersWhitelist: ["securitytenant","Authorization"] +opensearch_security.multitenancy.enabled: false +opensearch_security.readonly_mode.roles: ["kibana_read_only"] +server.ssl.enabled: false +opensearch.ssl.certificateAuthorities: ["/usr/share/wazuh-dashboard/certs/root-ca.pem"] +uiSettings.overrides.defaultRoute: /app/wz-home +# Session expiration settings +opensearch_security.cookie.ttl: 900000 +opensearch_security.session.ttl: 900000 +opensearch_security.session.keepalive: true diff --git a/wazuh/ossec.conf.template b/wazuh/ossec.conf.template new file mode 100644 index 000000000..624bb3ae5 --- /dev/null +++ b/wazuh/ossec.conf.template @@ -0,0 +1,311 @@ + + + yes + yes + no + no + no + smtp.example.wazuh.com + wazuh@example.wazuh.com + recipient@example.wazuh.com + 12 + alerts.log + 10m + 0 + + + + 3 + 12 + + + + + plain + + + + secure + 1514 + tcp + 131072 + + + + + no + yes + yes + yes + yes + yes + yes + yes + + + 43200 + + etc/rootcheck/rootkit_files.txt + etc/rootcheck/rootkit_trojans.txt + + yes + + + + yes + 1800 + 1d + yes + + wodles/java + wodles/ciscat + + + + + yes + yes + /var/log/osquery/osqueryd.results.log + /etc/osquery/osquery.conf + yes + + + + + no + 1h + yes + yes + yes + yes + yes + yes + yes + + + + 10 + + + + + yes + yes + 12h + yes + + + + yes + yes + 60m + + + + yes + + https://wazuh.indexer:9200 + + + + /etc/wazuh-certs/root-ca-manager.pem + + /etc/wazuh-certs/wazuh.manager.pem + /etc/wazuh-certs/wazuh.manager-key.pem + + + + + + no + + + 43200 + + yes + + + yes + + + no + + + /etc,/usr/bin,/usr/sbin + /bin,/sbin,/boot + + + /etc/mtab + /etc/hosts.deny + /etc/mail/statistics + /etc/random-seed + /etc/random.seed + /etc/adjtime + /etc/httpd/logs + /etc/utmpx + /etc/wtmpx + /etc/cups/certs + /etc/dumpdates + /etc/svc/volatile + + + .log$|.swp$ + + + /etc/ssl/private.key + + yes + yes + yes + yes + + + 10 + + + 100 + + + + yes + 5m + 1h + 10 + + + + + + 127.0.0.1 + ^localhost.localdomain$ + + + + disable-account + disable-account + yes + + + + restart-wazuh + restart-wazuh + + + + firewall-drop + firewall-drop + yes + + + + host-deny + host-deny + yes + + + + route-null + route-null + yes + + + + win_route-null + route-null.exe + yes + + + + netsh + netsh.exe + yes + + + + + + + command + df -P + 360 + + + + full_command + netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d + netstat listening ports + 360 + + + + full_command + last -n 20 + 360 + + + + + ruleset/decoders + ruleset/rules + 0215-policy_rules.xml + etc/lists/audit-keys + etc/lists/amazon/aws-eventnames + etc/lists/security-eventchannel + etc/lists/malicious-ioc/malicious-ip + etc/lists/malicious-ioc/malicious-domains + etc/lists/malicious-ioc/malware-hashes + + + etc/decoders + etc/rules + + + + yes + 1 + 64 + 15m + + + + + no + 1515 + no + yes + no + HIGH:!ADH:!EXP:!MD5:!RC4:!3DES:!CAMELLIA:@STRENGTH + + no + etc/sslmanager.cert + etc/sslmanager.key + no + + + + wazuh + node01 + master + aa093264ef885029653eea20dfcf51ae + 1516 + 0.0.0.0 + + wazuh.manager + + no + yes + + + + + + + syslog + /var/ossec/logs/active-responses.log + + + diff --git a/wazuh/umbrel-app.yml b/wazuh/umbrel-app.yml new file mode 100644 index 000000000..58e084fec --- /dev/null +++ b/wazuh/umbrel-app.yml @@ -0,0 +1,54 @@ +manifestVersion: 1 +id: wazuh +storage: + dataRoot: data +environment: + - name: OPENSEARCH_JAVA_OPTS + services: + - wazuh.indexer + default: "-Xms1g -Xmx1g" + note: >- + Memory for the Wazuh indexer. Raise both values together (for example "-Xms2g -Xmx2g") if you monitor many agents and have RAM to spare. +category: networking +name: Wazuh +version: "4.14.11" +tagline: Unified XDR and SIEM protection for endpoints and cloud workloads +description: >- + Wazuh is a free and open source security platform that unifies XDR and SIEM protection for endpoints and cloud workloads. + + + On your Umbrel, Wazuh becomes the security hub for your home or small business. Install the lightweight Wazuh agent on your computers and servers, point it at your Umbrel, and they report back here for monitoring, alerting, and analysis. + + + - Intrusion and threat detection, with a rule set mapped to MITRE ATT&CK + + - Log data analysis and file integrity monitoring + + - Vulnerability detection on monitored endpoints + + - Security configuration assessment against CIS benchmarks + + - Regulatory compliance reports for PCI DSS, GDPR, HIPAA, and NIST 800-53 + + + This app runs the full single-node stack: the Wazuh indexer, server, and dashboard. Agents connect to your Umbrel on ports 1514 and 1515. + + + ⚠️ Wazuh needs at least 4 GB of free RAM. The first start takes a few minutes while the indexer sets itself up. +releaseNotes: "" +developer: Wazuh +website: https://wazuh.com +dependencies: [] +repo: https://github.com/wazuh/wazuh +support: https://wazuh.com/community/ +port: 8402 +gallery: + - 1.webp + - 2.webp + - 3.webp + - 4.webp +path: "" +defaultUsername: "admin" +deterministicPassword: true +submitter: gabrysh +submission: https://github.com/getumbrel/umbrel-apps/pull/5715