|
|
@ -30,6 +30,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
[Definition] |
|
|
|
[Definition] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# bypass reporting of restored (already reported) tickets: |
|
|
|
|
|
|
|
norestored = 1 |
|
|
|
|
|
|
|
|
|
|
|
# Option: actionstart |
|
|
|
# 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). |
|
|
|
# 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 |
|
|
|
# Values: CMD |
|
|
@ -55,20 +58,7 @@ actioncheck = |
|
|
|
# Values: CMD |
|
|
|
# Values: CMD |
|
|
|
# |
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
tmpfile = "/var/run/fail2ban/last-log-<name>.time" |
|
|
|
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" |
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Option: actionunban |
|
|
|
# Option: actionunban |
|
|
|
# Notes.: command executed when unbanning an IP. Take care that the |
|
|
|
# Notes.: command executed when unbanning an IP. Take care that the |
|
|
|