Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect multiprotocol keywords 7304 v1 #12149

Conversation

catenacyber
Copy link
Contributor

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

Describe changes:

  • cleaner code for multi app-layer keywords such as ja4

Is there something to do with DCERPC/SMB stuff ?

I think file keywords have their own logic and it is ok.

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 52.17391% with 55 lines in your changes missing coverage. Please review.

Project coverage is 49.84%. Comparing base (bd7d38e) to head (7f018f5).
Report is 33 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12149      +/-   ##
==========================================
+ Coverage   49.81%   49.84%   +0.03%     
==========================================
  Files         909      909              
  Lines      257904   258003      +99     
==========================================
+ Hits       128467   128610     +143     
+ Misses     129437   129393      -44     
Flag Coverage Δ
fuzzcorpus 61.00% <81.08%> (+0.05%) ⬆️
livemode 19.42% <1.35%> (-0.01%) ⬇️
pcap 44.41% <18.91%> (+<0.01%) ⬆️
suricata-verify 62.73% <27.02%> (-0.02%) ⬇️
unittests 8.98% <0.00%> (-0.01%) ⬇️

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

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 23517

instead of hardcoding list

Ticket: 7304
@catenacyber catenacyber force-pushed the detect-multiprotocol-keywords-7304-v1 branch from db18fe8 to 7f018f5 Compare November 27, 2024 20:58
"ja4.hash; content: \"q13d0310h3_55b375c5d22e_cd85d2d88918\";)");
// just ja4.hash any proto
FAIL_IF_NULL(s);
s = SigInit(de_ctx, "alert quic any any -> any any (sid: 1; "
Copy link
Member

Choose a reason for hiding this comment

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

this adds another sid:1, is that not rejected as a duplicate? Or do we only check later? Might be good to use unique id's for all sigs, but esp for the good ones

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only do SigInit to check parsing result ;-)
We should free the valid ones I guess...

@victorjulien
Copy link
Member

I'm missing a lot of explanation on the new logic.

@catenacyber
Copy link
Contributor Author

I'm missing a lot of explanation on the new logic.

Motivation is to have a cleaner support for multi-protocol keywords such as JA3 both on QUIC and TLS.
We do not want hardcoding, ie we do not to see ALPROTO_QUIC constant directly used in generic src/detect-parse.c

From the keyword point of view, I propose to add DetectSignatureSetMultiAppProto that is like DetectSignatureSetAppProto but takes multiple alprotos, but behaves in the same way, doing intersection and rejecting a signature early if there is a app-layer incompatibility...

From the data structure, I propose to add a fixed-length array in SignatureInitData, as the use case is a sparse number of protocols, not taking half of the 32 protocols we support...

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 23609

@catenacyber
Copy link
Contributor Author

Next in #12229

@catenacyber catenacyber closed this Dec 5, 2024
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.

3 participants