Open
Description
Hello, I'm using ingress-nginx on kubernetes and I have enabled Modsecurity via configmap option. Modsecurity works, auditlog is formatted in JSON.
When I set in nginx configmap custom-http-errors
auditlog is not sent as JSON but as normal nginx output as described in this link. kubernetes/ingress-nginx#5679 (comment)
How can I fix it? I want to have custom error pages and I want to keep auditlog. I tried everything from issue above and related another issues I think it maybe related with #255 but as I can see it was fixed but it still doesn't work. Im using ingress-nginx chart 4.7.1
Activity
airween commentedon Oct 17, 2024
Is this an ingress-nginx specific error?
I tried to reproduce that with a "native" Nginx instance. Here is my config:
Nginx:
ModSecurity:
Sending an attack then I see my custom formatted page. Then I check my audit.log and I get:
Versions:
Nginx: 1.26.0
libmodsecurity: 3.0.13 + commits since the release
libnginx-mod-http-modsecurity: 1.0.3
How can I reproduce this issue?
james-nofrixion commentedon Nov 15, 2024
@airween: I have this issue and it is produced by installing using helm chart
ingress-nginx-4.11.3
and the following values.yaml:The modsecurity configmap is:
airween commentedon Dec 22, 2024
@james-nofrixion,
unfortunately I'm afraid I can't help you with this. I've never used Ingress and I don't have enough capability to install that.
Probably you need to check twice the permission (path to audit.log), or some other MACL system (mandatory access control list - Apparmor or SeLinux) settings.