owasp-modsecurity / owasp-modsecurity/ModSecurity-nginx

Audtilog not works with nginx default-backend

Open
#314 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
1.9k
Forks
312
PR merge metrics
No merged PRs in 30d

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. https://github.com/kubernetes/ingress-nginx/issues/5679#issuecomment-1688247728
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 https://github.com/SpiderLabs/ModSecurity-nginx/pull/255 but as I can see it was fixed but it still doesn't work. Im using ingress-nginx chart 4.7.1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the interaction between ingress-nginx chart 4.7.1, the custom-http-errors ConfigMap option, and ModSecurity audit logging. Review ingress-nginx issue #5679 and ModSecurity-nginx pull request #255, then compare the default-backend behavior with the expected JSON audit log and custom error pages. Done means both outputs work together without the audit log becoming normal Nginx output.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, nginx
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.