0

禁用 OWASP SQL_ATTACK CRS RULE,我使用了这个

# ModSecurity Rule Exclusion: 942100 SQL Injection Detected via libinjection
   SecRuleRemoveByTag WEB_ATTACK/SQL_INJECTION 
#Disabled Generally

而且,我只希望它仅在文件夹( /Pay )和文件( /pay.php )上启用

#I know i can do something with this, but don't know what. 
<LocationMatch "^/pay">
</LocationMatch>

有人可以启发我在 Apache 上使用 mod_security 吗?

4

1 回答 1

0

像这样的东西只会对不以 Pay 或 pay 开头的请求禁用该类别的规则:

SecRule REQUEST_URI "!^/[Pp]ay" "id:1000,phase:2,ctl:ruleRemoveByTag=WEB_ATTACK/SQL_INJECTION"

I prefer to write a new, override rule using ModSecurity's ctl method rather than using Apache's Location blocks as Location does not work for any phase 1 rules (though I'm pretty sure all SQL Injection rules are phase 2 so that could have been used in this case).

于 2017-06-14T18:57:36.267 回答