Refactor actionban command in abuseipdb.conf

Move limit logic to the end, so that it will apply after keywords will be removed.
This commit is contained in:
Georgiy Sitnikov 2025-10-22 09:32:47 +02:00 committed by GitHub
parent 23c8838634
commit 3f721eb019
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,17 +83,18 @@ actioncheck =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = lgm=$( \
msg=$(printf '%%.1000s\n...' "<matches>"); \
[ -n "<keywords_to_remove>" ] && \
msg=$(echo "$msg" | sed -E "s/\b(<keywoards_to_remove>)\b/REDACTED/gI"); \
echo "$msg" ); \
curl -sSf "https://api.abuseipdb.com/api/v2/report" \
-H "Accept: application/json" \
-H "Key: <abuseipdb_apikey>" \
--data-urlencode "comment=$lgm" \
--data-urlencode "ip=<ip>" \
--data "categories=<abuseipdb_category>"
actionban = lgm=$(
msg="<matches>" ;\
[ -n "<keywords_to_remove>" ] && \
msg=$(echo "$msg" | sed -E "s/\b(<keywoards_to_remove>)\b/REDACTED/gI") ;\
msg=$(printf '%%.1000s\n...' "$msg") ;\
echo "$msg" ) ;\
curl -sSf "https://api.abuseipdb.com/api/v2/report" \
-H "Accept: application/json" \
-H "Key: <abuseipdb_apikey>" \
--data-urlencode "comment=$lgm" \
--data-urlencode "ip=<ip>" \
--data "categories=<abuseipdb_category>"
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the