A small script to import and ban IPs from a list (like from blocklist.de). The list has to be formatted one IP per line, with no additional text.
After fetching the list, the script will add each IP to fail2bans blocklist jail and trigger the actual banning by touching the appropiate log file.
Tested on Debian Wheezy with fail2ban 0.8.6
In the script, edit the configuration dict:
If your fail2ban modules are not in
/usr/share/fail2ban
, you need to change the import on line 11 according to your needs.
This script was inspired by Kapsonfile