-
Notifications
You must be signed in to change notification settings - Fork 291
Issues while using error_page and location #55
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
Hello, is there a plan to be fixed? The issue still exists and it's very serious. Also, audit_logging now works without the custom 403 page only in serial mode, not in concurrent. Thank you in advance. I think fixing this will solve many other issues and will help many people like me. |
In addition, the problem with concurrent logging was my mistake. It works. Remains the problem with custom 403 page only. |
If you don't plan to fix it can you please tell me which file and function is related to this problem ? |
Have you tried enabling the intercept_errors directives (e.g. proxy_intercept_errors) directive in Nginx? |
hi @victorhora! Thanks about the reply. I tried - in server block and in location. but didn't help. Logging didn't work with it too with custom 403 page. |
@victorhora, yes, I've tried with intercept_errors directives but no luck. Thank you for looking into this error. |
@zimmerle Here too It's enabled the |
Maybe, have some problem in this code: https://github.com/SpiderLabs/ModSecurity-nginx/blob/master/src/ngx_http_modsecurity_module.c#L164-L186 I'm trying to understand it |
@ceasbz I think that the problem is in this chunk of code too, but I a can't understand and fix it. If you do it please share the fix. I will appreciate it! |
Hi, Notice the configurations [1] and [2]. They are different by the error_block location. In [1] the error was specified inside the location block. In that case the ModSecurity rules specified for the location block will be also applied to the error. That is different from [2] where we have no ModSecurity rules configured for the error block. In my tests, having the configuration in the right place, I managed to have ModSecurity working as expected. I am closing the bug assuming that it was a configuration issue. If you think otherwise, please re-open. |
Hi! |
Hi @rm3nchaca, Try to consider suggestions in this thread #76 |
Hello @AirisX! I replaced the files with yours and recompiled nginx with the new modsecurity-nginx files. Logging seems to work, but uid parameter is no more logged in the audit log. UID parameter is a uid cookie set in nginx with userid module like follows: userid on; And this should be logged in audit logs too as it was before your patch. Can you please give me an advice how to proceed? |
Hello @intelbg, Could you provide your config? Please, also show an example of the audit log entries before and after patch. |
@AirisX Thank you about your reply! |
Hello @intelbg, Could you clarify, do you mean |
@AirisX you are right! But no matter what value it's set in some moment there is a point that no uid cookie is logged and I can't understand why. In the time of expiration it should provide and log immediately a different cookie, right? |
@intelbg Yes, while the |
@AirisX even with 1 hour settings for expiration, the first request for example does not log the uid cookie. With the second and third there is no problem (I attached the log). |
@intelbg of course, the first request doesn't contain the
|
According to the original report (Ehsan Mahdavi) the audit logs are not working for custom error pages (using: error_page or location). In that scenario the logs are not written.
Ehsan Mahdavi also said that in case of SecRuleEngine is set to DetectionOnly everything works like expected.
The text was updated successfully, but these errors were encountered: