Skip to content

Wazuh Home SOC Lab

Wazuh is an open-source security platform that collects logs, checks file integrity, detects threats and maps alerts to MITRE ATT&CK. In this lab you run a single-node Wazuh server on your laptop, enroll two lab machines, generate harmless test events and practise triage.

Laptop / host (Docker) Lab machines (VMs on a host-only or NAT network)
+-----------------------------------+ +---------------------------+
| wazuh.manager (1514, 1515, 55000)|<----------| Windows 10/11 VM agent |
| wazuh.indexer (9200) |<----------| Ubuntu VM agent |
| wazuh.dashboard (HTTPS 443) | +---------------------------+
+-----------------------------------+
browser: https://localhost
Item Minimum for a lab Comfortable
RAM for the stack 6 GB free 8 GB or more free
CPU 2 cores 4 cores
Disk 20 GB 50 GB
Each lab VM 2 GB RAM 4 GB RAM

The indexer (OpenSearch based) is the heavy part. On a 16 GB laptop with two light VMs this is workable; on 8 GB total it will struggle. Check the official sizing guidance at documentation.wazuh.com before you start.

Docker Engine with the Compose plugin and git. On Linux, the indexer requires a higher memory-map limit:

Terminal window
sudo sysctl -w vm.max_map_count=262144
# make it persistent across reboots
echo "vm.max_map_count=262144" | sudo tee /etc/sysctl.d/99-wazuh.conf

On Docker Desktop with WSL2, set it inside the WSL distribution that Docker uses (for example wsl -d docker-desktop sysctl -w vm.max_map_count=262144, repeated after a restart unless you configure it persistently).

Wazuh publishes an official repository with a single-node Docker deployment. Do not guess a version: open the Wazuh documentation (Deployment on Docker) or the wazuh-docker releases page to find the current release tag, then use it below.

Terminal window
# Replace <RELEASE_TAG> with the current tag shown in the Wazuh docs, e.g. v4.x.y
git clone https://github.com/wazuh/wazuh-docker.git -b <RELEASE_TAG>
cd wazuh-docker/single-node
# Generate the certificates for indexer, manager and dashboard
docker compose -f generate-indexer-certs.yml run --rm generator
# Start the stack
docker compose up -d

Watch it come up (the first start takes a few minutes while the indexer initialises):

Terminal window
docker compose ps
docker compose logs -f wazuh.manager

Open https://localhost (your browser warns about the self-signed certificate; acceptable for a local lab). The documented default login is user admin with the default password listed in the docs for that release.

Run in an elevated PowerShell on the Windows VM. Use the MSI URL for the same major version as your manager, taken from the Wazuh “Installing agents” page (the agent must not be newer than the manager). MANAGER_IP is the address at which the VM can reach your laptop’s Docker ports 1514 and 1515, for example the host-only adapter address.

Terminal window
$ManagerIP = "MANAGER_IP"
# Paste the current MSI URL from the Wazuh docs:
Invoke-WebRequest -Uri "<WAZUH_AGENT_MSI_URL>" -OutFile "$env:TEMP\wazuh-agent.msi"
msiexec.exe /i "$env:TEMP\wazuh-agent.msi" /q WAZUH_MANAGER="$ManagerIP" WAZUH_AGENT_NAME="win-lab"
Start-Service -Name WazuhSvc
Get-Service WazuhSvc
Terminal window
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" | sudo tee /etc/apt/sources.list.d/wazuh.list
sudo apt-get update
sudo WAZUH_MANAGER="MANAGER_IP" WAZUH_AGENT_NAME="ubuntu-lab" apt-get install -y wazuh-agent
sudo systemctl daemon-reload
sudo systemctl enable --now wazuh-agent

On RPM-based systems use the yum/dnf repository and package from the same documentation page. The 4.x in the repo path tracks the 4.x series; check the docs if your manager is a different major version. Confirm on the dashboard under Agents that both machines show as Active. If not, see the troubleshooting list at the end.

Do these only on your own lab machines.

Test How What you should see
Failed SSH logins From a second lab machine, ssh wronguser@ubuntu-lab-ip and give wrong passwords 3 to 5 times Authentication failure events (rule group authentication_failed, sshd)
Failed Windows logon Lock the lab VM and enter a wrong password a few times (or runas /user:nosuchuser cmd) Event ID 4625 style failed logon alerts
New local user sudo useradd labtest then sudo userdel labtest on Linux Account creation/deletion alerts
sudo usage sudo ls /root Privilege escalation (sudo) events at low level
File integrity Create or edit a file in a monitored directory, e.g. echo test | sudo tee /etc/lab-fim-test.txt FIM alert (syscheck) such as “File added to the system”

By default Wazuh’s file integrity monitoring (FIM) scans on a schedule (often every 12 hours) for most directories, so alerts may not appear instantly. To see changes quickly, add a realtime directory in the agent’s ossec.conf inside the <syscheck> block and restart the agent:

<directories realtime="yes">/home/youruser/fim-lab</directories>
Terminal window
mkdir -p ~/fim-lab && sudo systemctl restart wazuh-agent
echo "hello" > ~/fim-lab/test.txt

Open Threat Hunting (or Security events) and select an agent. For each alert, read these fields:

Field Why it matters
rule.level Severity 0-15. Start with 7 and above; ignore noise below until you know your baseline
rule.id and rule.description Identifies the detection logic; search the rule ID to see what it means
agent.name / agent.ip Which machine, and is it a critical one
rule.mitre.id / rule.mitre.tactic Maps to ATT&CK, e.g. brute force or persistence
data.srcip, data.dstuser Who or what attempted the action
syscheck.path, syscheck.event For FIM: what changed and how
full_log The raw log line, the ground truth

Triage routine:

  1. Is it real? Does it match something you just did? Lab ones will.
  2. Scope. Search the same data.srcip or user across all agents.
  3. Context. Look at events before and after on the same agent.
  4. Decide. Benign, tune, or escalate; write a one-line note.

Also explore the Vulnerability Detection, Configuration Assessment (SCA) and MITRE ATT&CK dashboards for your agents.

  • Start with the defaults, then reduce noise by raising the minimum level you review rather than disabling rules.
  • Put custom rules and overrides in /var/ossec/etc/rules/local_rules.xml (inside the manager container), using IDs from 100000 up; never edit the stock rules files.
  • Exclude noisy paths from FIM with <ignore> entries in the agent config.
  • Use agent groups to push different configurations to servers and workstations.
  • Keep the manager and agents on compatible versions, and restart the manager after rule changes.

You rarely install agents on PLCs, but you can on Windows HMIs, engineering workstations, historians and jump hosts in the OT zone. Use Wazuh there for logins, USB/file changes and service changes, and pair it with passive network analysis from Wireshark for OT. See Cybersecurity Start Here for the segmentation context and the VLAN Planner to design where the manager should live.

Problem Check
Indexer container restarts vm.max_map_count not set; RAM too low (docker stats)
Dashboard says “not ready” Wait a few minutes; docker compose logs wazuh.indexer
Agent stays “Never connected” VM cannot reach manager ports 1514/1515; check firewall and the manager IP
Agent rejected Agent version newer than manager, or duplicate agent name
Certificate errors on start Re-run the certificate generator after docker compose down -v
Terminal window
cd wazuh-docker/single-node
docker compose down # stop, keep data
docker compose down -v # stop and delete all lab data

On the agents:

Terminal window
sudo systemctl disable --now wazuh-agent && sudo apt-get remove --purge -y wazuh-agent
Terminal window
Stop-Service WazuhSvc
# Then uninstall "Wazuh Agent" from Apps & features, or: msiexec /x "$env:TEMP\wazuh-agent.msi" /q

More tools are listed under /tools/; for the next skill, see the certifications primer.