-
-
Notifications
You must be signed in to change notification settings - Fork 264
Fixed mandatory check of rule ID. #1325
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
base: main
Are you sure you want to change the base?
Fixed mandatory check of rule ID. #1325
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1325 +/- ##
==========================================
+ Coverage 81.94% 81.98% +0.03%
==========================================
Files 170 170
Lines 9777 9781 +4
==========================================
+ Hits 8012 8019 +7
+ Misses 1518 1516 -2
+ Partials 247 246 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
if err != nil { | ||
t.Error(err) | ||
} | ||
err = p.FromString(`SecRule &REQUEST_COOKIES_NAMES:'/.*/'|ARGS:/a|b/ "id:4"`) | ||
err = p.FromString(`SecRule &REQUEST_COOKIES_NAMES:'/.*/'|ARGS:/a|b/ "" "id:4"`) |
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.
curious why this empty string is needed.
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.
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.
A side note: we already started a discussion about this implicit @rx
operator's role, see ModSecurity issue #3081. Feel free to leave a comment.
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.
Thanks for this!
Addressed review comments. Co-authored-by: Matteo Pace <[email protected]>
Let question from my side: here we are enforcing a check that, as per the documentation, has always been expected to work this way. However, it would be a breaking change for those not compliant with the documentation. Should we add a build flag to enable this check, or can we mention it in the release notes and require users to fix non-compliant rules when upgrading the minor version? @corazawaf/maintainers |
I would go for the build tag otherwise it can be a breaking change. |
Fixed strict check: The id action is required for all SecRule/SecAction.
Make sure that you've checked the boxes below before you submit PR:
Thanks for your contribution ❤️