Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
192 - 1
# Fail2Ban configuration file
2
#
3
# Author: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
4
#
5
# Modified: Alexander Koeppe <format_c@online.de>, Serg G. Brester <serg.brester@sebres.de>
6
#       made config file IPv6 capable
7
 
8
[INCLUDES]
9
 
10
before = iptables-common.conf
11
 
12
[Definition]
13
 
14
# Option:  actionstart
15
# Notes.:  command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
16
# Values:  CMD
17
#
18
# Changing iptables rules requires root privileges. If fail2ban is
19
# configured to run as root, firewall setup can be performed by
20
# fail2ban automatically. However, if fail2ban is configured to run as
21
# a normal user, the configuration must be done by some other means
22
# (e.g. using static firewall configuration with the
23
# iptables-persistent package).
24
#
25
# Explanation of the rule below:
26
#    Check if any packets coming from an IP on the <iptname>
27
#    list have been seen in the last 3600 seconds. If yes, update the
28
#    timestamp for this IP and drop the packet. If not, let the packet
29
#    through.
30
#
31
#    Fail2ban inserts blacklisted hosts into the <iptname> list
32
#    and removes them from the list after some time, according to its
33
#    own rules. The 3600 second timeout is independent and acts as a
34
#    safeguard in case the fail2ban process dies unexpectedly. The
35
#    shorter of the two timeouts actually matters.
36
actionstart = if [ `id -u` -eq 0 ];then <iptables> -I <chain> -m recent --update --seconds 3600 --name <iptname> -j <blocktype>;fi
37
 
38
# Option:  actionflush
39
#
40
# [TODO] Flushing is currently not implemented for xt_recent
41
#
42
actionflush =
43
 
44
# Option:  actionstop
45
# Notes.:  command executed at the stop of jail (or at the end of Fail2Ban)
46
# Values:  CMD
47
#
48
actionstop = echo / > /proc/net/xt_recent/<iptname>
49
             if [ `id -u` -eq 0 ];then <iptables> -D <chain> -m recent --update --seconds 3600 --name <iptname> -j <blocktype>;fi
50
 
51
# Option:  actioncheck
52
# Notes.:  command executed once before each actionban command
53
# Values:  CMD
54
#
55
actioncheck = test -e /proc/net/xt_recent/<iptname>
56
 
57
# Option:  actionban
58
# Notes.:  command executed when banning an IP. Take care that the
59
#          command is executed with Fail2Ban user rights.
60
# Tags:    See jail.conf(5) man page
61
# Values:  CMD
62
#
63
actionban = echo +<ip> > /proc/net/xt_recent/<iptname>
64
 
65
# Option:  actionunban
66
# Notes.:  command executed when unbanning an IP. Take care that the
67
#          command is executed with Fail2Ban user rights.
68
# Tags:    See jail.conf(5) man page
69
# Values:  CMD
70
#
71
actionunban = echo -<ip> > /proc/net/xt_recent/<iptname>
72
 
73
[Init]
74
 
75
iptname              = f2b-<name>
76
 
77
[Init?family=inet6]
78
 
79
iptname = f2b-<name>6