feat: Suricata EVE JSON output for the IDS#394
Open
pigri wants to merge 3 commits into
Open
Conversation
Add an opt-in Suricata-compatible EVE JSON sink (logging.eve_log: enabled/file/event_types). Producers publish non-blocking onto a broadcast; a single async subscriber owns the writer and flushes on an interval (lossy/lagged-counted), so a slow sink never stalls the IDS hot path. Disabled by default; stdout/stderr/file sinks. Emits the common EVE envelope (timestamp, flow_id, src/dest, proto, app_proto) plus typed alert/http/stats objects; placeholder loopback/unspecified endpoints are omitted. Wired up at app boot alongside the other inspect-channel sinks.
Map thalamus alerts to EVE alert records (with JA4+ fingerprints and, on the L7 path, the triggering HTTP transaction embedded) across the XDP, AF_PACKET and L7-ingest paths. Emit a standalone EVE http record per decrypted transaction, and a periodic EVE stats record from the stats loop. All gated on the sink being enabled so the disabled path is free.
Carry the downstream server address into the post-TLS HttpTxn so the IDS sees a real destination instead of a loopback stand-in: dest_ip uses the node host IP (SYNAPSE_NODE_IP downward-API env) with the local socket as fallback, dest_port is the real listener port. Synthesize a Host header from the HTTP/2 :authority pseudo-header when absent so http.host rules, JA4H, and the hostname field are populated on h2 traffic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds opt-in Suricata-compatible EVE JSON output for the IDS.
What
synapse-core— a non-blocking EVE JSON sink (logging.eve_log:enabled/file/event_types). Producers publish onto a broadcast; one async subscriber owns the writer and flushes on an interval, so a slow sink drops (lagged-counted) rather than stalling the inspect path.stdout/stderr/file sinks; disabled by default.synapse-idp— map alerts to EVEalertrecords (with the JA4+ suite, and the triggering HTTP transaction embedded on the L7 path) across the XDP, AF_PACKET and L7-ingest paths; emit standalonehttprecords per decrypted transaction and a periodicstatsrecord.synapse-proxy— carry the downstream server address into the post-TLSHttpTxnso the IDS sees a real destination (node host IP viaSYNAPSE_NODE_IP, local-socket fallback) instead of a loopback stand-in; synthesize aHostheader from the HTTP/2:authoritysohttp.hostrules / JA4H / thehostnamefield populate on h2.Records use Suricata field spellings (
dest_ip/dest_port), ISO8601-µs timestamps,action: allowed|blocked, and carry the JA4+ suite. Placeholder loopback/unspecified endpoints are omitted.Tests
fmt+clippy --deny warnings+cargo check --workspacegreen; unit tests for the serializer shape, placeholder omission, and config parsing.