detect: factorize code for DetectSetupDirection#13123
Closed
catenacyber wants to merge 1 commit intoOISF:masterfrom
Closed
detect: factorize code for DetectSetupDirection#13123catenacyber wants to merge 1 commit intoOISF:masterfrom
catenacyber wants to merge 1 commit intoOISF:masterfrom
Conversation
Ticket: 7665 Instead of each keyword calling DetectSetupDirection, use a new flag SIGMATCH_SUPPORT_DIR so that DetectSetupDirection gets called, before parsing the rest of the keyword. Allows to support filesize keyword in transactional signatures
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13123 +/- ##
=======================================
Coverage 83.04% 83.04%
=======================================
Files 987 987
Lines 271868 271938 +70
=======================================
+ Hits 225764 225835 +71
+ Misses 46104 46103 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
WARNING:
Pipeline 25945 |
victorjulien
approved these changes
May 7, 2025
Merged
Member
|
Merged in #13179, thanks! |
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.
Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/7665
Describe changes:
This means adding facility to allow non-sticky buffer keywords
DetectSetupDirectioncall site toSigParseOptionsinstead of in each keyword and use a new flagSIGMATCH_SUPPORT_DIRDetectSetupDirectionnow takes a pointer to a string, and may move the string forward to allowfilesize: to_client, >100;so thatDetectFilesizeSetupgets called with ">100"SigMatchAppendSMToListnow setsonly_tcandonly_tsasDetectBufferSetActiveListalready does(3 commits may be better but debugging, I ended up squashing everything)
Now making transactional rules support other direction-ambiguous keywords should be one-liner like adding
SIGMATCH_SUPPORT_DIRtosigmatch_table[DETECT_KEYWORD].flagsSV_BRANCH=OISF/suricata-verify#2453
#13120 with cast like
str = (char *)"to_client_toto";in unit tests to fix compile without warnings