Skip to content

Detect count 5044 v4.1 - #15299

Closed
catenacyber wants to merge 5 commits into
OISF:mainfrom
catenacyber:detect-count-5044-v4.1
Closed

Detect count 5044 v4.1#15299
catenacyber wants to merge 5 commits into
OISF:mainfrom
catenacyber:detect-count-5044-v4.1

Conversation

@catenacyber

Copy link
Copy Markdown
Contributor

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

Describe changes:

  • adds other modes to multi-buffers like all, all_or_absent, matches`, and precise indexing

SV_BRANCH=OISF/suricata-verify#3062

Draft : I would like some approval before doing all the individual modifications for each multi-buffer

#15100 next without count but

  • more syntax sugar
  • validation callback to forbid rules like buffer: all; sid: 1 without content for buffer
  • new tests (and fixed typo s/==NULL/!=NULL/ that led to uaf)
  • documentation

TODOs :

  • add support for all multi-buf keywords
  • add count support

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
- nb
- precise index
- all

Ticket: 5044
- or_absent can also be any_or_absent
- nb can also be matches
- precise index can have prefix index
============= ===========================================================
Value Description
============= ===========================================================
[default] Match with any 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.

suggest adding something like

(same as `index <value>`)

============= ===========================================================
[default] Match with any index
any Match with any index
or_absent Match with any index or matches on an empty list

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.

should this be any_or_absent for clarity?

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.

ok (both work in the code)

@catenacyber

Copy link
Copy Markdown
Contributor Author

Replaced by #15302

@catenacyber catenacyber closed this May 1, 2026
@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.26267% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.64%. Comparing base (18f742f) to head (0f5a452).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15299      +/-   ##
==========================================
- Coverage   82.65%   82.64%   -0.02%     
==========================================
  Files         993      994       +1     
  Lines      270997   271185     +188     
==========================================
+ Hits       223985   224111     +126     
- Misses      47012    47074      +62     
Flag Coverage Δ
fuzzcorpus 61.00% <25.48%> (-0.05%) ⬇️
livemode 18.35% <6.73%> (-0.03%) ⬇️
netns 22.60% <6.73%> (-0.04%) ⬇️
pcap 45.16% <12.50%> (-0.10%) ⬇️
suricata-verify 66.39% <78.36%> (+<0.01%) ⬆️
unittests 58.55% <22.58%> (-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.

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.

2 participants