I am currently running Apache 2.4.25 on Debian 9.8. I'm trying to set up mod_security to log POST request payloads for a specific URI. I have several API on a Debian server and I have to log all of them except 2. I tried to log only one URI for testing but it seems that the rules I tried doesn't work.
I started by following this question but it seems it doesn't work. Every calls are logged. Even if I comment the two SecRule lines, it still log every call.
My config :
# On active le module.
SecRuleEngine On
SecAuditEngine On
# On lui donne un fichier de log.
SecAuditLog /var/log/httpd/website-audit.log
# On l'autorise à accéder au corps des requêtes.
SecRequestBodyAccess on
SecAuditLogParts ABCDEFGHIJZ
# On configure une action par défaut.
SecDefaultAction "nolog,noauditlog,allow,phase:2"
# On définit une règle qui nous permet de logger le contenu des requêtes POST
SecRule REQUEST_METHOD "^POST$" "chain,allow,phase:2,id:13"
SecRule REQUEST_URI "@streq /api/ICM/SendMessage" "auditlog"
What am I doing incorrectly?
Thanks a lot.