mod_security with custom rules and whitelists in separate .conf files - Apache 2.2, modsec 2.8
SecRule REMOTE_ADDR "^10\.10\.10\.10" phase:1,nolog,allow,ctl:ruleEngine=Off,id:104008
If a request is sent to the server that includes e.g.
/?abc=../../ then modsec allows the request from 10.10.10.10 only, otherwise it denies the request in Phase 2 with a 403 as I would expect (due to our installed rules)
I have a customer who uses a remote WorPress management system (which is being represented here as 10.10.10.10) but that system sends certain POST requests which contain Content-Length headers but lack Content-Type headers.
Even when the request comes from 10.10.10.10 this results in:
--7ed45f75-H-- Message: Access denied with connection close (phase 1). Match of "rx ^0$" against "REQUEST_HEADERS:Content-Length" required. [file "/usr/local/apache/conf/modsec_rules/10_asl_rules.conf"] [line "93"] [id "392301"] [rev "7"] [msg "Atomicorp.com WAF Rules: Request Containing Content, but Missing Content-Type header"] [severity "NOTICE"] [tag "no_ar"] Apache-Error: [file "config.c"] [line 395] [level 3] Handler for (null) returned invalid result code 9, referer: https://redacted.com Action: Intercepted (phase 1)
I'm not sure if
ctl:ruleEngine=Off simply can't be used in a phase 1 SecRule, or if this is a Mod Security 2.8 bug. I can confirm that there are no rules that subsequently turn ctl:ruleEngine back on.