Deploying Wazuh for Security Monitoring in My Infrastructure
Introduction
As part of my ongoing effort to enhance network visibility, endpoint security, and threat detection in my home and work lab environments, I decided to implement Wazuh, an open-source security monitoring and SIEM platform. Wazuh provides host-based intrusion detection, log analysis, vulnerability detection, and compliance monitoring. Its integration into my infrastructure allows me to centralize security events from multiple devices, including servers, virtual machines, and network equipment.
Infrastructure Overview
My infrastructure consists of two main sites:
- Site A (Home Lab):
- 6U wall-mounted rack with servers
- MikroTik RB4011 router
- Proxmox virtualization host with multiple VMs and LXC containers
- Services include Docker containers, NAS (OpenMediaVault), and Linux VMs (Debian/Ubuntu)
- Subnets for Guest, Smart Devices, and Admin networks
- Site B (Work Lab):
- MikroTik hAP ax² router
- LAN segmented into subnets for Guest, Devices, and Admin
- Additional Debian server for testing services
- Connectivity:
- Site-to-site VPN using ZeroTier
- Remote access via VPN (WireGuard)
- All endpoints run Linux for easier integration with monitoring tools
This diverse environment requires a scalable monitoring solution that can collect logs from multiple sources, analyze them, and provide actionable alerts.
Why Wazuh?
Wazuh was chosen for the following reasons:
- Host-Based Intrusion Detection (HIDS):
Wazuh can monitor my Linux VMs and containers for file integrity, rootkits, and suspicious activity. - Centralized Log Management:
Aggregates logs from all servers and services, including Docker containers, Proxmox logs, and network devices. - Vulnerability Detection:
Automatically scans for vulnerabilities and missing patches on my servers. - Compliance Reporting:
Generates reports to help enforce security standards like CIS Benchmarks, GDPR, or ISO 27001.
Deployment Overview
I deployed Wazuh in a hybrid architecture on my Proxmox lab:
- Wazuh Manager: Installed on a dedicated Debian VM (2 vCPU, 4GB RAM)
- Wazuh Agents: Installed on all Debian/Ubuntu VMs, containers, and potentially Linux and Windows devices in both Site A and Site B
This architecture ensures minimal resource impact on production services and provides scalability for future expansion.
Installation Details
1. Install Wazuh Manager on Debian VM:
curl -s https://packages.wazuh.com/install.sh | bash
- Configure the manager with default ports:
- TCP/1514 for agent communication
- TCP/55000 for agent registration
- Enable systemd service to auto-start:
systemctl enable wazuh-manager systemctl start wazuh-manager
2. Install Wazuh Agents:
curl -s https://packages.wazuh.com/4.x/install.sh | bash systemctl enable wazuh-agent systemctl start wazuh-agent
- Connect each agent to the manager using registration key:
/var/ossec/bin/manage_agents
Use Cases in My Infrastructure
- Proxmox VM Monitoring:
- Monitor Proxmox host logs and VM activity for anomalies.
- Detect unauthorized changes in VM configurations.
- Docker Container Security:
- Track logs from WordPress, Nextcloud, and other containers.
- Identify brute-force attacks, failed login attempts, and configuration changes.
- Network Devices and MikroTik Logs:
- Forward firewall and router logs to Wazuh Manager.
- Detect suspicious network traffic patterns, e.g., unusual VPN connections.
- File Integrity Monitoring:
- Track critical configuration files on Debian servers and containers.
- Receive alerts if files are altered unexpectedly.
- Vulnerability Scanning:
- Daily scans for missing patches and software vulnerabilities.
- Receive alerts via email or Kibana dashboards.
- Compliance and Auditing:
- Generate automated reports for auditing purposes.
- Ensure network devices and servers follow security best practices.
Security and Alerts
- Alerts are classified by severity (low, medium, high, critical).
- I configured email alerts for high and critical threats.
- Wazuh dashboards in Kibana provide:
- Real-time alert tracking
- File integrity change history
- Agent health overview
- Alerts allow proactive incident response before issues escalate.
Benefits Realized
- Centralized Security Monitoring: One dashboard for all servers and devices.
- Improved Threat Visibility: Early detection of brute-force attacks, malware, and misconfigurations.
- Automated Reporting: Saves time on audits and compliance verification.
- Scalable and Extensible: Can add new VMs, containers, or network devices easily.
- Integration with Existing Tools: Works with Elastic Stack, Docker, and Proxmox logs.
Future Enhancements
- Implement automated remediation using Wazuh rules (e.g., blocking IPs on repeated SSH attacks).
- Expand monitoring to IoT devices in Site A.
- Set up alert forwarding to a mobile application for immediate notifications.
- Integrate threat intelligence feeds for enhanced detection capabilities.
Conclusion
Deploying Wazuh in my infrastructure provides a powerful, centralized platform for security monitoring, log analysis, and compliance management. With agents installed on all critical systems and Elasticsearch/Kibana dashboards, I have complete visibility into my home lab and work lab environments. The solution scales as my lab grows, supports automated alerting, and improves overall security posture.