-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matching: multi match support #331
base: master
Are you sure you want to change the base?
matching: multi match support #331
Conversation
This adds support to specify multiple conditions to match a rule. Syntax: multi:<match_condition1>;<match_condition2>;...<match_conditionN>; Examples: Match all rules including the term "nmap" but just from the "emerging-scan.rules" file. multi:filename:rule/emerging-scan.rules; re:nmap; Match all rules with a recent cve reference and a perimeter deployment multi:re:cve-202[23];metadata: deployment perimeter; Ticket: #2509
Sorry for taking so long to get to this. One issue I have is not all valid regex's are supported. For example:
works... but:
appears to work, but actually fails to properly load as it will only take up to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. My quick idea would be to use a [TAB] as a delimiter. A good regex would use Certainly its a good idea to throw some warning or error if a child matcher is not a valid one. I think that would happen with with your example. |
Yeah, I'm not sure either. It was not created with more parameters on a line than one in mind... Proper quoting could work, but also a breaking change as we don't currently require quoting now. |
After some thoughts i would suggest to use So your example combined with some other matchers would look something like this.
Why i like this solution:
If that's an acceptable solution i would go ahead and implement it. |
Make sure these boxes are signed before submitting your Pull Request
-- thank you.
https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Contributing
contribution agreement at
https://suricata-ids.org/about/contribution-agreement/
changes made (if applicable)
This is an implementation of redmine 2509
Describe changes:
This is a resubmit of pr #37. After reworking to fit the 2023 code base.
It adds support to specify multiple conditions to match a rule.
Syntax:
multi:<match_condition1>;<match_condition2>;...<match_conditionN>;
Examples:
Match all rules including the term "nmap" but just from the "emerging-scan.rules" file.
multi:filename:rule/emerging-scan.rules; re:nmap;
Match all rules with a recent cve reference and a perimeter deployment
multi:re:cve-202[23];metadata: deployment perimeter;