Add default iptables-multiport fail2ban action.
[matthijs/servers/drsnuggles.git] / etc / fail2ban / action.d / iptables-multiport.conf
1 # Fail2Ban configuration file
2 #
3 # Author: Cyril Jaquier
4 # Modified by Yaroslav Halchenko for multiport banning
5 # $Revision: 658 $
6 #
7
8 [Definition]
9
10 # Option:  actionstart
11 # Notes.:  command executed once at the start of Fail2Ban.
12 # Values:  CMD
13 #
14 actionstart = iptables -N fail2ban-<name>
15               iptables -A fail2ban-<name> -j RETURN
16               iptables -I INPUT -p <protocol> -m multiport --dports <port> -j fail2ban-<name>
17
18 # Option:  actionstop
19 # Notes.:  command executed once at the end of Fail2Ban
20 # Values:  CMD
21 #
22 actionstop = iptables -D INPUT -p <protocol> -m multiport --dports <port> -j fail2ban-<name>
23              iptables -F fail2ban-<name>
24              iptables -X fail2ban-<name>
25
26 # Option:  actioncheck
27 # Notes.:  command executed once before each actionban command
28 # Values:  CMD
29 #
30 actioncheck = iptables -n -L INPUT | grep -q fail2ban-<name>
31
32 # Option:  actionban
33 # Notes.:  command executed when banning an IP. Take care that the
34 #          command is executed with Fail2Ban user rights.
35 # Tags:    <ip>  IP address
36 #          <failures>  number of failures
37 #          <time>  unix timestamp of the ban time
38 # Values:  CMD
39 #
40 actionban = iptables -I fail2ban-<name> 1 -s <ip> -j DROP
41
42 # Option:  actionunban
43 # Notes.:  command executed when unbanning an IP. Take care that the
44 #          command is executed with Fail2Ban user rights.
45 # Tags:    <ip>  IP address
46 #          <failures>  number of failures
47 #          <time>  unix timestamp of the ban time
48 # Values:  CMD
49 #
50 actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP
51
52 [Init]
53
54 # Defaut name of the chain
55 #
56 name = default
57
58 # Option:  port
59 # Notes.:  specifies port to monitor
60 # Values:  [ NUM | STRING ]  Default:
61 #
62 port = ssh
63
64 # Option:  protocol
65 # Notes.:  internally used by config reader for interpolations.
66 # Values:  [ tcp | udp | icmp | all ] Default: tcp
67 #
68 protocol = tcp
69