Add authd.pass file configuration on Wazuh agent container deployment

This commit is contained in:
Victor Carlos Erenu
2026-07-03 22:14:56 +07:00
parent b2a559d081
commit 1f2b777866
5 changed files with 13 additions and 6 deletions
+1 -2
View File
@@ -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 '/<authorization_pass_path>/d' /var/ossec/etc/ossec.conf
dnf clean all
# Download tini static binary (no external library dependencies)
RUN curl --fail --silent -L \
@@ -62,6 +62,15 @@ set_manager_conn() {
sed -i "s#<address>CHANGE_MANAGER_IP</address>#<address>$WAZUH_MANAGER_SERVER</address>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
sed -i "s#<manager_address>CHANGE_ENROLL_IP</manager_address>#<manager_address>$WAZUH_REGISTRATION_SERVER</manager_address>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
sed -i "s#<agent_name>CHANGE_AGENT_NAME</agent_name>#<agent_name>$WAZUH_AGENT_NAME</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
}
##############################################################################
@@ -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
################################################################################
+1 -2
View File
@@ -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
+1
View File
@@ -5,3 +5,4 @@ services:
restart: always
environment:
- WAZUH_MANAGER_SERVER=<WAZUH_MANAGER_IP>
- WAZUH_REGISTRATION_PASSWORD=<authd.pass-PASSWORD>