192 |
- |
1 |
# Fail2Ban configuration file
|
|
|
2 |
#
|
|
|
3 |
# Author: Cyril Jaquier
|
|
|
4 |
#
|
|
|
5 |
#
|
|
|
6 |
|
|
|
7 |
[Definition]
|
|
|
8 |
|
|
|
9 |
# Option: actionstart
|
|
|
10 |
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
|
|
|
11 |
# Values: CMD
|
|
|
12 |
#
|
|
|
13 |
actionstart = if [ ! -z '<target>' ]; then touch <target>; fi;
|
|
|
14 |
printf %%b "<init>\n" <to_target>
|
|
|
15 |
echo "%(debug)s started"
|
|
|
16 |
|
|
|
17 |
# Option: actionflush
|
|
|
18 |
# Notes.: command executed once to flush (clear) all IPS, by shutdown (resp. by stop of the jail or this action)
|
|
|
19 |
# Values: CMD
|
|
|
20 |
#
|
|
|
21 |
actionflush = printf %%b "-*\n" <to_target>
|
|
|
22 |
echo "%(debug)s clear all"
|
|
|
23 |
|
|
|
24 |
# Option: actionstop
|
|
|
25 |
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
|
|
|
26 |
# Values: CMD
|
|
|
27 |
#
|
|
|
28 |
actionstop = if [ ! -z '<target>' ]; then rm -f <target>; fi;
|
|
|
29 |
echo "%(debug)s stopped"
|
|
|
30 |
|
|
|
31 |
# Option: actioncheck
|
|
|
32 |
# Notes.: command executed once before each actionban command
|
|
|
33 |
# Values: CMD
|
|
|
34 |
#
|
|
|
35 |
actioncheck =
|
|
|
36 |
|
|
|
37 |
# Option: actionban
|
|
|
38 |
# Notes.: command executed when banning an IP. Take care that the
|
|
|
39 |
# command is executed with Fail2Ban user rights.
|
|
|
40 |
# Tags: See jail.conf(5) man page
|
|
|
41 |
# Values: CMD
|
|
|
42 |
#
|
|
|
43 |
actionban = printf %%b "+<ip>\n" <to_target>
|
|
|
44 |
echo "%(debug)s banned <ip> (family: <family>)"
|
|
|
45 |
|
|
|
46 |
# Option: actionunban
|
|
|
47 |
# Notes.: command executed when unbanning an IP. Take care that the
|
|
|
48 |
# command is executed with Fail2Ban user rights.
|
|
|
49 |
# Tags: See jail.conf(5) man page
|
|
|
50 |
# Values: CMD
|
|
|
51 |
#
|
|
|
52 |
actionunban = printf %%b "-<ip>\n" <to_target>
|
|
|
53 |
echo "%(debug)s unbanned <ip> (family: <family>)"
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
debug = [<name>] <actname> <target> --
|
|
|
57 |
|
|
|
58 |
[Init]
|
|
|
59 |
|
|
|
60 |
init = 123
|
|
|
61 |
|
|
|
62 |
target = /var/run/fail2ban/fail2ban.dummy
|
|
|
63 |
to_target = >> <target>
|