in reply to IPQueue blacklist file
IMO the easiest approach to "aging out" is to store everything with an expiry time in the future. The check whether an item is valid is then whether it matches and its expiry time is still in the future at the time of the check. You can easily implement different timeouts that way or even add accumulating timeouts for repeated transgressions (on other ports, for example). Also, by choosing a suitable point of time in the future, you can also ban IPs "forever".
As you seem to be doing stuff in parallel, I suggest you don't use a text file but a database (for example, DBD::SQLite for storing the information. Having a single file is important so you can just delete that file to reset the blacklist. Using a database is convenient as the database will handle all the necessary locking and retrying for you. Also, consider taking a look at the (not in Perl) fail2ban, which also does dynamic IP blocking.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IPQueue blacklist file
by adismaug (Acolyte) on May 25, 2009 at 12:20 UTC |