-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Optionally nocanon #1031
Optionally nocanon #1031
Conversation
@@ -2513,6 +2513,11 @@ static void msre_perform_disruptive_actions(modsec_rec *msr, msre_rule *rule, | |||
} | |||
} | |||
} | |||
if (actionset->intercept_action_rec->metadata->type == ACTION_DISRUPTIVE) { |
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.
"proxy-nocanon" should be checked here, right?
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.
I don't think so...? Here's my understanding:
The loop before this line looks through all the actions in actionset->actions
and run the execute callback for each. For some reason, though, it doesn't seem like the actionset->intercept_action_rec
is part of the list in actionset->actions
-- so I added a few lines to check whether actionset->intercept_action_rec
is an intercept action, and if so to run the execute callback for it.
In other words, this particular change doesn't have anything to do with no/canon behavior. It just allows the "execute" callback of the modsec's glue into mod-proxy to run, allowing mod-proxy to do some setup work - in my particular case it allows mod-proxy to expand macros in preparation for the proxy request.
That's my understanding, anyway!
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.
I've got your point. You are right.
Hi @mariodsantana, Thank you for the patch. I made some comments inline in the code. |
Hello and a Happy New Year! Am running NGINX 1.9.9 with the nginx_refactored branch in a proxy configuration. For some reason, most probably configuration, the following rule never appears to get applied: SecRule REMOTE_ADDR "@pmFromFile /etc/asl/whitelist" phase:1,pass,t:none,id:318743,nolog,skipAfter:END_RBL Even though I have added the IP to the whitelist file it is still hitting this rule: SecRule REQUEST_HEADERS:Host "^[\d.:]+$" Any thoughts as to why its being missed in phase 1 ? Thanks, Phil |
Thanks for the feedback, @zimmerle - I've responded to your comments. |
Hi @mariodsantana, Thank you again for you path. Your patch is now on our buildbots. Made a small modification, as you can see here: |
Documentation was changed already: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#proxy |
Merged! It will be released as part of ModSecurity v2.9.1 |
Thanks!
|
[Resubmission of pull #961 after rebasing for more alternatives.]
These two small patches fix issues I'm having when trying to do some tricky proxy actions. For example if I do:
SecDefaultAction "phase:2,log,setvar:SESSION.badness=1,proxy:'http://192.168.190.12%{REQUEST_URI_RAW}"
I've been applying them to new releases without issue for my use case. I posted them a while back as "issues" but they never got answered there? Submitting as a pull request now in case that's the preferred method. The fixes are: