From d07e92c2f2e319d12b7b6b37a66d7f628c353c3d Mon Sep 17 00:00:00 2001 From: b1v1r Date: Tue, 2 Jun 2009 15:35:21 +0000 Subject: [PATCH] Updated geo docs. --- doc/modsecurity2-apache-reference.xml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/doc/modsecurity2-apache-reference.xml b/doc/modsecurity2-apache-reference.xml index 5ddaa8d5..1bca27c2 100644 --- a/doc/modsecurity2-apache-reference.xml +++ b/doc/modsecurity2-apache-reference.xml @@ -6,7 +6,7 @@ Manual - Version 2.5.10-dev1 (May 29, 2009) + Version 2.5.10-dev1 (June 2, 2009) 2004-2009 @@ -2836,11 +2836,12 @@ SecRule ENV:tag "suspicious"
<literal moreinfo="none">GEO</literal> - GEO is a collection populated by the @geoLookup operator. It can be used to match - geographical fields looked up by an IP address or hostname. + GEO is a collection populated by the results of + the last @geoLookup operator. The + collection can be used to match geographical fields looked from an IP + address or hostname. - Available since 2.2.0. + Available since ModSecurity 2.5.0. Fields: @@ -2903,7 +2904,9 @@ SecRule ENV:tag "suspicious" Example: - SecRule REMOTE_ADDR "@geoLookup" "chain,drop,msg:'Non-GB IP address'" + SecGeoLookupDb /usr/local/geo/data/GeoLiteCity.dat +... +SecRule REMOTE_ADDR "@geoLookup" "chain,drop,msg:'Non-GB IP address'" SecRule GEO:COUNTRY_CODE "!@streq GB"
@@ -5455,8 +5458,9 @@ SecRule ARGS:route "!@endsWith %{REQUEST_ADDR}" t:none,deny <literal>geoLookup</literal> Description: This operator looks up various - data fields from an IP address or hostname. The results will be captured - in the GEO collection. + data fields from an IP address or hostname in the target data. The + results will be captured in the GEO + collection. You must provide a database via SecGeoLookupDb before this operator can be @@ -5471,7 +5475,9 @@ SecRule ARGS:route "!@endsWith %{REQUEST_ADDR}" t:none,deny lookup, then do something like this (look for an empty GEO collection): - SecRule REMOTE_ADDR "@geoLookup" "pass,nolog" + SecGeoLookupDb /usr/local/geo/data/GeoLiteCity.dat +... +SecRule REMOTE_ADDR "@geoLookup" "pass,nolog" SecRule &GEO "@eq 0" "deny,status:403,msg:'Failed to lookup IP'"