Skip to content

detect: factorize code for DetectSetupDirection (transactional rules)#13045

Closed
catenacyber wants to merge 2 commits intoOISF:masterfrom
catenacyber:detect-txal-filesize-7665-v1
Closed

detect: factorize code for DetectSetupDirection (transactional rules)#13045
catenacyber wants to merge 2 commits intoOISF:masterfrom
catenacyber:detect-txal-filesize-7665-v1

Conversation

@catenacyber
Copy link
Contributor

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

Describe changes:

  • detect: transactional rules allow filesize keyword

This means adding facility to allow non-sticky buffer keywords

  • Moving DetectSetupDirection call site to SigParseOptions instead of in each keyword and use a new flag SIGMATCH_SUPPORT_DIR
  • DetectSetupDirection now takes a pointer to a string, and may move the string forward to allow filesize: to_client, >100; so that DetectFilesizeSetup gets called with ">100"
  • SigMatchAppendSMToList now sets only_tc and only_ts as DetectBufferSetActiveList already 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_DIR to sigmatch_table[DETECT_KEYWORD].flags

SV_BRANCH=OISF/suricata-verify#2453

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
@catenacyber catenacyber changed the title detect: factorize code for DetectSetupDirection detect: factorize code for DetectSetupDirection (transactional rules) Apr 18, 2025
@catenacyber catenacyber marked this pull request as draft April 18, 2025 16:15
@catenacyber
Copy link
Contributor Author

Clean in #13046

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.

1 participant