Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
192 - 1
# Fail2Ban configuration file
2
#
3
# Author: Cyril Jaquier
4
#
5
#
6
 
7
[INCLUDES]
8
 
9
before = sendmail-common.conf
10
 
11
[Definition]
12
 
13
# bypass ban/unban for restored tickets
14
norestored = 1
15
 
16
# Option:  actionstart
17
# Notes.:  command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
18
# Values:  CMD
19
#
20
actionstart = printf %%b "Subject: [Fail2Ban] <name>: started on <fq-hostname>
21
              From: <sendername> <<sender>>
22
              To: <dest>\n
23
              Hi,\n
24
              The jail <name> has been started successfully.\n
25
              Output will be buffered until <lines> lines are available.\n
26
              Regards,\n
27
              Fail2Ban" | <mailcmd>
28
 
29
# Option:  actionstop
30
# Notes.:  command executed at the stop of jail (or at the end of Fail2Ban)
31
# Values:  CMD
32
#
33
actionstop = if [ -f <tmpfile> ]; then
34
                 printf %%b "Subject: [Fail2Ban] <name>: summary from <fq-hostname>
35
                 From: <sendername> <<sender>>
36
                 To: <dest>\n
37
                 Hi,\n
38
                 These hosts have been banned by Fail2Ban.\n
39
                 `cat <tmpfile>`
40
                 Regards,\n
41
                 Fail2Ban" | <mailcmd>
42
                 rm <tmpfile>
43
             fi
44
             printf %%b "Subject: [Fail2Ban] <name>: stopped  on <fq-hostname>
45
             From: Fail2Ban <<sender>>
46
             To: <dest>\n
47
             Hi,\n
48
             The jail <name> has been stopped.\n
49
             Regards,\n
50
             Fail2Ban" | <mailcmd>
51
 
52
# Option:  actioncheck
53
# Notes.:  command executed once before each actionban command
54
# Values:  CMD
55
#
56
actioncheck =
57
 
58
# Option:  actionban
59
# Notes.:  command executed when banning an IP. Take care that the
60
#          command is executed with Fail2Ban user rights.
61
# Tags:    See jail.conf(5) man page
62
# Values:  CMD
63
#
64
actionban = printf %%b "`date`: <ip> (<failures> failures)\n" >> <tmpfile>
65
            LINE=$( wc -l <tmpfile> | awk '{ print $1 }' )
66
            if [ $LINE -ge <lines> ]; then
67
                printf %%b "Subject: [Fail2Ban] <name>: summary from <fq-hostname>
68
                From: <sendername> <<sender>>
69
                To: <dest>\n
70
                Hi,\n
71
                These hosts have been banned by Fail2Ban.\n
72
                `cat <tmpfile>`
73
                Regards,\n
74
                Fail2Ban" | <mailcmd>
75
                rm <tmpfile>
76
            fi
77
 
78
# Option:  actionunban
79
# Notes.:  command executed when unbanning an IP. Take care that the
80
#          command is executed with Fail2Ban user rights.
81
# Tags:    See jail.conf(5) man page
82
# Values:  CMD
83
#
84
actionunban =
85
 
86
[Init]
87
 
88
# Default name of the chain
89
#
90
name = default
91
 
92
# Default number of lines that are buffered
93
#
94
lines = 5
95
 
96
# Default temporary file
97
#
98
tmpfile = /var/run/fail2ban/tmp-mail.txt
99