-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
[Sigma Filters] Introducing Sigma Filters (Sigma Defeats) in Alpha / Development Preview #226
Conversation
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.
Why not add a generic SigmaGlobalFilterError Class like the SigmaCollectionError
?
Co-authored-by: frack113 <[email protected]>
Co-authored-by: frack113 <[email protected]>
@thomaspatzke let me know if there's any changes and if this is all good on your end |
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.
Very cool! Please check my comments.
Resolved all I can, should be 2 left to respond to |
Oops, I clicked on resolve all by accident. I unresolved two but unsure. Please check if these were the right ones. |
Context
This is a PR to introduce Sigma Filters into pySigma. This is the outcome of the discussions that occurred back in Dec 2022 here. SigmaHQ/sigma-specification#35
Explanation
The current implementation of Filters is as per the Sigma Specifications.
Updates / Changes
This PR extends
SigmaFilter
fromSigmaRuleBase
, and is compatible with loading intoSigmaCollection
.apply_on_rule
is the main focus of the change which applies the filter upon a given rule's condition tree.pySigma/sigma/filters.py
Lines 166 to 189 in e230618
The other major change is to
collection.py
, which applies a reduce function on the rules attribute,– if there are filters – otherwise leaves the rules untouched.pySigma/sigma/collection.py
Lines 45 to 70 in e230618
Edge Cases
I'm not 100% solid on logsource + rule
IDs
being the only way Filters should apply, but certainly a warning should be shown in the following scenarios:Filtering In vs Filtering Out
In design, I currently implemented filtering-in by default (
AND
) and not filtering-out (NOT
) as thecondition
field should really be used for this. imho this is the expected approach to filtering when using these files first hand.Checklist