Skip to content

App proto logging#13810

Closed
regit wants to merge 2 commits intoOISF:mainfrom
regit:app_proto_logging
Closed

App proto logging#13810
regit wants to merge 2 commits intoOISF:mainfrom
regit:app_proto_logging

Conversation

@regit
Copy link
Contributor

@regit regit commented Sep 8, 2025

There was a regression between Suricata 7 and Suricata 8. The app_proto was logged in almost all events in 7 and is only log in a small subset (fileinfo, flow, frame, netflow) in 8.

This patch updates the code to log app_proto in all events if there is a Flow available. It is making use of EveAddAppProto function to get interesting information such as original application protocol or difference between server and client side.

Contribution style:

Our Contribution agreements:

Changes (if applicable):

Link to ticket: https://redmine.openinfosecfoundation.org/issues/

Describe changes:

  • log app_proto when creating EVE header

SV_BRANCH=OISF/suricata-verify#2640

@regit regit requested a review from victorjulien as a code owner September 8, 2025 07:00
Moving it to be able to use it globally later.

Ticket: OISF#7888
There was a regression between Suricata 7 and Suricata 8. The
app_proto was logged in almost all events in 7 and is only log
in a small subset (fileinfo, flow, frame, netflow) in 8.

This patch updates the code to log app_proto in all events if
there is a Flow available. It is making use of EveAddAppProto
function to get interesting information such as original
application protocol or difference between server and client
side.

Ticket: OISF#7888
@regit regit force-pushed the app_proto_logging branch from 50f2e65 to 32634bd Compare September 8, 2025 07:30
@codecov
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.72%. Comparing base (0662736) to head (32634bd).
⚠️ Report is 715 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13810   +/-   ##
=======================================
  Coverage   83.71%   83.72%           
=======================================
  Files        1011     1011           
  Lines      275116   275115    -1     
=======================================
+ Hits       230321   230330    +9     
+ Misses      44795    44785   -10     
Flag Coverage Δ
fuzzcorpus 63.02% <100.00%> (+0.02%) ⬆️
livemode 19.00% <53.33%> (+<0.01%) ⬆️
pcap 44.69% <86.66%> (+<0.01%) ⬆️
suricata-verify 65.09% <100.00%> (+<0.01%) ⬆️
unittests 59.16% <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.

@victorjulien
Copy link
Member

Would be nice to get a Fixes tag for this, do we know which commit(s) broke it?

@regit
Copy link
Contributor Author

regit commented Sep 8, 2025

Would be nice to get a Fixes tag for this, do we know which commit(s) broke it?

I did not investigate. I'll try to get that.

@regit
Copy link
Contributor Author

regit commented Sep 8, 2025

Would be nice to get a Fixes tag for this, do we know which commit(s) broke it?

I did not investigate. I'll try to get that.

OUTCH, really sorry, this is not a regression. I forgot one patch was bringing that to the 7.0.x branch I did test. So this issue becomes a feature request. I'm updating redmine.

@catenacyber
Copy link
Contributor

Copy link
Contributor

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

So, the commit message needs to be changed :-p

There was a regression between Suricata 7 and Suricata 8.

Otherwise, code and tests look good...

I wonder if this should be optional (as logs become more verbose)
I guess this deserves an upgrade note

@jufajardini
Copy link
Contributor

jufajardini commented Sep 19, 2025

So, the commit message needs to be changed :-p

There was a regression between Suricata 7 and Suricata 8.

Otherwise, code and tests look good...

I wonder if this should be optional (as logs become more verbose) I guess this deserves an upgrade note

I agree on this becoming optional. But could there maybe be a shorter version, instead of all or nothing? (Not fully sure if such a thing would make sense 🤔 )

@catenacyber
Copy link
Contributor

@regit will you come back to this ?

@regit
Copy link
Contributor Author

regit commented Feb 3, 2026

@regit will you come back to this ?

Hello, yes. I will work on it this week.

@regit
Copy link
Contributor Author

regit commented Feb 3, 2026

So, the commit message needs to be changed :-p

There was a regression between Suricata 7 and Suricata 8.

Otherwise, code and tests look good...
I wonder if this should be optional (as logs become more verbose) I guess this deserves an upgrade note

I agree on this becoming optional. But could there maybe be a shorter version, instead of all or nothing? (Not fully sure if such a thing would make sense 🤔 )

I'm not feeling like adding a new option for that. Should we introduce a version in EVE configuration section so we can preserve backward compatibility by reading that in the YAML and only setting up the log if version is above the chosen value ?

@catenacyber catenacyber added the decision-required Waiting on deliberation from the team label Feb 3, 2026
@regit
Copy link
Contributor Author

regit commented Feb 3, 2026

So, the commit message needs to be changed :-p

There was a regression between Suricata 7 and Suricata 8.

Otherwise, code and tests look good...
I wonder if this should be optional (as logs become more verbose) I guess this deserves an upgrade note

I agree on this becoming optional. But could there maybe be a shorter version, instead of all or nothing? (Not fully sure if such a thing would make sense 🤔 )

I'm not feeling like adding a new option for that. Should we introduce a version in EVE configuration section so we can preserve backward compatibility by reading that in the YAML and only setting up the log if version is above the chosen value ?

I've pushed an implementation of this concept there: https://github.com/regit/suricata/tree/app_proto_logging-v2

@catenacyber
Copy link
Contributor

So, should you open a draft PR with this v2 branch ? Or ?

@regit
Copy link
Contributor Author

regit commented Feb 6, 2026

So, should you open a draft PR with this v2 branch ? Or ?

Yes, just wanted to get some feedback on it first but here is the PR: #14760

@regit regit closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

decision-required Waiting on deliberation from the team

Development

Successfully merging this pull request may close these issues.

4 participants