Ir al contenido

Wazuh Agent Deployment and Log Capture via Syslog

Monitoring strategies by LAN/DMZ/OT network segments, pfSense perimeter firewall rules, and agent installation and registration on Ubuntu Linux.

0views

Once the central Wazuh cluster has been successfully deployed and secured using cryptographic hashes on the internal network (172.16.50.10), the Blue Team analyst's mission is to deploy sensors on all critical infrastructure servers and coordinate the receipt of alerts from the perimeter firewalls.


To ensure 100% security visibility across the entire segmented corporate network, a custom event collection map is designed for each server:

Destination Node / ServerNetwork Segment (VLAN)Connection MethodBlue Team Analytical Mission
servidor-web-demoDMZ (172.16.20.x)Wazuh Agent (Linux)Monitoring of HTTP requests, detection of SQL injections (SQLi), XSS attacks, and SSH intrusions.
servidor-db-demoLAN (172.16.50.x)Wazuh Agent (Linux)Database integrity auditing, unauthorized access, and local privilege escalation attempts.
servidor-hmi-industrialOT Network (172.16.80.x)Wazuh Agent (Linux)Monitoring of the MQTT port and immediate alert upon any change or manipulation of sensor firmware.
firewall-perimetralGatewayNative Syslog (UDP 514)Inspection of denied connections, perimeter port scans, and VPN tunnel traces.

Before initializing agents on the different machines, it is mandatory to enable the necessary inbound traffic rules in your corporate firewall (pfSense / OPNsense) to allow smooth connection of the sensors to the Wazuh Manager (172.16.50.10):

  • TCP Port 1514: Main transmission channel. Logs, metadata, and encrypted alerts are sent through this port.
  • TCP Port 1515: Auto-registration channel (Authd). Used only when registering a new agent to transmit the symmetric key.
  • UDP Port 514: Network Syslog collection port (exclusive for network log receivers).

Complete the following steps on each of your Ubuntu servers (servidor-web-demo, servidor-db-demo, and servidor-hmi-industrial):

Step A: Official Package Download and Installation

Sección titulada «Paso A: Descarga e Instalación del Paquete Oficial»

Connect to the target server via secure SSH channel and download the official Wazuh Debian installer in its certified version. Pass the Manager IP as an environment variable during installation to initialize the association:

Ventana de terminal
# 1. Descargar el agente en su versión correspondiente
wget https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.9.0-1_amd64.deb
# 2. Instalar el paquete inyectando la IP ficticia de nuestro Manager
sudo WAZUH_MANAGER="172.16.50.10" WAZUH_AGENT_GROUP="default" dpkg -i ./wazuh-agent_4.9.0-1_amd64.deb

Reload Systemd service managers, initialize the agent, and configure it to start automatically with every reboot of the physical server:

Ventana de terminal
sudo systemctl daemon-reload
sudo systemctl enable wazuh-agent
sudo systemctl start wazuh-agent

To validate that the agent has correctly linked and encrypted with the Manager, audit its service logs:

Ventana de terminal
sudo tail -n 15 /var/ossec/logs/ossec.log

If the connection is successful, the trace will unequivocally show the messages: Valid key created and Connected to server 172.16.50.10.


Since dedicated firewalls do not allow the installation of local agent packages, we will channel their monitoring by redirecting their log traffic remotely:

  1. Access the pfSense firewall web administration console.
  2. Navigate through the top menu: Status ➔ System Logs.
  3. Select the Settings tab.
  4. Locate the Remote Logging Options section.
  5. Enable the checkbox: Enable Remote Logging.
  6. Complete network parameters:
    • Remote log servers: 172.16.50.10:514 (dummy Manager IP and UDP Syslog listening port).
    • Remote Syslog Contents: Select “Everything” or specifically define “Firewall events”.
  7. Click Save.

5. Next Milestone: File Integrity Monitoring (FIM)

Sección titulada «5. Próximo Hito: File Integrity Monitoring (FIM)»

Once the agents are consolidated in the main Wazuh Dashboard, the Blue Team's next objective to harden the defense will consist of deploying and configuring the File Integrity Monitor (FIM).

This will allow for auditing suspicious changes at the live binary level. It will be configured by editing the /var/ossec/etc/ossec.conf file within the monitored agent during the next protection phase.