My server once got hit by an SSH brute-force attack at 2 AM. Back when I was just starting out, I thought changing the SSH port and enabling UFW was enough. Then one day I opened auth.log and saw over 4,000 failed login attempts in just 10 minutes—all coming from dozens of unknown IPs.
Once you manage three or more servers, SSHing into each machine to grep logs is both slow and an easy way to miss signs of an attack. That incident pushed me to switch to Wazuh SIEM. It is a free, open-source platform that runs lightweight and aggregates logs into a single web interface. You can detect intrusions in real time, monitor file changes, and run security compliance checks (CIS Benchmark, PCI-DSS). If you’re a junior dev looking to set up a proper monitoring stack for Linux, following the steps below will get you up and running right away.
Quick Start: Install Wazuh SIEM in 5 Minutes
For a lab environment or a setup with fewer than 20 servers, the All-in-One deployment is the cleanest option. All you need is a dedicated VPS running Ubuntu 22.04 or 24.04 LTS. The minimum specs are 2 vCPUs, 4GB RAM, and 50GB of storage (8GB RAM is recommended if you want the Dashboard to feel snappier).
SSH into the server you’ll use as the Wazuh Manager and run the official installation script:
curl -sO https://packages.wazuh.com/4.9/wazuh-install.sh
sudo bash ./wazuh-install.sh -a
The -a flag installs the complete Wazuh Indexer, Wazuh Server, and Wazuh Dashboard stack, along with internal SSL certificates. This process takes about 3–5 minutes depending on your network speed.
Once the installation finishes, the terminal will print out your login credentials:
INFO: --- Summary ---
INFO: You can access the web interface https://<wazuh-dashboard-ip>
INFO: User: admin
INFO: Password: <Random_password>
INFO: Installation finished.
Save that admin password right away. Open your browser and go to https://<WAZUH_SERVER_IP>, bypassing the self-signed certificate warning if you haven’t attached a domain yet. After logging in, you’ll land on the Wazuh Dashboard overview screen.
Next up is connecting the Linux server you want to monitor (called an Agent). In the Dashboard, go to Agents → Deploy new agent, select your OS (DEB/RPM), and enter your Wazuh Server IP. Copy the generated command and run it on the target server:
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | sudo gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && sudo chmod 644 /usr/share/keyrings/wazuh.gpg
echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" | sudo tee /etc/apt/sources.list.d/wazuh.list
sudo apt-get update
sudo WAZUH_MANAGER="10.0.0.10" apt-get install wazuh-agent -y
sudo systemctl daemon-reload
sudo systemctl enable wazuh-agent
sudo systemctl start wazuh-agent
Make sure to replace 10.0.0.10 with your actual Wazuh Server IP. Wait about 15 seconds and refresh the Dashboard—you should see the agent status change to Active.
How Wazuh Works and Core Configuration
Your stack is up and running, but you still need to understand the data flow underneath. Later on, if you run into connection drops or need to write custom rules, you’ll know exactly which file to open.
Wazuh’s 4-Component Architecture
- Wazuh Agent: Installed on each Linux server you want to protect (using only about 30–60MB of RAM). It reads system logs (
/var/log/auth.log,syslog, Nginx, etc.), monitors files, and sends encrypted data to the Manager over port1514/TCP. - Wazuh Server (Manager): The central processing engine. The Manager receives data from Agents, uses Decoders to extract fields, and matches them against the Ruleset to detect anomalies.
- Wazuh Indexer: Built on OpenSearch, it stores and indexes all logs and alerts for fast querying.
- Wazuh Dashboard: The web UI for filtering logs, viewing attack charts, and tracking security compliance scores.
Verifying Agent Connectivity and Opening Firewall Ports
Agent still not showing up in the Dashboard? 90% of the time, a firewall is blocking the ports. On the Wazuh Server, you need to open 1514/TCP (agent data), 1515/TCP (new agent registration), and 443/TCP (Dashboard access):
sudo ufw allow 1514/tcp
sudo ufw allow 1515/tcp
sudo ufw allow 443/tcp
sudo systemctl status wazuh-manager
If the agent still isn’t connecting, check the log directly on the Agent machine at /var/ossec/logs/ossec.log to see if there’s a timeout or a wrong Manager IP:
sudo tail -n 30 /var/ossec/logs/ossec.log
Real-Time File Integrity Monitoring (FIM)
Once attackers gain access, they often drop a web shell into your web root or modify your SSH config. The File Integrity Monitoring (FIM) module alerts you immediately whenever a file is created, modified, or deleted.
Open /var/ossec/etc/ossec.conf on the Wazuh Agent. Find the <syscheck> tag and add the sensitive directories you want to watch in real time:
<syscheck>
<disabled>no</disabled>
<frequency>43200</frequency>
<directories check_all="yes" realtime="yes" report_changes="yes">/etc/ssh</directories>
<directories check_all="yes" realtime="yes" report_changes="yes">/var/www/html</directories>
</syscheck>
Save the file and run sudo systemctl restart wazuh-agent. From now on, whenever someone edits /etc/ssh/sshd_config or uploads a suspicious PHP file to /var/www/html, the Dashboard will immediately report the file path, timestamp, and the exact diff of what changed. (If you also need to know which Linux user made the change, just add the whodata="yes" attribute to the <directories> tag.)
Automated Security Compliance Assessment (SCA)
The Security Configuration Assessment (SCA) feature is especially handy if you aren’t yet familiar with server hardening. As soon as an agent connects, Wazuh automatically scans the OS configuration against the CIS Benchmark.
It checks practical things like whether SSH root login is disabled, whether your password policy is strong enough, or whether unnecessary services are running. Go to your Agent → Configuration Assessment tab in the Dashboard to see your compliance percentage and suggested commands to remediate each Failed check.
Advanced: Auto-Blocking Attacks with Active Response and Custom Rules
Seeing alerts isn’t enough. If someone starts brute-forcing SSH passwords at 3 AM, your system should automatically block the attacker’s IP before you even wake up.
Enabling Active Response to Block SSH Brute-Force IPs
Active Response lets Wazuh automatically run a script to block IPs via your firewall (iptables/nftables/firewalld) as soon as a high-severity rule triggers. Open /var/ossec/etc/ossec.conf on the Wazuh Manager and add the following block inside the <ossec_config> tag:
<active-response>
<command>firewall-drop</command>
<location>local</location>
<rules_id>5763</rules_id>
<timeout>600</timeout>
</active-response>
By default, rule 5763 triggers when an IP fails SSH login 8 times in a row within 2 minutes. When that happens, the Manager instructs the Agent on the targeted machine (local) to run firewall-drop, blocking the source IP for 600 seconds (10 minutes). After 10 minutes, the block is automatically lifted so legitimate users don’t get locked out permanently. Finally, run sudo systemctl restart wazuh-manager to apply the change.
Writing a Custom Rule for Internal Applications
Suppose your app logs an error to /var/log/myapp.log whenever someone probes an admin API endpoint. Open /var/ossec/etc/rules/local_rules.xml on the Manager to define a custom high-severity alert rule (custom rule IDs always fall in the 100000–120000 range):
<group name="local,myapp,">
<rule id="100010" level="10">
<match>UNAUTHORIZED_ADMIN_ACCESS</match>
<description>Detected unauthorized access to admin API</description>
</rule>
</group>
Don’t forget to add a <localfile> entry in ossec.conf on the Agent so Wazuh reads /var/log/myapp.log. Before restarting the Manager, test your rule with the built-in testing tool:
sudo /var/ossec/bin/wazuh-logtest
Paste a log line containing UNAUTHORIZED_ADMIN_ACCESS into the terminal. If the output shows id: '100010' and level: '10', your rule is working properly.
Practical Wazuh Operations Tips for Junior Devs
- Schedule old log cleanup to avoid filling up your disk: Wazuh Indexer eats through storage fairly quickly—anywhere from a few hundred MB to several GB per day depending on traffic. Go to Dashboard → Index Management → State management policies to create a policy that automatically deletes indices older than 30 or 90 days.
- Avoid alert fatigue: Right after enabling Wazuh, you’ll see thousands of low-level events (levels 3–5) every day. Filter for level 10 and above in the Dashboard to tackle critical incidents first, then gradually tune out the noise.
- Lock down Dashboard port 443: Never expose the admin UI to the entire internet. Use UFW to restrict
443/TCPto your office IP or route access through an internal VPN. - Send alerts to Slack or Telegram: Nobody can stare at the Dashboard all day. You can configure an
<integration>block inossec.confon the Manager to forward all level 10+ alerts to Slack (built-in support) or Telegram (via a custom integration script).

