|
|
|
@ -30,6 +30,9 @@
|
|
|
|
|
|
|
|
|
|
[Definition]
|
|
|
|
|
|
|
|
|
|
# bypass reporting of restored (already reported) tickets:
|
|
|
|
|
norestored = 1
|
|
|
|
|
|
|
|
|
|
# Option: actionstart
|
|
|
|
|
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
|
|
|
|
|
# Values: CMD
|
|
|
|
@ -55,20 +58,7 @@ actioncheck =
|
|
|
|
|
# Values: CMD
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
tmpfile = "/var/run/fail2ban/last-log-<name>.time"
|
|
|
|
|
|
|
|
|
|
actionban = if [ ! -e "<tmpfile>" ]
|
|
|
|
|
then
|
|
|
|
|
# if the file doesn't exist yet, create it
|
|
|
|
|
touch -d @<time> "<tmpfile>"
|
|
|
|
|
curl --fail --data-urlencode "server=<email>" --data "apikey=<apikey>" --data "service=<service>" --data "ip=<ip>" --data-urlencode "logs=<matches><br>" --data 'format=text' --user-agent "<agent>" "https://www.blocklist.de/en/httpreports.html"
|
|
|
|
|
fi
|
|
|
|
|
if [ $(stat -c %%X "<tmpfile>") -lt <time> ]
|
|
|
|
|
then
|
|
|
|
|
# If the time of the offense is later than the last ban, actually report it to blocklist.de
|
|
|
|
|
touch -d @<time> "<tmpfile>"
|
|
|
|
|
curl --fail --data-urlencode "server=<email>" --data "apikey=<apikey>" --data "service=<service>" --data "ip=<ip>" --data-urlencode "logs=<matches><br>" --data 'format=text' --user-agent "<agent>" "https://www.blocklist.de/en/httpreports.html"
|
|
|
|
|
fi
|
|
|
|
|
actionban = curl --fail --data-urlencode "server=<email>" --data "apikey=<apikey>" --data "service=<service>" --data "ip=<ip>" --data-urlencode "logs=<matches><br>" --data 'format=text' --user-agent "<agent>" "https://www.blocklist.de/en/httpreports.html"
|
|
|
|
|
|
|
|
|
|
# Option: actionunban
|
|
|
|
|
# Notes.: command executed when unbanning an IP. Take care that the
|
|
|
|
|