!

Wazuh SIEM

Security Monitoring & Threat Detection

SIEM XDR Threat Intel Project D
0

What Are We Building?

Understanding SIEM and Wazuh

🔗 Standalone Project (Works with Projects A, B, C)
🛡️
Your Security Operations Center

Monitor everything. Detect threats. Respond fast. All from one dashboard!

How Wazuh Works

🖥️
Agents
Servers
🔴
Manager
Analysis
📊
Indexer
Storage
📈
Dashboard
Visualize
🚨
Alerts
Notify

What is a SIEM?

Security Information and Event Management

A SIEM collects logs from all your systems, analyzes them for threats, and alerts you when something bad happens. Think of it as a security camera system for your entire infrastructure - but smarter!

🎯

What You'll Have When Done

  • Centralized log collection from all servers
  • Real-time threat detection
  • File integrity monitoring (detect file changes)
  • Vulnerability detection
  • Compliance monitoring (PCI-DSS, HIPAA, etc.)
  • Security dashboards and visualizations
  • Alerting via email, Slack, or webhook

Wazuh Alert Severity Levels

CRITICAL
12-15
Active attack, data breach, rootkit detected
HIGH
8-11
Brute force, privilege escalation attempts
MEDIUM
4-7
Failed logins, config changes, suspicious activity
LOW
0-3
Informational, successful logins, normal events

⚡ The Problem Wazuh Solves

Without SIEM:

  • Logs scattered across dozens of servers
  • No idea if you're being attacked right now
  • Find out about breaches weeks or months later
  • Manual log review is impossible at scale

With Wazuh: All logs in one place, automatic threat detection, instant alerts, and compliance reporting!

⏱️

Time Investment

Phase Time Difficulty
Understanding Concepts 15-20 min Reading
Wazuh Stack Installation 45-60 min Medium
Agent Deployment 20-30 min Easy
Custom Rules 30-45 min Medium
Alerting Setup 20-30 min Easy
Integration with Other Projects 30-45 min Medium

Total: 3-4 hours

1

Core Concepts

Understanding Wazuh architecture

🧠
Wazuh Components

Three main components work together to protect your infrastructure

🖥️
Wazuh Agent
Installed on each server. Collects logs, monitors files, detects vulnerabilities
🔴
Wazuh Manager
The brain. Receives data from agents, runs detection rules, generates alerts
📊
Wazuh Indexer
Stores and indexes all data. Based on OpenSearch. Enables fast searching
📈
Wazuh Dashboard
Web interface. Visualizations, alerts, agent management, compliance reports
🔍

What Wazuh Can Detect

Capability What It Does Example
Log Analysis Parse and analyze logs from any source Failed SSH login attempts
File Integrity Detect when critical files change /etc/passwd modified
Rootkit Detection Find hidden malware and backdoors Hidden processes, kernel modules
Vulnerability Scan Detect unpatched software OpenSSL CVE-2024-xxxx
Active Response Automatically block threats Block IP after 5 failed logins
Compliance Check against standards PCI-DSS, HIPAA, GDPR checks
🎯

MITRE ATT&CK Integration

Wazuh maps alerts to the MITRE ATT&CK framework - the industry standard for categorizing attacker tactics and techniques.

This helps you understand:

  • What technique an attacker is using
  • What stage of an attack they're in
  • How to respond appropriately
💡
SOC Analyst Skills

Running Wazuh gives you hands-on experience with the same tools used in enterprise Security Operations Centers (SOCs). Great for your resume!

2

Prerequisites

What you need before starting

Before You Begin

Wazuh needs more resources than our other projects

🖥️

Server Requirements (Wazuh All-in-One)

Resource Minimum Recommended
CPU 4 cores 8 cores
RAM 8 GB 16 GB
Storage 50 GB SSD 100+ GB SSD
⚠️
Resource Heavy!

Wazuh with the Indexer uses significant RAM. If running alongside Projects A-C, you'll need at least 16 GB total RAM on your server.

🔧

Two Installation Options

Option Pros Cons
Option A: Docker
(This Guide)
Easy setup, consistent environment, works with our stack Uses more RAM
Option B: Native Install Better performance, lower overhead More complex, harder to update
📋

Checklist

  • Ubuntu Server 24.04 LTS with Docker installed
  • At least 8 GB RAM available (16 GB total recommended)
  • 50 GB free disk space
  • Port 1514 (UDP) open for agent communication
  • Port 443 open for dashboard access
3

Install Wazuh

Deploy the complete Wazuh stack with Docker

⚠️ Run All Commands on Your SERVER

SSH into your server first. All commands run on the server, not your local machine.

1
Create Wazuh Directory
⏱️ 2 min
📁 Create Directory Structure
# Create Wazuh directory
mkdir -p ~/wazuh-docker
cd ~/wazuh-docker

# Clone official Wazuh Docker repository
git clone https://github.com/wazuh/wazuh-docker.git -b v4.9.0
cd wazuh-docker/single-node
2
Generate SSL Certificates
⏱️ 5 min
🔐 Generate Certificates
# Generate self-signed certificates for Wazuh components
docker compose -f generate-indexer-certs.yml run --rm generator

# Verify certificates were created
ls -la config/wazuh_indexer_ssl_certs/
3
Start Wazuh Stack
⏱️ 10 min
🚀 Start All Services
# Start all Wazuh services
docker compose up -d

# This starts:
# - wazuh.manager (log analysis, rules engine)
# - wazuh.indexer (data storage, search)
# - wazuh.dashboard (web interface)

# Wait for services to be healthy (2-3 minutes)
docker compose ps

# Watch the logs
docker compose logs -f
First Start Takes Time

The indexer needs to initialize. Wait 2-3 minutes before accessing the dashboard.

4
Access Wazuh Dashboard
⏱️ 2 min
  1. Open your browser to: https://YOUR_SERVER_IP
  2. Accept the self-signed certificate warning
  3. Login with default credentials:
    Username admin
    Password SecretPassword
🔐
Change Default Password!

Go to Settings → Security → Internal Users to change the admin password immediately.

5
Verify Installation
⏱️ 3 min
Health Check Commands
# Check all containers are running
docker compose ps

# Check Wazuh Manager status
docker exec -it single-node-wazuh.manager-1 /var/ossec/bin/wazuh-control status

# Check Indexer health
curl -k -u admin:SecretPassword https://localhost:9200/_cluster/health?pretty

# View manager logs
docker logs single-node-wazuh.manager-1 --tail=50
🎉
Wazuh is Running!

You should see the Wazuh dashboard. Currently no agents are connected - let's fix that next!

4

Deploy Agents

Install agents on servers you want to monitor

🖥️
Connect Your Servers

Agents run on each server, collecting logs and sending them to the Wazuh Manager

1
Install Agent on Ubuntu/Debian
⏱️ 5 min

Run these commands on the SERVER you want to monitor (not the Wazuh server):

🐧 Ubuntu/Debian Agent Installation
# Add Wazuh repository
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && 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" | tee /etc/apt/sources.list.d/wazuh.list

# Install agent
apt update
WAZUH_MANAGER="YOUR_WAZUH_SERVER_IP" apt install -y wazuh-agent

# Enable and start agent
systemctl daemon-reload
systemctl enable wazuh-agent
systemctl start wazuh-agent

# Check status
systemctl status wazuh-agent
📝
Replace IP Address!

Change YOUR_WAZUH_SERVER_IP to the actual IP address of your Wazuh server.

2
Install Agent on CentOS/RHEL (Optional)
⏱️ 5 min
🎩 CentOS/RHEL Agent Installation
# Add Wazuh repository
rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH

cat > /etc/yum.repos.d/wazuh.repo << EOF
[wazuh]
gpgcheck=1
gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH
enabled=1
name=Wazuh repository
baseurl=https://packages.wazuh.com/4.x/yum/
protect=1
EOF

# Install agent
WAZUH_MANAGER="YOUR_WAZUH_SERVER_IP" yum install -y wazuh-agent

# Enable and start
systemctl daemon-reload
systemctl enable wazuh-agent
systemctl start wazuh-agent
3
Verify Agent Connection
⏱️ 3 min
Check Agent Status
# On the WAZUH SERVER, list connected agents
docker exec -it single-node-wazuh.manager-1 /var/ossec/bin/agent_control -l

# You should see something like:
# ID: 001, Name: ubuntu-server, IP: 192.168.1.50, Active

# Or check in the Dashboard:
# Agents → Summary
🎉
Agent Connected!

You should see your agent in the Wazuh Dashboard under Agents. It will start sending data immediately!

5

Custom Detection Rules

Create your own security detection rules

📜
Write Your Own Rules

Wazuh has 3000+ built-in rules. You can add your own for custom detection!

1
Enhanced SSH Brute Force Detection
⏱️ 10 min

Create a custom rule to detect SSH brute force attacks:

📝 Create Custom Rule File
# Create custom rules file
docker exec -it single-node-wazuh.manager-1 bash -c 'cat > /var/ossec/etc/rules/local_rules.xml << "EOF"



  
  
    5710
    SSH brute force attack detected (5+ failures in 2 minutes)
    
      T1110
    
    authentication_failures,
  

  
  
    5402
    usermod|useradd
    sudo|wheel|admin
    User added to sudo/admin group - privilege escalation
    
      T1136
    
  

  
  
    550
    /etc/passwd|/etc/shadow|/etc/sudoers
    CRITICAL: Authentication file modified!
    syscheck,
  


EOF'

# Restart manager to load rules
docker exec single-node-wazuh.manager-1 /var/ossec/bin/wazuh-control restart
2
Configure File Integrity Monitoring
⏱️ 10 min

Monitor critical files for unauthorized changes:

📂 FIM Configuration
# Edit the agent configuration (on the monitored server)
nano /var/ossec/etc/ossec.conf

# Add or modify the syscheck section:
<syscheck>
  <disabled>no</disabled>
  <frequency>300</frequency>  <!-- Check every 5 minutes -->
  
  <!-- Critical system files -->
  <directories check_all="yes" realtime="yes">/etc/passwd</directories>
  <directories check_all="yes" realtime="yes">/etc/shadow</directories>
  <directories check_all="yes" realtime="yes">/etc/sudoers</directories>
  <directories check_all="yes" realtime="yes">/etc/ssh</directories>
  
  <!-- Web server configs -->
  <directories check_all="yes">/etc/nginx</directories>
  <directories check_all="yes">/etc/apache2</directories>
  
  <!-- Ignore noisy directories -->
  <ignore>/etc/mtab</ignore>
  <ignore>/etc/resolv.conf</ignore>
</syscheck>

# Restart agent
systemctl restart wazuh-agent
💡
Rule Structure

Each rule has a level (0-15 severity), id (unique number), and description. Rules can chain together using if_sid to detect patterns.

6

Configure Alerting

Get notified when threats are detected

🚨
Real-Time Notifications

Configure email, Slack, or webhook alerts for critical events

1
Configure Email Alerts
⏱️ 10 min
📧 Email Configuration
# Edit manager config
docker exec -it single-node-wazuh.manager-1 nano /var/ossec/etc/ossec.conf

# Add/modify email settings:
<global>
  <email_notification>yes</email_notification>
  <smtp_server>smtp.gmail.com</smtp_server>
  <email_from>wazuh@yourdomain.com</email_from>
  <email_to>security@yourdomain.com</email_to>
  <email_maxperhour>12</email_maxperhour>
</global>

<!-- Alert on level 10+ -->
<alerts>
  <email_alert_level>10</email_alert_level>
</alerts>

# Restart manager
docker exec single-node-wazuh.manager-1 /var/ossec/bin/wazuh-control restart
2
Configure Slack Alerts (Optional)
⏱️ 15 min

Send alerts to a Slack channel:

💬 Slack Integration Script
# Create Slack integration script
docker exec -it single-node-wazuh.manager-1 bash -c 'cat > /var/ossec/integrations/custom-slack << "EOF"
#!/bin/bash
# Slack Webhook Integration for Wazuh

WEBHOOK_URL="YOUR_SLACK_WEBHOOK_URL"

read -r INPUT
ALERT_LEVEL=$(echo $INPUT | jq -r ".alert_level")
RULE_DESC=$(echo $INPUT | jq -r ".rule_description")
AGENT_NAME=$(echo $INPUT | jq -r ".agent_name")
TIMESTAMP=$(echo $INPUT | jq -r ".timestamp")

# Color based on severity
if [ "$ALERT_LEVEL" -ge 12 ]; then
  COLOR="danger"
elif [ "$ALERT_LEVEL" -ge 8 ]; then
  COLOR="warning"
else
  COLOR="good"
fi

curl -X POST -H "Content-type: application/json" \
  --data "{
    \"attachments\": [{
      \"color\": \"$COLOR\",
      \"title\": \"Wazuh Alert - Level $ALERT_LEVEL\",
      \"text\": \"$RULE_DESC\",
      \"fields\": [
        {\"title\": \"Agent\", \"value\": \"$AGENT_NAME\", \"short\": true},
        {\"title\": \"Time\", \"value\": \"$TIMESTAMP\", \"short\": true}
      ]
    }]
  }" $WEBHOOK_URL
EOF
chmod +x /var/ossec/integrations/custom-slack'
3
Active Response (Auto-Block Attackers)
⏱️ 10 min

Automatically block IPs that trigger brute force alerts:

🛡️ Active Response Configuration
# Add to manager ossec.conf:

<!-- Active Response - Block attacking IPs -->
<active-response>
  <command>firewall-drop</command>
  <location>local</location>
  <rules_id>100001</rules_id>  <!-- Our brute force rule -->
  <timeout>600</timeout>        <!-- Block for 10 minutes -->
</active-response>

# This will automatically block any IP that triggers
# 5+ failed SSH logins in 2 minutes
⚠️
Be Careful!

Active response can block legitimate users. Test thoroughly and consider whitelisting trusted IPs.

7

Integrate with Other Projects

Connect Wazuh to your existing stack

🔗
Complete Security Stack

Monitor Authentik, Vault, and all your infrastructure from one place

1
Monitor Docker Containers
⏱️ 10 min

Collect logs from your Docker containers (Authentik, Vault, etc.):

🐳 Docker Log Collection
# On the server running Docker, add to agent ossec.conf:

<localfile>
  <log_format>syslog</log_format>
  <location>/var/lib/docker/containers/*/*-json.log</location>
</localfile>

# Or for specific containers:
<localfile>
  <log_format>json</log_format>
  <location>docker logs authentik-server</location>
  <command>docker logs authentik-server 2>&1</command>
  <frequency>60</frequency>
</localfile>
2
Monitor Authentik Login Events
⏱️ 15 min

Create rules to detect suspicious Authentik activity:

🔑 Authentik Detection Rules
# Add to local_rules.xml:

<group name="authentik,">

  <!-- Authentik failed login -->
  <rule id="100100" level="5">
    <decoded_as>json</decoded_as>
    <field name="event">login_failed</field>
    <description>Authentik: Failed login attempt</description>
    <group>authentication_failed,</group>
  </rule>

  <!-- Authentik brute force -->
  <rule id="100101" level="10" frequency="5" timeframe="300">
    <if_matched_sid>100100</if_matched_sid>
    <description>Authentik: Multiple failed logins (brute force)</description>
    <mitre>
      <id>T1110</id>
    </mitre>
  </rule>

  <!-- New admin user created -->
  <rule id="100102" level="12">
    <decoded_as>json</decoded_as>
    <field name="event">user_write</field>
    <match>is_superuser.*true</match>
    <description>Authentik: New admin user created!</description>
  </rule>

</group>
3
Create Custom Dashboard
⏱️ 15 min
  1. In Wazuh Dashboard, go to Dashboard → Create new
  2. Add visualizations for:
    • Top alert rules triggered
    • Alerts by severity over time
    • Authentication events map
    • File integrity changes
  3. Save as "Home Lab Security Overview"
📊
SOC Dashboard Ready!

You now have a professional Security Operations dashboard showing real-time threats across your entire infrastructure.

8

Testing & Verification

Make sure everything works

🧪
Test Your SIEM

Generate test events to verify detection is working

1
Test SSH Brute Force Detection
⏱️ 5 min
🔓 Generate Test Failed Logins
# From any machine, try failed SSH logins
# (Use wrong password intentionally)

for i in {1..6}; do
  ssh fakeuser@YOUR_MONITORED_SERVER
done

# Press Ctrl+C after each password prompt
# Check Wazuh Dashboard → Security Events
# You should see brute force alerts!
2
Test File Integrity Monitoring
⏱️ 5 min
📝 Trigger FIM Alert
# On a monitored server, modify a watched file
sudo touch /etc/test-fim-alert

# Or add a comment to hosts file
echo "# test" | sudo tee -a /etc/hosts

# Wait for FIM scan (up to 5 minutes)
# Check Dashboard → Integrity Monitoring

# Clean up
sudo rm /etc/test-fim-alert
sudo sed -i '/# test/d' /etc/hosts

Verification Checklist

  • Dashboard accessible at https://YOUR_IP
  • At least one agent showing as "Active"
  • Security events appearing in dashboard
  • SSH brute force alerts trigger correctly
  • File integrity changes detected
  • Custom rules loaded successfully
🔧

Common Issues

🔴 Agent Not Connecting

Cause: Firewall blocking port 1514/UDP

Solution:
• Check agent logs: tail -f /var/ossec/logs/ossec.log
• Verify manager IP in agent config
• Open port 1514/UDP on firewall

🔴 Dashboard Won't Load

Cause: Indexer still initializing or out of memory

Solution:
• Wait 3-5 minutes after startup
• Check memory: free -h
• Check logs: docker logs wazuh.indexer

🔴 No Alerts Appearing

Cause: Agent not sending data or rules not matching

Solution:
• Check agent status: systemctl status wazuh-agent
• Verify alerts.log: tail -f /var/ossec/logs/alerts/alerts.log
• Test rule with: /var/ossec/bin/wazuh-logtest

🎉

Congratulations!

Your SIEM is operational!

🏆
SOC Analyst Skills Acquired

You now have enterprise-grade security monitoring in your home lab!

📊

Skills Demonstrated

  • SIEM deployment and configuration
  • Log collection and analysis
  • Custom detection rule creation
  • File integrity monitoring
  • Incident alerting and response
  • MITRE ATT&CK mapping
  • Security dashboard creation
🚀

Next Steps

  • Add more agents to monitor all servers
  • Create compliance dashboards (PCI-DSS, HIPAA)
  • Integrate with threat intelligence feeds
  • Set up automated incident response
  • Configure log retention policies
  • Build playbooks for common alerts