-
Notifications
You must be signed in to change notification settings - Fork 1.6k
proxy abuse detection failing under 2.8.0 and nginx 1.4.x, 1.6.0 #710
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 @aaccomazzi, we are currently fixing some problems in our nginx version, it includes the way that it handles those proxy requests. The development code is available here: Can you get it a test? Here is what i got with this development version:
|
Hi @zimmerle, thanks for the quick reply. Unfortunately the refactored branch does not help (nginx 1.6.0, CentOS 6.4). To clarify, the problem only appears when I enable the rules in modsecurity_crs_11_proxy_abuse.conf quoted above, i.e. when the geoLookup operator is at work. I should also mention that it makes no difference whether I use the GeoLiteCity.dat or the GeoIP.dat file. This happens both for http as well as https (see below). curl -k --verbose --header 'X-Forwarded-For: 1.2.3.4' https://localhost
|
Linking this issue to the issue #658 as it seems that the nature of the problem is same, thus the solution will be valid for both. The problem is the related to a mutex creation, while the platform is already using all the available ones. Mutex is created: @aaccomazzi Meanwhile you can try what i have suggested on this comment: |
Hi @zimmerle I think you're on the right track. I have removed all nginx generated signals on our server, restarted the daemon and run a query against it to trigger the geoLookup modsecurity rule. This correctly generated the 403 response and left some semaphores with a weird owner id (see below). Happy to try new patches when you have something else to test...
|
No longer a concern in libModSecurity. Marking it as won't fix. Further information about libModSecurity available here: |
I have been using the following rules for detecting proxy abuse under apache and modsecurity 2.7.1 for a long time: https://github.com/SpiderLabs/owasp-modsecurity-crs/blob/master/experimental_rules/modsecurity_crs_11_proxy_abuse.conf
The rules rely on this geo dataset: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
I would like to use them under nginx, but I can't get them to work under any of the recent versions of nginx (1.4.x and 1.6.0) and modsecurity (2.7.x and 2.8.0). A request which carries a bogus proxy and which should be stopped instead causes the connection to be dropped e.g.:
and this appears in the logs:
nginxlog> 2014/04/29 15:07:00 [alert] 2794#0: worker process 2805 exited on signal 11 (core dumped)
The modsecurity debug log shows this:
[29/Apr/2014:15:07:00 --0400] [/sid#158a5b8][rid#1576798][/cgi-bin/showme/foo][4] Recipe: Invoking rule 15c8f00; [file "/etc/nginx/modsecurity.d/activated_rules/modsecurity_crs_11_proxy_abuse.conf"] [line "26"].
[29/Apr/2014:15:07:00 --0400] [/sid#158a5b8][rid#1576798][/cgi-bin/showme/foo][5] Rule 15c8f00: SecRule "TX:0" "@geoLookup " "chain,setvar:tx.geo_x-forwarded-for=%{geo.country_code}"
[29/Apr/2014:15:07:00 --0400] [/sid#158a5b8][rid#1576798][/cgi-bin/showme/foo][4] Transformation completed in 0 usec.
[29/Apr/2014:15:07:00 --0400] [/sid#158a5b8][rid#1576798][/cgi-bin/showme/foo][4] Executing operator "geoLookup" with param "" against TX:0.
The text was updated successfully, but these errors were encountered: