Skip to content

Detect count 5044 v3.4 - #15100

Closed
catenacyber wants to merge 4 commits into
OISF:mainfrom
catenacyber:detect-count-5044-v3.4
Closed

Detect count 5044 v3.4#15100
catenacyber wants to merge 4 commits into
OISF:mainfrom
catenacyber:detect-count-5044-v3.4

Conversation

@catenacyber

Copy link
Copy Markdown
Contributor

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

Describe changes:

  • adds a count option to multi-buffers, behaving like a keyword but syntax is email.received: count <3;
  • adds other modes to multi-buffers like all, all_or_absent, nb`, and precise indexing

SV_BRANCH=OISF/suricata-verify#2634

Draft :

  • Feedback about general design ?

#14346 needed rebase

TODOs :

  • update doc if design is agreed
  • add support for all multi-buf keywords
  • add more tests

Also rename parse_uint_count as parse_multi_count

This allows to prepare multi-buffers using this code
As for multi-integers, multi-buffers can now have the following
arguments
- count
- nb
- precise index
- all

Ticket: 5044
@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.16996% with 78 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.59%. Comparing base (dce2dee) to head (aa3d2c2).
⚠️ Report is 119 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15100      +/-   ##
==========================================
- Coverage   82.63%   82.59%   -0.04%     
==========================================
  Files         990      991       +1     
  Lines      271599   271824     +225     
==========================================
+ Hits       224429   224523      +94     
- Misses      47170    47301     +131     
Flag Coverage Δ
fuzzcorpus 61.00% <20.90%> (-0.07%) ⬇️
livemode 18.34% <5.32%> (-0.05%) ⬇️
netns 18.34% <4.50%> (-0.06%) ⬇️
pcap 45.20% <10.24%> (-0.09%) ⬇️
suricata-verify 66.13% <68.03%> (-0.05%) ⬇️
unittests 58.81% <18.18%> (-0.04%) ⬇️

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.

@suricata-qa

Copy link
Copy Markdown

Information: QA ran without warnings.

Pipeline = 30537

Comment thread rust/src/detect/uint.rs
"all" => Some(DetectUintIndex::All),
"all_or_absent" => Some(DetectUintIndex::AllOrAbsent),
"any" => Some(DetectUintIndex::Any),
"absent_or" => Some(DetectUintIndex::OrAbsent),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

means any or absent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added any_or_absent syntax sugar

Comment thread src/detect-email.c
return false;
}

if (idx == DETECT_COUNT_INDEX) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

as discussed in Salzburg, we want a form of a GetBufferCount callback instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, leaving that out to already get an approval for the rest

@catenacyber

Copy link
Copy Markdown
Contributor Author

Replaced by #15299

@catenacyber catenacyber closed this May 1, 2026
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