966 words
5 minutes
Wazuh 101 - Part 2: Integrating pfSense, Sysmon, VirusTotal, and Suricata
2026-08-11
2026-10-09

In this part, I’ll continue deploying additional supporting tools for generating logs and isolating the VMs from each other within the same LAN, to simulate an enterprise environment as closely as possible.

NOTE

This Part 2 is written entirely based on Wazuh’s official documentation (documentation.wazuh.com) and official blog (wazuh.com/blog) — every section includes its source link. Unlike Part 1, I didn’t take step-by-step screenshots this time (the lab is running on a different machine), so this part focuses on exact commands/configs rather than screenshots.

Finishing Up pfSense — Forwarding Logs to Wazuh#

In Part 1, I only got as far as setting up pfSense as the central router/firewall for the LAN, without yet having it send logs to Wazuh. This is the mandatory next step so Wazuh can actually see what traffic is passing through the firewall.

Go to Status > System Logs > Settings on pfSense:

  • Enable Remote Logging, set Source Address = LAN
  • Set the log format to syslog (RFC 5424)
  • Remote log server: enter VM1’s (Wazuh) IP, port 514

Remember to add a Firewall Rule under Firewall > Rules > LAN allowing UDP port 514 traffic from pfSense to the Wazuh Server’s IP — without this rule, logs will never arrive no matter how correctly remote logging is configured.

One important gotcha that comes up across a lot of guides: by default pfSense doesn’t include a properly formatted hostname in the syslog header, which prevents Wazuh’s pre-decoder from correctly parsing the log source. The most common fix is to stand up a syslog-ng instance as a middleman, forcing the format into proper RFC 3164 shape before forwarding it on to Wazuh.

On the Wazuh Manager side, add the following block to /var/ossec/etc/ossec.conf to open up a syslog listening port:

<remote>
  <connection>syslog</connection>
  <port>514</port>
  <protocol>udp</protocol>
  <allowed-ips>10.0.1.0/24</allowed-ips>
  <local_ip>10.0.1.1</local_ip>
</remote>

allowed-ips must be declared when using connection type syslog — if left blank, Wazuh will reject all incoming logs even if they hit the right port.

VM3 — Installing Sysmon and Integrating It with the Wazuh Agent#

Default Windows Event logs are fairly sparse (as covered in the Event ID post) — Sysmon is a must-have to fill that gap, especially for process-creation logs that include file hashes and parent process info.

Installing Sysmon#

Download Sysmon from Microsoft Sysinternals’ official site: learn.microsoft.com/sysinternals/downloads/sysmon.

Instead of writing a config from scratch, I used a well-known community config that’s widely recommended in the DFIR community — SwiftOnSecurity/sysmon-config — which already ships with a set of filters balanced between capturing enough suspicious events and not letting the logs balloon out of control.

Install via CMD with Administrator privileges:

Sysmon64.exe -accepteula -i sysmonconfig-export.xml

Getting the Wazuh Agent to Read Sysmon Logs#

Add the following to the agent’s ossec.conf on VM3 (path C:\Program Files (x86)\ossec-agent\ossec.conf):

<localfile>
  <location>Microsoft-Windows-Sysmon/Operational</location>
  <log_format>eventchannel</log_format>
</localfile>

eventchannel is the format that tells Wazuh to read directly from the specified Windows Event Log channel, rather than reading a plain text file. Restart the Wazuh Agent to apply it.

Source: Wazuh blog - Using Wazuh to monitor Sysmon events.

Integrating VirusTotal — Automatically Detecting and Removing Malicious Files#

This is my favorite part, since it turns Wazuh from something that just “knows” a suspicious file showed up into something that takes action on its own, without anyone needing to sit and watch the dashboard.

How it works: Wazuh uses the FIM (File Integrity Monitoring) module to watch a directory; whenever a new or modified file appears, Wazuh sends that file’s hash to the VirusTotal API for a check. If VirusTotal flags it as malicious, Wazuh triggers an Active Response to automatically delete the file.

Step 1 — Enable Real-Time FIM for the Directory to Monitor#

<syscheck>
  <disabled>no</disabled>
  <directories realtime="yes">/root</directories>
</syscheck>

(on Windows, use a path like C:\Users\<USER_NAME>\Downloads)

Step 2 — Declare the VirusTotal Integration (on the Wazuh Server)#

<integration>
  <name>virustotal</name>
  <api_key><YOUR_VIRUS_TOTAL_API_KEY></api_key>
  <rule_id>100200,100201</rule_id>
  <alert_format>json</alert_format>
</integration>

Note: VirusTotal’s free API key is limited to 4 requests/minute — if you’re monitoring a directory with a lot of files changing constantly, you’ll hit the rate limit easily. This needs careful consideration for real-world use, not just a lab environment.

Step 3 — Active Response to Automatically Remove Malicious Files#

<command>
  <name>remove-threat</name>
  <executable>remove-threat.sh</executable>
  <timeout_allowed>no</timeout_allowed>
</command>

<active-response>
  <disabled>no</disabled>
  <command>remove-threat</command>
  <location>local</location>
  <rules_id>87105</rules_id>
</active-response>

(on Windows, replace remove-threat.sh with remove-threat.exe)

Rule 87105 is exactly the rule Wazuh generates once VirusTotal confirms a file is malicious — this active response automatically runs the removal script as soon as that rule matches, with no need to wait for human intervention.

Source: Wazuh documentation - Detecting and removing malware using VirusTotal integration.

Integrating Suricata — Network IDS#

If VirusTotal + FIM handle the host-based side, Suricata adds the network-based piece — catching suspicious traffic passing through the network that endpoint agents can’t see.

Installing Suricata (on Ubuntu)#

sudo add-apt-repository ppa:oisf/suricata-stable
sudo apt-get update
sudo apt-get install suricata -y

Download the Emerging Threats ruleset (the most popular open-source ruleset for Suricata):

cd /tmp/ && curl -LO https://rules.emergingthreats.net/open/suricata-6.0.8/emerging.rules.tar.gz
sudo tar -xvzf emerging.rules.tar.gz && sudo mkdir /etc/suricata/rules && sudo mv rules/*.rules /etc/suricata/rules/

Configuring suricata.yaml#

The key values to adjust in /etc/suricata/suricata.yaml:

HOME_NET: "<IP_MANG_LAB>"
EXTERNAL_NET: "any"
default-rule-path: /etc/suricata/rules
rule-files:
  - "*.rules"

af-packet:
  - interface: enp0s3   # đổi thành đúng tên interface đang dùng

Restart the service:

sudo systemctl restart suricata

Getting the Wazuh Agent to Read eve.json#

The eve.json file is where Suricata writes all its alerts in JSON format (by default at /var/log/suricata/eve.json). Add this to ossec.conf:

<localfile>
  <log_format>json</log_format>
  <location>/var/log/suricata/eve.json</location>
</localfile>

The nice part is that Wazuh already ships with a Suricata-handling ruleset right out of the box (/var/ossec/ruleset/rules/0475-suricata_rules.xml), so there’s no need to write a decoder from scratch — restart the agent and alerts will show up on the dashboard automatically, quick-filterable with rule.groups:suricata.

Source: Wazuh documentation - Network IDS integration.

Summary#

With that, the lab now has all 4 pieces complete: pfSense forwarding network logs, Sysmon providing deep visibility on the Windows endpoint, VirusTotal enabling automatic reaction to malicious files, and Suricata providing the network-based view. Next, I’m planning to simulate a real attack from VM4 (Attacker) to see how the entire alert chain holds up end to end — I’ll follow up in Part 3 if I get the chance.

Wazuh 101 - Part 2: Integrating pfSense, Sysmon, VirusTotal, and Suricata
https://stewmalwarehunter.id.vn/posts/wazuh-learning-part-2-wazuh-en/
Author
Stew
Published at
2026-08-11
License
CC BY-NC-SA 4.0