detect: factorize code for DetectSetupDirection#13120
Closed
catenacyber wants to merge 1 commit intoOISF:masterfrom
Closed
detect: factorize code for DetectSetupDirection#13120catenacyber 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 #13120 +/- ##
==========================================
+ Coverage 82.94% 83.01% +0.07%
==========================================
Files 988 988
Lines 271931 272001 +70
==========================================
+ Hits 225546 225810 +264
+ Misses 46385 46191 -194
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
33bb76e to
e8d46b5
Compare
|
Information: QA ran without warnings. Pipeline 25941 |
Contributor
Author
|
Next in #13123 |
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
#13046 with needed rebase and unit tests for
DetectSetupDirectionand better behavior