mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
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:
parent
23c8838634
commit
3f721eb019
1 changed files with 12 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue