Wazuh Troubleshooting and Monitoring
Resolving configuration errors in Docker Compose, insecure password 5007 exceptions, inode corruption, and Blue Team audit commands.
This technical guide compiles the critical incidents detected during the architecture, deployment, and integration phases of the Wazuh 4.9 security platform under Docker, along with their respective diagnostic workflows and operational audit instructions for Blue Team analysts.
1. Critical Error Log and Architecture Resolutions
Sección titulada «1. Bitácora de Errores Críticos y Resoluciones de Arquitectura»Incident 1: Authentication Failure due to Variable Interpolation ($)
Sección titulada «Incidencia 1: Fallo en Autenticación por Interpolación de Variables ($)»- Error Symptom: The containers rejected the initial complex passwords and threw cryptographic exceptions in the initialization logs.
- System Diagnosis: The Docker Compose engine natively interprets the special character
$in YAML configuration files as a call directive or local host system variable interpolation. Since the admin key contained a special character, a truncated password was injected. - Applied Resolution: Comprehensive replacement of the key dictionary with high-entropy alphanumeric complex passwords without escape symbols in conflicts.
Incident 2: Infinite Reboot Loop in Container Manager (Error 5007)
Sección titulada «Incidencia 2: Bucle de Reinicio Infinito en Contenedor Manager (Error 5007)»- Error Symptom: The container query reported the
wazuh.managermanager in a continuous reboot loop. The log audit yielded the following exception:wazuh.core.exception.WazuhError: Error 5007 - Insecure user password provided. - Systems Diagnosis: Wazuh firmware as of version 4.9 imposes a strict password hardening (Password Hardening) policy for the REST API. It strictly requires the combined presence of uppercase, lowercase, digits, and at least one special punctuation symbol.
- Applied Resolution: Modification of the API key (
mP5nT8qB2vK9wR3xY6cS4dB9.) by introducing a dot.at the end to comply with the requirements of the native regular expression validator.
Incident 3: File internal_users.yml Inode Corruption
Sección titulada «Incidencia 3: Corrupción por Inodos del Archivo internal_users.yml»- Error Symptom: The OpenSearch engine rejected synchronization commands, claiming that identities did not exist in the credentials tables. The file appeared completely empty inside the container.
- Systems Diagnosis: File system-level inode collision when attempting to mount and live-modify a host file to a Docker volume. OpenSearch emptied the metadata to rewrite it, losing the physical reference.
- Applied Resolution: Design of a robust asynchronous process:
- Generate bcrypt hashes in isolation within the container.
- Physically modify the original file directly from the host.
- Force reading using the script's SSL signature
securityadmin.sh.
Incident 4: Perpetual Load Hang “Wazuh dashboard server is not ready yet”
Sección titulada «Incidencia 4: Cuelgue de Carga Perpetuo “Wazuh dashboard server is not ready yet”»- Error Symptom: After the system volume purge, the web frontend remained perpetually inaccessible.
- Systems Diagnosis: The
down -vinstruction destroys the local databases mounted on the host. When spinning up the cluster, OpenSearch initializes with its factory default hashes, breaking communication with the Dashboard which uses the complex keys. - Applied Resolution: It is mandatory to completely re-execute Step 1 (Cryptographic Hash Synchronization) of Module 2 after every cluster volume purge.
Incident 5: Dashboard Crash-Loop due to Duplicated Keys (Duplicated Mapping Key)
Sección titulada «Incidencia 5: Crash-Loop del Dashboard por Claves Duplicadas (Duplicated Mapping Key)»- Error Symptom: The
wazuh.dashboardweb container stopped, throwing the following in its error trace:FATAL Error: Error getting configuration: duplicated mapping key at line 8 [...] hosts:. - System Diagnosis: The web interface attempts to auto-inject the Manager structure into the
wazuh.ymlfile if it is not located during its first initialization. If the administrator manually edits the file at the same time, two header keyshosts:are injected, invalidating the YAML description language syntax. - Applied Resolution: Manual intervention: Stop the container, rebuild the configuration file with a single clean
hosts:key, and restart the service.
2. Monitoring Operating Manual (Analyst Commands)
Sección titulada «2. Manual Operativo de Monitorización (Comandos de Analista)»Recommended commands to verify SIEM health and performance during intrusion simulations or daily administration tasks:
A. Container Infrastructure Status
Sección titulada «A. Estado de la Infraestructura de Contenedores»# Comprobar estado de encendido de todos los serviciossudo docker compose ps
# Monitorizar el consumo de recursos de CPU y RAM de cada contenedorsudo docker statsB. Database Health Diagnosis (Indexer)
Sección titulada «B. Diagnóstico de Salud de la Base de Datos (Indexer)»Verify that the distributed database has no indexing problems or fallen shards (must return the "status" : "green" key):
sudo docker compose exec wazuh.indexer curl -X GET -k -u admin:zR9mK2vX5pW8qN3tY6cR4vB1 "https://localhost:9200/_cluster/health?pretty"C. Operational Status of Analysis Subprocesses (Manager)
Sección titulada «C. Estado Operativo de los Subprocesos de Análisis (Manager)»Check the internal status of the Wazuh brain and verify that all analysis queues and log engines report an active status (running):
sudo docker compose exec wazuh.manager /var/ossec/bin/wazuh-control statusD. Forensic Traces and Incident Response (Real-Time Logs)
Sección titulada «D. Trazas Forenses e Incident Response (Logs en Tiempo Real)»Key commands to audit communication errors or perform real-time tracking of network security incidents:
# Monitorizar trazas de conexión del Portal Websudo docker compose logs -f wazuh.dashboard
# Monitorizar trazas de enlace y alertas del Indexer con el Managersudo docker compose logs -f wazuh.manager
# Inspeccionar logs internos de alertas caídas o bloqueos de agentessudo docker compose exec wazuh.manager tail -f /var/ossec/logs/ossec.log
# Visualización analítica de Alertas en Caliente (Ideal para Incident Response)sudo docker compose exec wazuh.manager tail -f /var/ossec/logs/alerts/alerts.json
