Description
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.:
curl --header 'X-Forwarded-For: 1.2.3.4' --verbose http://localhost/
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.