detect: add checks for count keyword - #2634
Closed
catenacyber wants to merge 1 commit into
Closed
Conversation
catenacyber
commented
Sep 8, 2025
catenacyber
force-pushed
the
detect-count-5044-v1
branch
2 times, most recently
from
September 25, 2025 08:52
f29d92e to
23dcf37
Compare
catenacyber
marked this pull request as ready for review
September 25, 2025 08:52
catenacyber
force-pushed
the
detect-count-5044-v1
branch
from
September 25, 2025 13:22
23dcf37 to
cd10e4a
Compare
catenacyber
force-pushed
the
detect-count-5044-v1
branch
from
November 6, 2025 14:48
cd10e4a to
3c474ac
Compare
catenacyber
force-pushed
the
detect-count-5044-v1
branch
from
November 6, 2025 15:21
3c474ac to
42bb868
Compare
catenacyber
force-pushed
the
detect-count-5044-v1
branch
from
November 18, 2025 13:19
42bb868 to
f256cce
Compare
This was referenced Nov 18, 2025
Ticket: 5044
catenacyber
force-pushed
the
detect-count-5044-v1
branch
from
March 25, 2026 16:46
f256cce to
b624063
Compare
| # Match | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: all; content:"from"; sid: 30;) | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: all_or_absent; content:"from"; sid: 31;) | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: nb 2; content:"relay1"; sid: 32;) |
Member
There was a problem hiding this comment.
specifies the number of expected matches of the content match following it
Member
There was a problem hiding this comment.
email.received: count 5; email.received: nb >2; content:"bad juju";
email.received: count 5; email.received: nb >=2; content:"bad juju";
email.received: count 5; email.received: match >=2; content:"bad juju"; # < match would replace `nb`
email.received: index 2; content:!"bad juju"; # < would like to see additionally support for explicit `index`
Collaborator
Author
There was a problem hiding this comment.
match or matches ?
| alert smtp any any -> any any (msg:"Test mime email received count <3"; email.received: count <3; sid:21;) | ||
|
|
||
| # Match | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: all; content:"from"; sid: 30;) |
Member
There was a problem hiding this comment.
does this work with count as well?
Collaborator
Author
There was a problem hiding this comment.
leaving count out for now
| # Match | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: all; content:"from"; sid: 30;) | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: all_or_absent; content:"from"; sid: 31;) | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: nb 2; content:"relay1"; sid: 32;) |
Member
There was a problem hiding this comment.
specifies the number of expected matches of the content match following it
| # Match | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: all; content:"from"; sid: 30;) | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: all_or_absent; content:"from"; sid: 31;) | ||
| alert smtp any any -> any any (msg:"Test mime email received"; email.received: nb 2; content:"relay1"; sid: 32;) |
Member
There was a problem hiding this comment.
email.received: count 5; email.received: nb >2; content:"bad juju";
email.received: count 5; email.received: nb >=2; content:"bad juju";
email.received: count 5; email.received: match >=2; content:"bad juju"; # < match would replace `nb`
email.received: index 2; content:!"bad juju"; # < would like to see additionally support for explicit `index`
Collaborator
Author
|
Replaced by #3062 |
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.
Ticket
Redmine ticket: https://redmine.openinfosecfoundation.org/issues/5044
Draft : CI will be too red : need a new test with min-version instead of changing an existing test
But, saving work and getting feedback