-
Notifications
You must be signed in to change notification settings - Fork 282
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
SecRuleScript in chain rules #213
Comments
So after some more research, there is this answer by @spartantri at https://security.stackexchange.com/questions/191164/cookie-operations-using-modsecurity-rules where it is mentioned that perhaps SecRuleScript cannot be part of chain rules? If that is the case, then this issue can be closed. Thanks |
Hi @void-in , At least in v2.9.x, that functionality worked as per your expectation in your original posting. What you are reporting in v3 may be the result of a bug having crept in. I'll follow up. In the meantime you could consider the option suggested in that link that you found. Another option could be to use the first rule in your chain as you have it and then use the exec action to execute your lua script. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Hi, so I want to execute
SecRuleScript
as part of a chain rule but the script executes independent of the other rules.Inside vhost of domain mydomain.com, I have the following:
As you can see, I am deliberately comparing mydomain.com to myotherdomain.com through the @Streq operation and it is failing as can be seen in the corresponding audit logs:
But still the lua script at /tmp/test.lua is executing. Also, since the SecRuleScript is part of a chain rule, we shouldn't be giving any action to the SecRuleScript but if no action is specified, it generates a syntax error.
Just wanted to confirm are we not able to execute SecRuleScript as part of chain rules? The slides at https://www.slideshare.net/RobertRowley/teaching-your-waf-new-tricks although quite dated but it suggests that SecRuleScript can be run as part of a chain rule.
It would be great if we can run SecRuleScript in chain rules since implementing ipMatchFromFile with CIDR format IPs is a pain to implement in plain lua.
Version Info
libmodsecurity and modsecurity-nginx both have been checked out from the repo two days earlier so I believe both are latest master branches.
Thank you very much.
The text was updated successfully, but these errors were encountered: