Skip to content

Build a Small SOC Lab with Wazuh

Admin
October 5, 2026
14 min read
Intermediate
💻 Target OS: Ubuntu 24.04+ / Debian 12+

Before you begin

  • Applies to:A small Wazuh deployment for learning and testing.
  • Where to start:Start on a private lab network with test-only machines.
  • What you need:Have a lab server and endpoint, approved admin access, and installation instructions for the Wazuh release you are using.
Guide tools
Guide tools
0/0 Steps (0%)

Wazuh combines endpoint agents, a manager, an indexer, and a dashboard. This lab uses one all-in-one Wazuh server and one disposable Linux endpoint to practice enrollment, safe event generation, alert review, and a small rule change.

Use a private lab network and test-only machines. Do not enroll production endpoints or expose the Wazuh dashboard directly to the internet. Installer commands and dashboard wording can change between Wazuh releases; follow the release-matched official documentation linked below.

Wazuh dashboard showing an enrolled Linux test agent and recent file-integrity events in a private lab

Figure 1: Review endpoint health and file-integrity events in the Wazuh dashboard.

Lab flow from a Linux test endpoint through the Wazuh server components to the analyst dashboard

Lab layout: Keep the endpoint and Wazuh server on a private, controlled network.


01

Choose the Server and Test Endpoint

Lab Scope

Prepare a supported Linux VM for the Wazuh all-in-one deployment and a second Linux VM to monitor. Give the server enough CPU, memory, and disk for the release in use; the quickstart currently recommends a single-node lab sized for roughly 4 vCPU, 8 GiB RAM, and 50 GiB storage. Use snapshots so you can recover the VMs, and record their private addresses and owner.

Wazuh server: 10.20.0.10 (private lab network)
Linux agent: 10.20.0.21 (disposable test VM)
Test scope: /var/tmp/soc-lab only
Owner: SOC lab operator
❯ Illustrative Output (Results Vary)
Both VMs are reachable only from the lab segment.
No production credentials, data, or endpoints are in scope.

02

Install the Central Wazuh Components

Wazuh Setup

On the server VM, use the Wazuh quickstart for the release you selected. The commands below follow the 4.14 quickstart. Review the downloaded installer and run it only on the disposable lab server. The all-in-one option installs the server, indexer, and dashboard together; it is intended for a small lab rather than a production cluster.

Terminal window
installer=$(mktemp) || exit 1
if ! curl -fsSL https://packages.wazuh.com/4.14/wazuh-install.sh -o "$installer"; then
rm -f "$installer"
echo 'Could not download the Wazuh installer.' >&2
exit 1
fi
less "$installer" || { rm -f "$installer"; echo 'Could not review the Wazuh installer; stopping before execution.' >&2; exit 1; }
sudo bash "$installer" -a
install_status=$?
rm -f "$installer"
if (( install_status != 0 )); then
echo "Wazuh installation failed with exit code $install_status." >&2
exit "$install_status"
fi
❯ Illustrative Output (Results Vary)
Installation completed.
Dashboard: https://10.20.0.10

03

Add the Test Agent from the Dashboard

Endpoint Enrollment

Sign in to the dashboard over the private lab network. Open the Agents area, choose the option to deploy a new agent, and select the Linux distribution and architecture for the test VM. Use the generated repository and enrollment instructions on that VM; they include the manager address and agent name. Keep the generated key private and do not reuse it for another host.

Agent name: linux-lab-01
Manager address: 10.20.0.10
Platform: the exact Linux release and architecture of the VM
❯ Illustrative Output (Results Vary)
Dashboard check: linux-lab-01 is Active
Record: agent name, VM owner, enrollment time, and release

04

Monitor a Dedicated Test Directory

Safe Test Event

On the endpoint, add one directory to the agent’s existing <syscheck> section in /var/ossec/etc/ossec.conf. Do not add a duplicate section. This monitors only the lab folder and requests real-time checks where supported. Restart the agent and create an empty test script. The creation itself provides the first benign FIM event.

<directories realtime="yes" check_all="yes">/var/tmp/soc-lab</directories>
Terminal window
sudo test ! -e /var/tmp/soc-lab || { echo 'The lab directory already exists; choose a fresh disposable endpoint or inspect it before monitoring.' >&2; exit 1; }
sudo install -d -m 0700 /var/tmp/soc-lab || exit 1
sudo test ! -e /var/tmp/soc-lab/permission-check.sh || { echo 'The lab test file already exists; choose a fresh test filename.' >&2; exit 1; }
sudo systemctl restart wazuh-agent && sudo touch /var/tmp/soc-lab/permission-check.sh
❯ Illustrative Output (Results Vary)
Expected event: new file permission-check.sh in the watched folder
No executable code is placed in or run from the test file.

05

Review the Event in Wazuh

Alert Triage

In the dashboard’s Security events or File Integrity Monitoring views, filter to linux-lab-01 and the current time window. Open the event and record the agent, path, event time, event fields, and rule description. Confirm that the path is inside the lab folder and that the observed file addition matches the test you performed.

Check: correct agent and test path
Check: event time follows file creation
Check: event type is a file addition
Record: event ID, rule ID, agent ID, and analyst interpretation
❯ Illustrative Output (Results Vary)
Finding: file addition at the expected lab path; reproduced by the analyst.
Disposition: expected test event, documented and closed under lab procedure.

06

Alert on the Lab Permission Change

Rule Tuning

On the Wazuh manager, add a narrowly scoped rule inside an existing <group> in /var/ossec/etc/rules/local_rules.xml. Confirm the ID is unused in this manager. This example builds on the documented FIM permission-change event, matches only shell-script paths in the lab directory, and raises its level for review. Do not change the shipped rules in place or nest a <group> inside another group.

<rule id="100101" level="5">
<if_sid>550</if_sid>
<field name="file">/var/tmp/soc-lab/.*\.sh$</field>
<field name="changed_fields">^permission$</field>
<field name="perm" type="pcre2">\w\wx</field>
<description>SOC lab: execute permission added to a test script.</description>
</rule>
Terminal window
# Test interactively with a raw event sample, then exit wazuh-logtest.
sudo /var/ossec/bin/wazuh-logtest

After leaving the interactive tester, load the rule and generate the monitored permission change:

Terminal window
sudo systemctl restart wazuh-manager && sudo chmod u+x /var/tmp/soc-lab/permission-check.sh
❯ Illustrative Output (Results Vary)
Test the rule with a representative raw event before loading it.
After validation, restart wazuh-manager and generate the controlled FIM event.

After installing the local rule, launch wazuh-logtest and use a representative raw event from the manager archives if archive logging is enabled; do not paste the dashboard’s formatted alert JSON. Exit the tester, restart the manager, then run the chmod command shown above and confirm the resulting alert matches the new rule. If archive logging is not enabled in this lab, validate the rule with the controlled FIM event after restart. Keep a copy of the previous rule file so you can roll back, and document the reason for the level and scope you chose.

Comments