I have this fail2ban jail targeting an apache log (currently with some small values so I can experiment):
enabled = true
maxretry = 3
bantime = 10
findtime = 5
action = 429-ban
I stress test it using ab
(with concurrency: 10, requests: 10000) and my custom filter catches the "high" traffic almost immediately and bans the IP.
The problem is that after 10 seconds, where the ban expires, if I continue running the ab
, the fail2ban log is now filled with:
Ignore 192.168.XX.XX, expired bantime
Ignore 192.168.XX.XX, expired bantime
Ignore 192.168.XX.XX, expired bantime
From that point onward, and for a very long time, no ban occurs. At the same time fail2ban log reveals processing, even if I stop ab
. If I wait long enough and confirm that the fail2ban log activity stops, then restarting the stress tests effectively bans the IP.
My questions are:
- What does this
expired bantime
exactly mean? - It seems that fail2ban will keep on processing stuff even though stress testing with
ab
has stopped a long time ago. Is there a possibility that there is a buffer of some sort on fail2ban that I could reduce, which would probably also solve my first problem?