-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Missing transaction logs for blocked request ingress-nginx #3351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @mkuchniak,
Could you explain which blocked requests' log are missing from transaction log? (And do you mean audit.log?)
I assume this is the content of error.log, right? Isn't there any other lines with What is your settings of |
@airween We are using ingress-nginx with mod_security on Kubernetes, we send all our logs to stdout So we only see the final log for the request blocked, but we don't see all the processing happening. Example from different request:
In previous output we see rule 949110 which is anomaly score, but we don't see the log on what inputed to that score. |
Sorry, I don't know Ingress nor Kubernetes. So you don't have any
? |
By default the nginx audit and error log is configured to pass to stdout
|
I see, but could you set up that with explicit way as I showed you above? |
Ok so after a lot of testing and comparing two deployments of nginx next to eachother, we concluded that this is caused by using "custom-http-errors" we have a seperate deployment for showing custom error pages with our desing, this is using:
There we have custom error pages for 4xx and 5xx pages includes 404 429 403 422. In nginx config map we have configured:
When I've removed the 403 from custom pages, we can now see all transaction logs from mod_sec. Is this a know issue? |
Describe the bug
We are missing transaction logs for some of the blocked requests.
Logs and dumps
188#188: *3490527 [client my.ip] ModSecurity: Access denied with code 403 (phase 2). Matched "Operator
Ge' with parameter
5' against variableTX:BLOCKING_INBOUND_ANOMALY_SCORE' (Value:
20' ) [file "/etc/nginx/owasp-modsecurity-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "222"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 20)"] [data ""] [severity "0"] [ver "OWASP_CRS/4.4.0"] [maturity "0"] [accuracy "0"] [tag "anomaly-evaluation"] [tag "OWASP_CRS"] [hostname "192.168.66.83"] [uri "/courses"] [unique_id "174185963544.478079"] [ref ""]Output of:
Notice: Be careful to not leak any confidential information.
To Reproduce
Steps to reproduce the behavior:
curl -v "http://domain.com/?q=<script>alert('XSS')</script>"
trigger XSS rules
https://github.com/coreruleset/coreruleset/blob/main/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf
Expected behavior
Transaction logs for all requests
Server (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: