我有 2 个 IP 地址需要使用 ModSecurity 列入白名单。到目前为止,我一次只能将 1 个 IP 列入白名单。
我试过了:
SecRule REMOTE_ADDR "@ipMatch 35.178.146.26,81.138.11.237" phase:1,nolog,allow,ctl:ruleEngine=Off
和
SecRule REMOTE_ADDR "@ipMatch 35.178.146.26" phase:1,nolog,allow,ctl:ruleEngine=Off
SecRule REMOTE_ADDR "@ipMatch 81.138.11.237" phase:1,nolog,allow,ctl:ruleEngine=Off
并且
SecRule REMOTE_ADDR "@ipMatch 35.178.146.26"\
SecRule REMOTE_ADDR "@ipMatch 81.138.11.237"\
phase:1,nolog,allow,ctl:ruleEngine=Off
但是这些白名单中的 IP 地址和一个都不会出现在审核日志中。
添加这些规则并尝试重新启动 Apache 后,我会收到引用第二条规则的错误:
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.