Skip to content

add exception_policy field to netflow eve records#15342

Closed
ssam18 wants to merge 1 commit intoOISF:mainfrom
ssam18:netflow-exception-policy
Closed

add exception_policy field to netflow eve records#15342
ssam18 wants to merge 1 commit intoOISF:mainfrom
ssam18:netflow-exception-policy

Conversation

@ssam18
Copy link
Copy Markdown

@ssam18 ssam18 commented May 8, 2026

Issue #8499 reports that exception_policy shows up under flow events but not under netflow events, even when the same flow triggers a midstream drop. Both loggers consume the same applied_exception_policy state on the flow object, but the helper that formats the array was static to the flow logger so the netflow logger had no way to emit it. This change drops the static qualifier and declares the helper in output-json-flow.h, then calls it from both netflow records so the field shows up in toserver and toclient events. I also updated etc/schema.json to document the new field and verified the fix end to end with a midstream pcap and drop-flow stream policy.

The flow logger has carried an exception_policy array since policies were added, but the netflow logger never read the same per flow attribute. As a result users could not see which exception triggered or what action was applied when looking at netflow events. We expose the helper that the flow logger already uses and call it from both the toserver and toclient netflow records so the two event types stay aligned.
@ssam18 ssam18 requested review from a team and victorjulien as code owners May 8, 2026 20:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

NOTE: This PR may contain new authors.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.64%. Comparing base (8968b1c) to head (5d111a8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15342      +/-   ##
==========================================
- Coverage   82.66%   82.64%   -0.03%     
==========================================
  Files         995      995              
  Lines      271046   271054       +8     
==========================================
- Hits       224069   224014      -55     
- Misses      46977    47040      +63     
Flag Coverage Δ
fuzzcorpus 61.05% <100.00%> (-0.01%) ⬇️
livemode 18.37% <0.00%> (-0.02%) ⬇️
netns 22.60% <0.00%> (-0.03%) ⬇️
pcap 45.23% <0.00%> (+<0.01%) ⬆️
suricata-verify 66.37% <100.00%> (-0.03%) ⬇️
unittests 58.57% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@victorjulien victorjulien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this.

However, please make sure to follow our contribution guidelines:
https://docs.suricata.io/en/latest/devguide/contributing/index.html

@ssam18
Copy link
Copy Markdown
Author

ssam18 commented May 9, 2026

Superseded by #15349 which addresses the contribution guideline feedback (subsystem prefixed commit, ticket reference, separate docs commit, branch v2). The verify side test is in OISF/suricata-verify#3075.

@ssam18 ssam18 closed this May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants