dosborne
Very Senior Member
Way back, I had a script that would parse my logs looking for various "offenses" and based on the severity (based purely on what I had coded) would either add the offender to a temporary list that would be blocked for 24 hours or to a permanent list. Repeat offenders in the temporary list would also be added to the permanent list. To speed up the actual blocking, I also had a threshold to start with a single IP, then if 4 addresses in that range where banned I'd simply block the whole range and keep increasing the mask as more and more offenders were captured. The script and database would build the iptables rules. I also had some release conditions so as to not overload the block list. I rand this for about 4 years. For my purposes, this worked extremely well and was easy to implement on Linux.On a couple of linux servers here I block large lists of IP/CIDR ranges via iptables using scripts to add and delete them as needed.
Unfortunately, I don't think I bothered to keep any of the code though. Presenting the "idea" rather than a solution