centos 特定URI的ModSecurity白名单

db2dz4w8  于 2022-11-07  发布在  其他
关注(0)|答案(1)|浏览(261)

我已经在CentOS 7上设置了Apache 2 + PHP5
我的Web应用程序的一些PHP,他们接受UUID作为GET参数,这违反了ModSecurity URI模式。
我想设置ModSecurity以绕过对特定URI的安全检查。我该怎么做?
谢谢你!

hgb9j2n6

hgb9j2n61#

您可以创建如下所示的排除规则:

SecRule REQUEST_FILENAME "@endsWith /dir/script.php" \
    "id:1000,\
    phase:2,\
    pass,\
    t:none,\
    nolog,\
    ctl:ruleRemoveTargetById=932130;ARGS:get_or_post_parameter,\
    ctl:ruleRemoveTargetById=941100;ARGS:get_or_post_parameter,\
    ctl:ruleRemoveTargetById=932130;ARGS:get_or_post_parameter2"

在第一行中设置URI,在规则的末尾,为规则ID和GET/POST参数名称对添加排除项(如上面的示例)。最后,将规则放入文件REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf中。

相关问题