【发布时间】:2022-01-09 14:14:22
【问题描述】:
我已经在 CentOS 7 上设置了 Apache2 + PHP5
我的 Web 应用程序的一些 PHP,它们接受 UUID 作为 GET 参数,这违反了 ModSecurity URI 模式。
我想设置 ModSecurity 以绕过特定 URI 的安全检查。 我该怎么做?
谢谢!
【问题讨论】:
标签: php apache security centos
我已经在 CentOS 7 上设置了 Apache2 + PHP5
我的 Web 应用程序的一些 PHP,它们接受 UUID 作为 GET 参数,这违反了 ModSecurity URI 模式。
我想设置 ModSecurity 以绕过特定 URI 的安全检查。 我该怎么做?
谢谢!
【问题讨论】:
标签: php apache security centos
您可以像这样创建排除规则:
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 中。
【讨论】: