-
-
Notifications
You must be signed in to change notification settings - Fork 404
feat: 933151 change from capture and double pmf
to regex
#4139
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
Conversation
📊 Quantitative test results for language: |
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.
The length of the regular expression is probably going to be an issue. At least in ModSecurity v2 on httpd the length of the rule is restricted. This is why we had to split the RCE rules into < 4 character words, >=4 character words, plus generic detection.
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
@theseion thanks for the suggestion to the regex assembly, much cleaner than what i wrote. In regards to the regex length issue, would it not be better to instead dynamically generate multiple rules based off the single rule and regex assembly? e.g. for 933151, split the include file into e.g. 4 parts, and then duplicate the rule (and increment the id). That way we arent "compromising" the core rule logic for all consumers due to a limitation in one place. |
Maybe. Generating rules is on our roadmap but we currently don't generate entire rules, only regular expressions. What about performance? Would three rules instead of one not completely eat up the performance gain of this PR? If not, I suggest you split |
I did some testing and splitting out the rule into 3 rules does indeed eat into the performance gains.
|
Looks like a nice but for now complex addition to crs-toolchain :) Also, dynamically generating X amount of rules seems dangerous if the IDs change 🤔 But I like the ideas here. Let's figure this out. |
Understood. I will create a separate issue to track this, and in the meantime follow with @theseion's suggestion about manually splitting the regex for now. |
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
@theseion all done, thanks for the suggestion. |
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
@TimDiam0nd there are still a couple of unresolved comments. |
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Should be done now i think |
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Thanks @TimDiam0nd. |
same as #4138, except a different rule id.