-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.priority/backlogHigher priority than priority/awaiting-more-evidence.Higher priority than priority/awaiting-more-evidence.

Description
NGINX Ingress controller version: 0.31.1
Kubernetes version (use kubectl version
): v1.16.2
What happened:
Nginx use default config from /etc/nginx/modsecurity/modsecurity.conf:
SecAuditEngine RelevantOnly
SecAuditLog /var/log/modsec_audit.log
SecAuditLogStorageDir /var/log/audit/
And I cant rewrite it via nginx.ingress.kubernetes.io/modsecurity-snippet
. I am trying different configurations but cant disable logging into container:
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/enable-modsecurity: "true"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
SecRuleEngine On
SecAuditEngine Off
or
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/enable-modsecurity: "true"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
SecRuleEngine On
SecAuditEngine Off
SecAuditLog /dev/null
SecAuditLogStorageDir /dev/null
or
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/enable-modsecurity: "true"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
SecRuleEngine On
SecAuditLog /dev/stdout
SecAuditLogStorageDir /dev/stdout
and so on ...
The only way is to delete the file /var/log/modsec_audit.log and /var/log/audit/ dir:
rm -rf /var/log/audit/
rm /var/log/modsec_audit.log
What you expected to happen:
No logging into /var/log/modsec_audit.log and /var/log/audit/ dir
Only stdout
How to reproduce it:
Try to disable ModSecurity logging into the nginx-ingress-controller pods
/kind bug
Metadata
Metadata
Assignees
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.priority/backlogHigher priority than priority/awaiting-more-evidence.Higher priority than priority/awaiting-more-evidence.