Description
Hello,
I have compiled nginx 1.12 with libmodsecurity v3, nginx connector and CRS3. Although I can't understand why modest audit log does not log anything. This is the configuration (which is 1:1 with the INSTALL steps).
cat modsec_includes.conf
include modsecurity.conf
include crs-setup.conf
include rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
include rules/REQUEST-901-INITIALIZATION.conf
include rules/REQUEST-905-COMMON-EXCEPTIONS.conf
include rules/REQUEST-910-IP-REPUTATION.conf
include rules/REQUEST-911-METHOD-ENFORCEMENT.conf
include rules/REQUEST-912-DOS-PROTECTION.conf
include rules/REQUEST-913-SCANNER-DETECTION.conf
include rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf
include rules/REQUEST-921-PROTOCOL-ATTACK.conf
include rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf
include rules/REQUEST-931-APPLICATION-ATTACK-RFI.conf
include rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf
include rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf
include rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf
include rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf
include rules/REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.conf
include rules/REQUEST-949-BLOCKING-EVALUATION.conf
include rules/RESPONSE-950-DATA-LEAKAGES.conf
include rules/RESPONSE-951-DATA-LEAKAGES-SQL.conf
include rules/RESPONSE-952-DATA-LEAKAGES-JAVA.conf
include rules/RESPONSE-953-DATA-LEAKAGES-PHP.conf
include rules/RESPONSE-954-DATA-LEAKAGES-IIS.conf
include rules/RESPONSE-959-BLOCKING-EVALUATION.conf
include rules/RESPONSE-980-CORRELATION.conf
include rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
In mod security.conf I have the following configurations about logs:
SecAuditLogRelevantStatus "^(?:5|4(?!04))"
SecAuditLogParts ABIJDEFHZ
SecAuditLogType Serial
SecAuditLog /var/log/nginx/modsec_audit.log
In crs-setup.conf I have the following default action with logging:
cat crs-setup.conf| grep -i defaultac
SecDefaultAction "phase:1,log,auditlog,pass"
SecDefaultAction "phase:2,log,auditlog,pass"
Initially it worked but I haven't changed anything (I know that you heard these words a couple of times, me too :)) and now logging in audit log does not work (but in nginx error.log it logs). Where can the problem be? Also how to change it to log only 403 - is SecAuditLogRelevantStatus 403 correct one? Although how can I change the log configuration to match only header and rule id without html and additional useless information?
Thank you in advance!