From 1f2b777866ad6cd9e3bf9264079a704cbe3fefc0 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Fri, 3 Jul 2026 22:14:56 +0700 Subject: [PATCH 1/3] Add authd.pass file configuration on Wazuh agent container deployment --- build-docker-images/wazuh-agent/Dockerfile | 3 +-- .../wazuh-agent/config/etc/cont-init.d/0-wazuh-init | 9 +++++++++ build-docker-images/wazuh-dashboard/Dockerfile | 3 +-- build-docker-images/wazuh-indexer/Dockerfile | 3 +-- wazuh-agent/docker-compose.yml | 1 + 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build-docker-images/wazuh-agent/Dockerfile b/build-docker-images/wazuh-agent/Dockerfile index 7cb8ea35..da45f1ce 100644 --- a/build-docker-images/wazuh-agent/Dockerfile +++ b/build-docker-images/wazuh-agent/Dockerfile @@ -36,8 +36,7 @@ RUN dnf install procps shadow-utils -y && \ curl -o /wazuh-agent.rpm "${agent_url}" && \ dnf install /wazuh-agent.rpm -y && \ rm -rf /wazuh-agent.rpm && \ - dnf clean all && \ - sed -i '//d' /var/ossec/etc/ossec.conf + dnf clean all # Download tini static binary (no external library dependencies) RUN curl --fail --silent -L \ diff --git a/build-docker-images/wazuh-agent/config/etc/cont-init.d/0-wazuh-init b/build-docker-images/wazuh-agent/config/etc/cont-init.d/0-wazuh-init index c7802236..f9efca25 100644 --- a/build-docker-images/wazuh-agent/config/etc/cont-init.d/0-wazuh-init +++ b/build-docker-images/wazuh-agent/config/etc/cont-init.d/0-wazuh-init @@ -62,6 +62,15 @@ set_manager_conn() { sed -i "s#
CHANGE_MANAGER_IP
#
$WAZUH_MANAGER_SERVER
#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf sed -i "s#CHANGE_ENROLL_IP#$WAZUH_REGISTRATION_SERVER#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf sed -i "s#CHANGE_AGENT_NAME#$WAZUH_AGENT_NAME#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf + if [ -n "$WAZUH_REGISTRATION_PASSWORD" ]; then + set +x + cat << EOF > /var/ossec/etc/authd.pass +$WAZUH_REGISTRATION_PASSWORD +EOF + set -x + else + echo "WAZUH_REGISTRATION_PASSWORD is not set; the authd.pass configuration is omitted." + fi } ############################################################################## diff --git a/build-docker-images/wazuh-dashboard/Dockerfile b/build-docker-images/wazuh-dashboard/Dockerfile index 40c287ef..6a004691 100644 --- a/build-docker-images/wazuh-dashboard/Dockerfile +++ b/build-docker-images/wazuh-dashboard/Dockerfile @@ -46,8 +46,7 @@ RUN setcap 'cap_net_bind_service=-ep' /usr/share/wazuh-dashboard/node/bin/node ################################################################################ # Build stage 1 (the current Wazuh dashboard image): -# -# Copy wazuh-dashboard from stage 0 +# Copy wazuh-dashboard from builder # Add entrypoint # Add wazuh_dashboard_config ################################################################################ diff --git a/build-docker-images/wazuh-indexer/Dockerfile b/build-docker-images/wazuh-indexer/Dockerfile index 80c528e3..3d2c4758 100644 --- a/build-docker-images/wazuh-indexer/Dockerfile +++ b/build-docker-images/wazuh-indexer/Dockerfile @@ -41,8 +41,7 @@ RUN yum install curl-minimal shadow-utils findutils hostname -y && \ ################################################################################ # Build stage 1 (the actual Wazuh indexer image): -# -# Copy wazuh-indexer from stage 0 +# Copy wazuh-indexer from builder # Add entrypoint ################################################################################ FROM amazonlinux:2023 diff --git a/wazuh-agent/docker-compose.yml b/wazuh-agent/docker-compose.yml index 842677e1..303f1ca3 100644 --- a/wazuh-agent/docker-compose.yml +++ b/wazuh-agent/docker-compose.yml @@ -5,3 +5,4 @@ services: restart: always environment: - WAZUH_MANAGER_SERVER= + - WAZUH_REGISTRATION_PASSWORD= From ffd39b0191bc172b8fc68398213fd1459bd7f02e Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Fri, 3 Jul 2026 22:24:59 +0700 Subject: [PATCH 2/3] Add Wazuh agent authd.pass configuration in repository documentation --- docs/ref/getting-started/deployment/wazuh-agent.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/ref/getting-started/deployment/wazuh-agent.md b/docs/ref/getting-started/deployment/wazuh-agent.md index 718718a3..fbf6da72 100644 --- a/docs/ref/getting-started/deployment/wazuh-agent.md +++ b/docs/ref/getting-started/deployment/wazuh-agent.md @@ -19,9 +19,11 @@ Follow these steps to deploy the Wazuh agent using Docker. # ... environment: - WAZUH_MANAGER_SERVER= + - WAZUH_REGISTRATION_PASSWORD= # ... ``` - **Note:** Replace `` with the actual IP address or hostname of your Wazuh manager. + **Note:** Replaces `` with the actual IP address or hostname of your Wazuh manager. + **Note:** Replaces `` with the password configured in the `/var/wazuh-manager/etc/authd.pass` file of the Wazuh manager server where you will connect. 3. Start the environment using `docker compose`: From e153333402e93cef3343dfc462ed06d7c589fd3c Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Fri, 3 Jul 2026 22:43:24 +0700 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42c8b24f..ebdebb62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ### Added +- Set authd password in agents installation. ([#2524](https://github.com/wazuh/wazuh-docker/issues/2524)) - Added bump-issue-link support for Revert Stage Bump. ([#2505](https://github.com/wazuh/wazuh-docker/pull/2505)) - Add integration test module docs ([#2491](https://github.com/wazuh/wazuh-docker/pull/2491)) - Implement the wazuh-docker integration testing module ([#2188](https://github.com/wazuh/wazuh-docker/issues/2188))