You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've spent a couple days with finetuning my server and came up with a better AbuseIPDB reporting.
The base problem is, upon restarting fail2ban, it runs all the actionbans which will trigger curl to call all the API calls, thus possibly exhausting the available API call count.
I've found a script on their site, which I managed to vastly improve. Now it's compatible with FreeBSD and uses the right DB table (and no extra files) to skip calling APIs upon fail2ban restart.
The basic idea is: upon running the script, it checks the sqlite DB if there is an existing record for the IP (and jail name, that comprises the primary key) in the bips table. If the record created is older than10 seconds (configurable in the script), it skips reporting, thus saving API calls.
I haven't created a PR for this since it's customized for my FreeBSD box, but here are the sources for it:
The bc tool is required for this to calculate the DELTA_BEFORE value, not sure that's available everywhere. On FreeBSD, it's part of the base system.
The sqlite3 command line tool is also a requirement, but I would think that's a given since fail2ban uses sqlite.
Feel free to do whatever you like with it, it works for me™.
The text was updated successfully, but these errors were encountered:
The base problem is, upon restarting fail2ban, it runs all the actionbans which will trigger curl to call all the API calls, thus possibly exhausting the available API call count.
Hmm... Since b318eb7 it shall not send restored (after restart) tickets to abuseipdb anymore.
Do you have some old version of action (without norestored = 1)?
I remember getting curl errors in the syslog upon restart, but don't exactly remember where they originated from.
They might have been from blocklist_de.conf, that configuration needs this too.
Didn't know this option existed (never really looked), but my script provides more functionality in that it will log output from the API with confidence scores.
just checked (had to reinstall my fail2ban jail), when updating the blocklist_de.conf to have norestored = 1 via live patching before starting fail2ban, the reporting errors disappear.
Also, the already used norestored in the abuseipdb.conf are also working, my script doesn't get executed on an update.
Still there is the benefit of the improved reporting (displaying the score).
Feel free to do whatever you want with the script and modifications I provided.
Hey,
I've spent a couple days with finetuning my server and came up with a better AbuseIPDB reporting.
The base problem is, upon restarting fail2ban, it runs all the actionbans which will trigger
curl
to call all the API calls, thus possibly exhausting the available API call count.I've found a script on their site, which I managed to vastly improve. Now it's compatible with FreeBSD and uses the right DB table (and no extra files) to skip calling APIs upon fail2ban restart.
The basic idea is: upon running the script, it checks the sqlite DB if there is an existing record for the IP (and jail name, that comprises the primary key) in the
bips
table. If the record created is older than10 seconds (configurable in the script), it skips reporting, thus saving API calls.I haven't created a PR for this since it's customized for my FreeBSD box, but here are the sources for it:
Patching
action.d/abuseipdb.conf
:The script itself:
The shell also logs the API call result, which is a small json snippet with the confidence score. An example:
The
bc
tool is required for this to calculate theDELTA_BEFORE
value, not sure that's available everywhere. On FreeBSD, it's part of the base system.The
sqlite3
command line tool is also a requirement, but I would think that's a given since fail2ban uses sqlite.Feel free to do whatever you like with it, it works for me™.
The text was updated successfully, but these errors were encountered: