diff --git a/config/action.d/blocklist_de.conf b/config/action.d/blocklist_de.conf index 2f31d8b9b..246f90f75 100644 --- a/config/action.d/blocklist_de.conf +++ b/config/action.d/blocklist_de.conf @@ -54,7 +54,7 @@ actioncheck = # Tags: See jail.conf(5) man page # Values: CMD # -actionban = curl --fail --data-urlencode 'server=' --data 'apikey=' --data 'service=' --data 'ip=' --data-urlencode 'logs=' --data 'format=text' --user-agent "" "https://www.blocklist.de/en/httpreports.html" +actionban = lgm=$(printf 'logs=%%s\n...' ""); curl --fail --data-urlencode "server=" --data "apikey=" --data "service=" --data "ip=" --data-urlencode "$lgm" --data 'format=text' --user-agent "" "https://www.blocklist.de/en/httpreports.html" # Option: actionunban # Notes.: command executed when unbanning an IP. Take care that the @@ -64,8 +64,6 @@ actionban = curl --fail --data-urlencode 'server=' --data 'apikey=\', email="Fail2Ban ", ' + 'apikey="TEST-API-KEY", agent="fail2ban-test-agent", service=]', 'filter =', 'datepattern = ^Epoch', 'failregex = ^ failure "[^"]+" - ', @@ -1219,6 +1223,14 @@ class Fail2banServerTest(Fail2banClientServerBase): self.assertIn('\\125-000-004 1;\n', mp) self.assertIn('\\125-000-005 1;\n', mp) + # check blocklist_de substitution: + self.assertLogged( + "stdout: '*** curl --fail --data-urlencode server=Fail2Ban " + " --data apikey=TEST-API-KEY --data service=nginx-blck-lst ", + "stdout: '... --data format=text --user-agent fail2ban-test-agent", + all=True, wait=MID_WAITTIME + ) + # unban 1, 2 and 5: self.execCmd(SUCCESS, startparams, 'unban', '125-000-001', '125-000-002', '125-000-005') _out_file(mpfn)