OPNsense Forum

English Forums => Intrusion Detection and Prevention => Topic started by: TrevTron on December 03, 2026, 08:30:41 PM

Title: Correlating OPNsense/Suricata alerts with client outcomes (model-free SQLite vie
Post by: TrevTron on December 03, 2026, 08:30:41 PM
Hi all,

Back in October I wrote up a first build testing inline Suricata on a Protectli Vault V1610 they sent over (OPNsense 26.7.5-amd64, Suricata 8.0.7_1). Since then I built out the log collection side on a wired Windows review unit (64 GB Minisforum MS-S1 MAX) and spent a few weeks testing a specific question: how much of OPNsense/Suricata alert triage can a local LLM actually handle reliably? All testing and opinions are my own. And the results are mixed.

The biggest lesson personally had nothing to do with AI

During an early timed self-test, I misread my own logs. I saw an allowed STUN alert and assumed the connection succeeded without checking the Windows client. In IPS mode, an allowed Suricata alert only tells you how one rule treated a packet. Multiple rules can fire on the same packet (for example, an alert rule can log "allowed" even when a separate drop rule drops the packet), so you still want the EVE packet verdict if enabled. Confirming the application actually connected requires matching the client-side record across the 5-tuple and timestamp window (6 fields), plus an attempt ID when running controlled multi-attempt test fixtures.

To test those edge cases without any AI in the loop, I put together two short local exercises:

What runs completely model-free for day-to-day review

What the local AI benchmarks actually showed me

I benchmarked several base models (Qwen3 4B, Qwen3.5 4B, Qwen3.5 9B, Gemma 4 12B QAT, and Ling-3.0-tiny) on receipt matching and next-check selection, then fine-tuned Qwen3.5 4B with QLoRA on Windows ROCm for raw flow triage:

Where I landed is straightforward: deterministic Python handles grouping, exact record matching, and hash-verified links. Base Qwen3.5 4B stays strictly optional for scheduled summaries where Python supplies the verified facts.

Repo and full write-ups

For anyone running Suricata inline on OPNsense at home or in a small lab: when an unfamiliar allowed alert shows up, what are you checking or retaining on the endpoint side to verify whether the connection actually succeeded and which process opened it?
Title: Re: Correlating OPNsense/Suricata alerts with client outcomes (model-free SQLite vie
Post by: BoNetTech on December 03, 2026, 09:06:52 PM
Hi TrevTron,

nice write-up. I haven't tested your tools, so this is only general practice for your question.

On the firewall side, besides the alert I would keep the EVE "flow" records for the same 5-tuple: bytes and packets in both directions tell you if anything came back. For UDP like STUN there is no handshake, so reply bytes are the only evidence.

On the endpoint side, to see which process opened a connection I would use Sysmon event ID 3 (network connection: process, user, destination) or the Windows Filtering Platform audit events, together with the DNS client log to see which name was resolved. On Linux, auditd or osquery do the same. Keeping those logs with a timestamp lets you join them to the alert.

Sergio
Title: Re: Correlating OPNsense/Suricata alerts with client outcomes (model-free SQLite vie
Post by: TrevTron on December 03, 2026, 09:14:56 PM
Hi Sergio, I appreciate the breakdown, especially with this being my first post here.

That makes a lot of sense on both sides. Right now my collector saves the raw syslog verbatim, but only indexes event_type "alert" into SQLite. Pulling in EVE "flow" records (joining on flow_id and the 5-tuple) is a great call for seeing whether stateless UDP like STUN actually got reply bytes back.

Pairing Sysmon Event ID 3 with the Windows DNS client log is right at the top of my list for the next phase. Having exact timestamp, 5-tuple, process, user, and resolved domain fields lets Python join everything deterministically back to the Suricata alert instead of guessing from headers or reverse lookups.

Quick question if you have run EVE flow logging on smaller OPNsense boxes: do you forward all flow records off the firewall over syslog, or filter/keep them local so they do not flood storage?

Thanks again,
Trevor