【发布时间】:2019-02-04 04:50:43
【问题描述】:
有人可以帮我设置规则,以便我只获取使用 POST 发布的数据。我有一个表格,我在其中提交姓名和电子邮件 ID。我只想保存要保存在日志文件中的那部分。在我的场景中,我只想在我的日志文件中包含以下数据:-
--29000000-C--
name1=ssn&email1=ssn%40gmail.com
--29000000-F--
HTTP/1.1 200 OK
X-Powered-By: PHP/7.2.4
Content-Length: 16
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
我现在的 mod_security 看起来像:-
<IfModule security2_module>
#Enable the module.
SecRuleEngine On
SecAuditEngine on
#Setup logging in a dedicated file.
SecAuditLog C:/wamp64/bin/apache/apache2.4.33/logs/website-audit.log
#Allow it to access requests body.
SecRequestBodyAccess on
SecAuditLogParts ABIFHZ
#Setup default action.
SecDefaultAction "nolog,noauditlog,allow,phase:2"
#Define the rule that will log the content of POST requests.
SecRule REQUEST_METHOD "^POST$" "chain,allow,phase:2,id:123"
SecRule REQUEST_URI ".*" "auditlog"
</ifmodule>
【问题讨论】:
标签: apache logging httpd.conf rules apache-modules