1

设置了新服务器后,我现在正在运行 mod_security 的 v2。我能够将所有规则转换为新格式,到目前为止一切似乎都运行良好。我没有管理的一件事是让 mod_security 使用它自己的日志(而不是记录到 Apache 的error_log)。使用 v1.9,我至少能够复制消息,定义一个额外的日志文件

CustomLog /path/to/modsec_log "%h %l %u %t \"%r\" %>s %b %{mod_security-message}i" env=mod_security-relevant

但即使这样也行不通了。的问题时找不到任何东西,谷歌阿姨也没有找到任何有用的提示。有什么我可能错过的吗?

4

3 回答 3

2

你的意思是审计和调试日志?我把它们设置在 modsec2.conf 这样

SecAuditLog logs/modsec_audit.log
SecDebugLog logs/modsec_debug_log
于 2013-10-28T08:35:11.027 回答
2

modsecurity_crs_10_setup.conf文件中(在我的配置下/usr/share/modsecurity-crs),您可以禁用 Apache 上的日志error.log

# -- [[ Alert Logging Control ]] --
# You have three options -
#
# - To log to both the Apache error_log and ModSecurity audit_log file use: "log"
# - To log *only* to the ModSecurity audit_log file use: "nolog,auditlog"
# - To log *only* to the Apache error_log file use: "log,noauditlog"

只需更改SecDefaultAction

SecDefaultAction "phase:1,deny,nolog,auditlog"
于 2015-12-15T15:38:11.170 回答
0

在文件中设置Logpathmodsecurity.conf如下:

SecAuditLog /root/...path../logs/modsec_audit.log   ( Relative Path )
于 2014-04-30T12:03:43.063 回答