Skip to content
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

MaxMindDB GeoIP2 #23

Open
ghost opened this issue Dec 10, 2018 · 0 comments
Open

MaxMindDB GeoIP2 #23

ghost opened this issue Dec 10, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 10, 2018

ModSecurity used to have this feature, but now that MaxMind has moved to GeoIP2, it's all broken.

It is still possible to set country-level blocking based on known ip ranges of IPV4 and IPV6, but it requires manually building MaxMind and editing the apache2.conf.

Ideally at install time, the bash script can allow someone to enable which countries they want to allow.

Preliminary code is below. You would still need to add directives to apache2.conf, create cron job that auto updates ip ranges, and a couple of other things.

### MAXMIND
# Program to update database
# Edit apache.conf to allow maxmind and set <if> block
add-apt-repository ppa:maxmind/ppa
apt-get update
apt-get install libmaxminddb0 libmaxminddb-dev mmdb geoipupdate -y
wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz
tar -xvf GeoLite2-Country*
mkdir /usr/local/share/GeoIP
mv GeoLite2-Country*/GeoLite2-Country.mmdb /usr/local/share/GeoIP

wget https://github.com/maxmind/mod_maxminddb/releases/download/1.1.0/mod_maxminddb-1.1.0.tar.gz
tar -xvf mod_maxminddb-1.1.0.tar.gz
cd mod_maxminddb-1.1.0
./configure
make install
# Configure GeoIP update https://dev.maxmind.com/geoip/geoipupdate/
@ghost ghost changed the title MaxMindDB GeoIP MaxMindDB GeoIP2 Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants