Network intrusion detection with Suricata and Wazuh
Suricata alerts on a Windows 11 PC reach a Wazuh dashboard on Ubuntu for centralized analysis and threat hunting.
- Role
- Design, deploy, verify
- Environment
- Local lab, Windows 11 + Ubuntu, Hypervisor (VirtualBox)
- Result
- Alerts visible end to end
How the data flows
Wazuh has no dedicated Suricata connector. The agent tails eve.json as a JSON log and forwards events to the manager, which applies its Suricata rules and decoders.
Sample Investigation
Trigger a test alert and follow the event through each stage.
-
- Action
- Opened https://telegram.org in a browser
- Host
- Monitored Windows host
Trigger
Telegram is legitimate but can be abused for malware command and control. The ET Open rule helps identify traffic worth investigating; a match alone does not establish malicious activity.
-
- Signature
- ET INFO Observed Telegram Domain in TLS SNI (telegram .org)
- SNI
- telegram.org
- Destination port
- 443
Open full screenshot → (opens in a new tab)
Suricata detects
Suricata writes the alert to eve.json; the screenshot shows a PowerShell query of those alerts.
-
- Rule description
- Suricata: Alert - ET INFO Observed Telegram Domain in TLS SNI (telegram .org)
- Wazuh rule ID
- 86601
- Rule level
- 3
Open full screenshot → (opens in a new tab)
Wazuh shows it
The dashboard lists the Suricata alerts. Search
data.alert.signature: (ET* or GPL*).
Details
Problems I solved
Nothing captured at first
Check that Npcap is installed in WinPcap API-compatible mode for packet capture.
Interface not found
Check that \Device\NPF_{GUID} matches the interface GUID from Get-NetAdapter.
Dashboard stayed empty
Restart the agent after changing ossec.conf, then check ossec.log for file monitoring and manager connectivity. Also check the dashboard time range.
Setup summary
Add this block inside <ossec_config> in C:\Program Files (x86)\ossec-agent\ossec.conf:
<localfile>
<log_format>json</log_format>
<location>D:\Program Files\Suricata\log\eve.json</location>
</localfile>
Restart the agent to apply the change:
net stop WazuhSvc
net start WazuhSvc
The Emerging Threats Open ruleset is referenced under rule-files in suricata.yaml.
Querying alerts in Suricata (PowerShell)
Counts alerts recorded in eve.json by signature, most frequent first. If rows appear, Suricata is writing alerts to the log.
Open full screenshot → (opens in a new tab)
jq -R -r --arg t alert 'fromjson? | select(.event_type == $t) | .alert.signature' "D:\Program Files\Suricata\log\eve.json" | Group-Object | Sort-Object Count -Descending | Select-Object Count, Name
Shows only the alerts that match a keyword. In the command, change { $_.Line -like '*Telegram*' } to your own keyword, such as a signature name, a domain or an IP address. The results appear as a table with the time, signature, source and destination IPs, destination port and SNI domain. This turns raw log lines into a clear summary of who connected where and which rule detected it.
Open full screenshot → (opens in a new tab)
Get-Content "D:\Program Files\Suricata\log\eve.json" | Select-String '"event_type":"alert"' | Where-Object { $_.Line -like '*Telegram*' } | ForEach-Object { $_.Line | ConvertFrom-Json } | Select-Object timestamp, @{N='Signature';E={$_.alert.signature}}, @{N='Src_IP';E={$_.src_ip}}, @{N='Dest_IP';E={$_.dest_ip}}, @{N='Dest_Port';E={$_.dest_port}}, @{N='SNI';E={$_.tls.sni}} | Format-Table -AutoSize
Shows the full details of one alert in JSON format, including the signature ID, category and severity. In the command, change { $_.Line -like '*Telegram*' } to your own keyword to check a different alert. -First 1 picks the first (oldest) match. Change the number to see more entries, for example -First 3 shows the first three. Use -Last 1 to see the newest match instead. Use this when the table doesn’t give enough detail to judge the alert.
Open full screenshot → (opens in a new tab)
Get-Content "D:\Program Files\Suricata\log\eve.json" | Select-String '"event_type":"alert"' | Where-Object { $_.Line -like '*Telegram*' } | Select-Object -First 1 | ForEach-Object { $_.Line | ConvertFrom-Json | ConvertTo-Json -Depth 6 }