我目前有一个 CentOS 系统,它成功地将相关的 mod_security 操作记录到审计日志文件中。以下是我的配置:
<IfModule mod_security2.c>
SecRuleEngine On
SecAuditEngine RelevantOnly
SecAuditLog /var/log/httpd/modsec_audit.log
SecDebugLog /var/log/httpd/modsec_debug.log
SecDebugLogLevel 0
SecRequestBodyAccess On
SecDataDir /tmp
SecTmpDir /tmp
SecPcreMatchLimit 250000
SecPcreMatchLimitRecursion 250000
</IfModule>
Run Code Online (Sandbox Code Playgroud)
这会记录 mod_security 由于SecAuditEngine RelevantOnly设置而拦截/阻止请求的所有操作。
但是,我希望它另外记录提交到服务器的所有 POST 数据(无论状态如何)。我可以通过设置来实现这一点,SecAuditEngine On但这会记录所有的 GET 和 POST 数据,这太过分了。除非请求被拦截,否则我基本上想省略所有 GET 数据。
谁能建议如何做到这一点?