Ir al contenido

Wazuh Troubleshooting and Monitoring

Resolving configuration errors in Docker Compose, insecure password 5007 exceptions, inode corruption, and Blue Team audit commands.

0views

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.


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.manager manager 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.
  • 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:
    1. Generate bcrypt hashes in isolation within the container.
    2. Physically modify the original file directly from the host.
    3. 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 -v instruction 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.dashboard web 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.yml file if it is not located during its first initialization. If the administrator manually edits the file at the same time, two header keys hosts: 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.

Recommended commands to verify SIEM health and performance during intrusion simulations or daily administration tasks:

Ventana de terminal
# Comprobar estado de encendido de todos los servicios
sudo docker compose ps
# Monitorizar el consumo de recursos de CPU y RAM de cada contenedor
sudo docker stats

Verify that the distributed database has no indexing problems or fallen shards (must return the "status" : "green" key):

Ventana de terminal
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):

Ventana de terminal
sudo docker compose exec wazuh.manager /var/ossec/bin/wazuh-control status

D. 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:

Ventana de terminal
# Monitorizar trazas de conexión del Portal Web
sudo docker compose logs -f wazuh.dashboard
# Monitorizar trazas de enlace y alertas del Indexer con el Manager
sudo docker compose logs -f wazuh.manager
# Inspeccionar logs internos de alertas caídas o bloqueos de agentes
sudo 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