In my previous post I didn’t mention how to turn on the audit log, so without explanation, you put the following in your config.
SecAuditEngine RelevantOnly
SecAuditLogType serial
SecAuditLogParts ABCFHZ
We already set SecAuditLog to /var/log/modsecurity/SecAuditLog/modsec_audit.log in the previous post, which has to be writable by the web server user, www-data for ubuntu/debian. So after a reload, you should start seeing entries when mod_security denies a request.
I’m going to modify SecAuditLogType setting in a future post so we can enable the console.
Related posts: