Subversion Repositories configs

Rev

Rev 4 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 34
Line 4... Line 4...
4
# Modified by Yaroslav Halchenko for multiport banning
4
# Modified by Yaroslav Halchenko for multiport banning
5
#
5
#
6
 
6
 
7
[INCLUDES]
7
[INCLUDES]
8
 
8
 
9
before = iptables-blocktype.conf
9
before = iptables-common.conf
10
 
10
 
11
[Definition]
11
[Definition]
12
 
12
 
13
# Option:  actionstart
13
# Option:  actionstart
14
# Notes.:  command executed once at the start of Fail2Ban.
14
# Notes.:  command executed once at the start of Fail2Ban.
15
# Values:  CMD
15
# Values:  CMD
16
#
16
#
17
actionstart = iptables -N fail2ban-<name>
17
actionstart = iptables -N f2b-<name>
18
              iptables -A fail2ban-<name> -j RETURN
18
              iptables -A f2b-<name> -j RETURN
19
              iptables -I <chain> -p <protocol> -m multiport --dports <port> -j fail2ban-<name>
19
              iptables -I <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>
20
 
20
 
21
# Option:  actionstop
21
# Option:  actionstop
22
# Notes.:  command executed once at the end of Fail2Ban
22
# Notes.:  command executed once at the end of Fail2Ban
23
# Values:  CMD
23
# Values:  CMD
24
#
24
#
25
actionstop = iptables -D <chain> -p <protocol> -m multiport --dports <port> -j fail2ban-<name>
25
actionstop = iptables -D <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>
26
             iptables -F fail2ban-<name>
26
             iptables -F f2b-<name>
27
             iptables -X fail2ban-<name>
27
             iptables -X f2b-<name>
28
 
28
 
29
# Option:  actioncheck
29
# Option:  actioncheck
30
# Notes.:  command executed once before each actionban command
30
# Notes.:  command executed once before each actionban command
31
# Values:  CMD
31
# Values:  CMD
32
#
32
#
33
actioncheck = iptables -n -L <chain> | grep -q 'fail2ban-<name>[ \t]'
33
actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
34
 
34
 
35
# Option:  actionban
35
# Option:  actionban
36
# Notes.:  command executed when banning an IP. Take care that the
36
# Notes.:  command executed when banning an IP. Take care that the
37
#          command is executed with Fail2Ban user rights.
37
#          command is executed with Fail2Ban user rights.
38
# Tags:    See jail.conf(5) man page
38
# Tags:    See jail.conf(5) man page
39
# Values:  CMD
39
# Values:  CMD
40
#
40
#
41
actionban = iptables -I fail2ban-<name> 1 -s <ip> -j <blocktype>
41
actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
42
 
42
 
43
# Option:  actionunban
43
# Option:  actionunban
44
# Notes.:  command executed when unbanning an IP. Take care that the
44
# Notes.:  command executed when unbanning an IP. Take care that the
45
#          command is executed with Fail2Ban user rights.
45
#          command is executed with Fail2Ban user rights.
46
# Tags:    See jail.conf(5) man page
46
# Tags:    See jail.conf(5) man page
47
# Values:  CMD
47
# Values:  CMD
48
#
48
#
49
actionunban = iptables -D fail2ban-<name> -s <ip> -j <blocktype>
49
actionunban = iptables -D f2b-<name> -s <ip> -j <blocktype>
50
 
50
 
51
[Init]
51
[Init]
52
 
52
 
53
# Default name of the chain
-
 
54
#
-
 
55
name = default
-
 
56
 
-
 
57
# Option:  port
-
 
58
# Notes.:  specifies port to monitor
-
 
59
# Values:  [ NUM | STRING ]  Default:
-
 
60
#
-
 
61
port = ssh
-
 
62
 
-
 
63
# Option:  protocol
-
 
64
# Notes.:  internally used by config reader for interpolations.
-
 
65
# Values:  [ tcp | udp | icmp | all ] Default: tcp
-
 
66
#
-
 
67
protocol = tcp
-
 
68
 
-
 
69
# Option:  chain
-
 
70
# Notes    specifies the iptables chain to which the fail2ban rules should be
-
 
71
#          added
-
 
72
# Values:  STRING  Default: INPUT
-
 
73
chain = INPUT
-