@@ -622,20 +622,49 @@ SecDefaultAction "phase:2,log,auditlog,pass"
622622#
623623# To use geolocation, we make use of the MaxMind GeoIP database.
624624# This database is not included with the CRS and must be downloaded.
625- # You should also update the database regularly, for instance every month.
626- # The CRS contains a tool to download it to util/geo-location/GeoIP.dat:
627- # util/upgrade.py --geoip
628625#
629- # This product includes GeoLite data created by MaxMind, available from:
630- # http://www.maxmind.com.
626+ # There are two formats for the GeoIP database. ModSecurity v2 uses GeoLite (.dat files),
627+ # and ModSecurity v3 uses GeoLite2 (.mmdb files).
628+ #
629+ # If you use ModSecurity 3, MaxMind provides a binary for updating GeoLite2 files,
630+ # see https://github.com/maxmind/geoipupdate.
631+ #
632+ # Download the package for your OS, and read https://dev.maxmind.com/geoip/geoipupdate/
633+ # for configuration options.
634+ #
635+ # Warning: GeoLite (not GeoLite2) databases are considered legacy, and not being updated anymore.
636+ # See https://support.maxmind.com/geolite-legacy-discontinuation-notice/ for more info.
637+ #
638+ # Therefore, if you use ModSecurity v2, you need to regenerate updated .dat files
639+ # from CSV files first.
640+ #
641+ # You can achieve this using https://github.com/sherpya/geolite2legacy
642+ # Pick the zip files from maxmind site:
643+ # https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip
644+ #
645+ # Follow the guidelines for installing the tool and run:
646+ # ./geolite2legacy.py -i GeoLite2-Country-CSV.zip \
647+ # -f geoname2fips.csv -o /usr/share/GeoliteCountry.dat
648+ #
649+ # Update the database regularly, see Step 3 of the configuration link above.
650+ #
651+ # By default, when you execute `sudo geoipupdate` on Linux, files from the free database
652+ # will be downloaded to `/usr/share/GeoIP` (both v1 and v2).
653+ #
654+ # Then choose from:
655+ # - `GeoLite2-Country.mmdb` (if you are using ModSecurity v3)
656+ # - `GeoLiteCountry.dat` (if you are using ModSecurity v2)
631657#
632658# Ref: http://blog.spiderlabs.com/2010/10/detecting-malice-with-modsecurity-geolocation-data.html
633659# Ref: http://blog.spiderlabs.com/2010/11/detecting-malice-with-modsecurity-ip-forensics.html
634660#
635- # Uncomment this rule to use this feature:
661+ # Uncomment only one of the next rules here to use this feature.
662+ # Choose the one depending on the ModSecurity version you are using, and change the path accordingly:
636663#
637- #SecGeoLookupDB util/geo-location/GeoIP.dat
638-
664+ # For ModSecurity v3:
665+ #SecGeoLookupDB /usr/share/GeoIP/GeoLite2-Country.mmdb
666+ # For ModSecurity v2 (points to the converted one):
667+ #SecGeoLookupDB /usr/share/GeoIP/GeoLiteCountry.dat
639668
640669#
641670# -=[ Block Countries ]=-
0 commit comments