Ban time incr

New feature "automatically exponential increasing ban time".
WARNING: by first start the server upgrades sqlite database (table "bans" will recreated with another schema);
Option "bantime.increment" in jail.conf allows to use database for searching of previously banned ip's to increase a default ban time using special formula, by default each next ban increase banTime * 1, 2, 4, 8, 16, 32...
see "jail.conf" for some other options of "bantime.___";
additional we can configure a little randomization of ban time, to prevent "clever" botnets calculate exact time IP can be unbanned.


On Mon, 01 Dec 2014, Serg G. Brester wrote:
>  > +             Ex: 1hour+30min = 5400
>  > +                 0d 1h 30m   = 5400
>  > +                 1year-6mo   = 15778800
>  > +                 6 months    = 15778800
>  > +             warn: month is not 30 days, it is a year in seconds / 12, the leap years will be respected also:
>  > +                   >>>> float(Test.str2seconds("1month")) / 60 / 60 / 24
>  > +                   30.4375
>  > +                   >>>> float(Test.str2seconds("1year")) / 60 / 60 / 24
>  > +                   365.25   

>    The unittests are not really necessary - that runs indirectly because of
>    any time setting in code and tests are rewritten in str2seconds format.

I know... but that is the point of 'unittests' (instead of
integration/functionality ones) that you could in 1 spot verify correct
functioning so fixing/testing would become easier and you could cover
more corner cases

>    But I will add these few examples as tests.

thanks!  feel welcome to become creative (e.g. 6 months + 1 year + 1
sec)

-- 
Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Research Scientist,            Psychological and Brain Sciences Dept.
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik