ModSecurity 白名单设置

时间:2022-09-24 16:02:39

方法一、SecRuleRemoveById 指令:通过Rule ID禁用指定规则

        #waf whitelist
<LocationMatch .*>
SecRuleRemoveById 960017 #allow Host Header is a IP address
</LocationMatch>

方法二、SecRuleRemoveByMsg指令:通过Rule Msg禁用指定规则

        #waf whitelist
<LocationMatch .*>
SecRuleRemoveByMsg "Host header is a numeric IP address"
</LocationMatch>

方法三、url加白 :对指定路径关闭WAF检测/或只记录不拦截

        <LocationMatch /xss.php>
SecRuleEngine DetectionOnly
</LocationMatch>