Subversion Repositories ALCASAR

Rev

Rev 2487 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2487 Rev 2488
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: fail2ban.sh 2487 2018-02-25 12:49:14Z lucas.echard $
2
# $Id: fail2ban.sh 2488 2018-02-25 14:53:54Z lucas.echard $
3
 
3
 
4
FAIL_CONF="/etc/fail2ban/fail2ban.conf"
4
FAIL_CONF="/etc/fail2ban/fail2ban.conf"
5
JAIL_CONF="/etc/fail2ban/jail.conf"
5
JAIL_CONF="/etc/fail2ban/jail.conf"
6
DIR_FILTER="/etc/fail2ban/filter.d/"
6
DIR_FILTER="/etc/fail2ban/filter.d/"
7
ACTION_ALLPORTS="/etc/fail2ban/action.d/iptables-allports.conf"
7
ACTION_ALLPORTS="/etc/fail2ban/action.d/iptables-allports.conf"
8
 
8
 
9
#########################################################
9
#########################################################
10
## Mise à jour du fichier de configuration de fail2ban ##
10
## Mise à jour du fichier de configuration de fail2ban ##
11
#########################################################
11
#########################################################
12
[ -f $FAIL_CONF ] && [ ! -e $FAIL_CONF.default ] && mv $FAIL_CONF $FAIL_CONF.default
12
[ -f $FAIL_CONF ] && [ ! -e $FAIL_CONF.default ] && mv $FAIL_CONF $FAIL_CONF.default
13
cat << EOF > $FAIL_CONF
13
cat << EOF > $FAIL_CONF
14
 
14
 
15
[Definition]
15
[Definition]
16
 
16
 
17
# Option:  loglevel
17
# Option:  loglevel
18
# Notes.:  Set the log level output.
18
# Notes.:  Set the log level output.
19
#          1 = ERROR
19
#          1 = ERROR
20
#          2 = WARN
20
#          2 = WARN
21
#          3 = INFO
21
#          3 = INFO
22
#          4 = DEBUG
22
#          4 = DEBUG
23
# Values:  NUM  Default:  3
23
# Values:  NUM  Default:  3
24
#
24
#
25
loglevel = 3
25
loglevel = 3
26
 
26
 
27
# Option:  logtarget
27
# Option:  logtarget
28
# Notes.:  Set the log target. This could be a file, SYSLOG, STDERR or STDOUT.
28
# Notes.:  Set the log target. This could be a file, SYSLOG, STDERR or STDOUT.
29
#          Only one log target can be specified.
29
#          Only one log target can be specified.
30
# Values:  STDOUT STDERR SYSLOG file  Default:  /var/log/fail2ban.log
30
# Values:  STDOUT STDERR SYSLOG file  Default:  /var/log/fail2ban.log
31
#
31
#
32
logtarget = /var/log/fail2ban.log
32
logtarget = /var/log/fail2ban.log
33
 
33
 
34
# Option: socket
34
# Option: socket
35
# Notes.: Set the socket file. This is used to communicate with the daemon. Do
35
# Notes.: Set the socket file. This is used to communicate with the daemon. Do
36
#         not remove this file when Fail2ban runs. It will not be possible to
36
#         not remove this file when Fail2ban runs. It will not be possible to
37
#         communicate with the server afterwards.
37
#         communicate with the server afterwards.
38
# Values: FILE  Default:  /var/run/fail2ban/fail2ban.sock
38
# Values: FILE  Default:  /var/run/fail2ban/fail2ban.sock
39
#
39
#
40
socket = /var/run/fail2ban/fail2ban.sock
40
socket = /var/run/fail2ban/fail2ban.sock
41
 
41
 
42
# Option: pidfile
42
# Option: pidfile
43
# Notes.: Set the PID file. This is used to store the process ID of the
43
# Notes.: Set the PID file. This is used to store the process ID of the
44
#         fail2ban server.
44
#         fail2ban server.
45
# Values: [ FILE ]  Default: /var/run/fail2ban/fail2ban.pid
45
# Values: [ FILE ]  Default: /var/run/fail2ban/fail2ban.pid
46
#
46
#
47
pidfile = /var/run/fail2ban/fail2ban.pid
47
pidfile = /var/run/fail2ban/fail2ban.pid
48
EOF
48
EOF
49
 
49
 
50
#########################################################
50
#########################################################
51
## Mise à jour de la configuration de jail de fail2ban ##
51
## Mise à jour de la configuration de jail de fail2ban ##
52
#########################################################
52
#########################################################
53
[ -f $JAIL_CONF ] && [ ! -e $JAIL_CONF.default ] && mv $JAIL_CONF $JAIL_CONF.default
53
[ -f $JAIL_CONF ] && [ ! -e $JAIL_CONF.default ] && mv $JAIL_CONF $JAIL_CONF.default
54
cat << EOF > $JAIL_CONF
54
cat << EOF > $JAIL_CONF
55
 
55
 
56
# Fail2Ban configuration file
56
# Fail2Ban configuration file
57
#
57
#
58
# Author: Cyril Jaquier
58
# Author: Cyril Jaquier
59
# Adapted by ALCASAR team
59
# Adapted by ALCASAR team
60
 
60
 
61
 
61
 
62
# The DEFAULT allows a global definition of the options. They can be overridden
62
# The DEFAULT allows a global definition of the options. They can be overridden
63
# in each jail afterwards.
63
# in each jail afterwards.
64
 
64
 
65
[DEFAULT]
65
[DEFAULT]
66
 
66
 
67
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
67
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
68
# ban a host which matches an address in this list. Several addresses can be
68
# ban a host which matches an address in this list. Several addresses can be
69
# defined using space separator.
69
# defined using space separator.
70
ignoreip = 127.0.0.1/8
70
ignoreip = 127.0.0.1/8
71
 
71
 
72
# "bantime" is the number of seconds that a host is banned.
72
# "bantime" is the number of seconds that a host is banned.
73
bantime  = 300
73
bantime  = 300
74
 
74
 
75
# A host is banned if it has generated "maxretry" during the last "findtime" seconds.
75
# A host is banned if it has generated "maxretry" during the last "findtime" seconds.
76
# Un client est banni s'il génere "maxretry" requêtes pendant "findtime" (en secondes)
76
# Un client est banni s'il génere "maxretry" requêtes pendant "findtime" (en secondes)
77
# Pour ALCASAR : 5 requetes pour chaque filtres en 60 secondes
77
# Pour ALCASAR : 5 requetes pour chaque filtres en 60 secondes
78
findtime  = 60
78
findtime  = 60
79
 
79
 
80
# "maxretry" is the number of failures before a host get banned.
80
# "maxretry" is the number of failures before a host get banned.
81
maxretry = 5
81
maxretry = 5
82
 
82
 
83
# "backend" specifies the backend used to get files modification. Available
83
# "backend" specifies the backend used to get files modification. Available
84
# options are "gamin", "polling" and "auto". This option can be overridden in
84
# options are "gamin", "polling" and "auto". This option can be overridden in
85
# each jail too (use "gamin" for a jail and "polling" for another).
85
# each jail too (use "gamin" for a jail and "polling" for another).
86
#
86
#
87
# gamin:   requires Gamin (a file alteration monitor) to be installed. If Gamin
87
# gamin:   requires Gamin (a file alteration monitor) to be installed. If Gamin
88
#          is not installed, Fail2ban will use polling.
88
#          is not installed, Fail2ban will use polling.
89
# polling: uses a polling algorithm which does not require external libraries.
89
# polling: uses a polling algorithm which does not require external libraries.
90
# auto:    will choose Gamin if available and polling otherwise.
90
# auto:    will choose Gamin if available and polling otherwise.
91
backend = auto
91
backend = auto
92
 
92
 
93
# "usedns" specifies if jails should trust hostnames in logs,
93
# "usedns" specifies if jails should trust hostnames in logs,
94
# warn when DNS lookups are performed, or ignore all hostnames in logs
94
# warn when DNS lookups are performed, or ignore all hostnames in logs
95
#
95
#
96
# yes: if a hostname is encountered, a DNS lookup will be performed.
96
# yes: if a hostname is encountered, a DNS lookup will be performed.
97
# warn: if a hostname is encountered, a DNS lookup will be performed,
97
# warn: if a hostname is encountered, a DNS lookup will be performed,
98
# but it will be logged as a warning.
98
# but it will be logged as a warning.
99
# no: if a hostname is encountered, will not be used for banning,
99
# no: if a hostname is encountered, will not be used for banning,
100
# but it will be logged as info.
100
# but it will be logged as info.
101
usedns = warn
101
usedns = warn
102
 
102
 
103
# Bannissement sur tous les ports après 2 refus d'Apache (tentative d'accès sur des pages inexistentes)
103
# Bannissement sur tous les ports après 2 refus d'Apache (tentative d'accès sur des pages inexistentes)
104
[alcasar_mod-evasive]
104
[alcasar_mod-evasive]
105
 
105
 
106
#enabled = true
106
#enabled = true
107
enabled = false
107
enabled = false
108
backend = auto
108
backend = auto
109
filter = alcasar_mod-evasive
109
filter = alcasar_mod-evasive
110
action = iptables-allports[name=alcasar_mod-evasive]
110
action = iptables-allports[name=alcasar_mod-evasive]
111
logpath = /var/log/httpd/error_log
111
logpath = /var/log/lighttpd/access.log
112
          /var/log/httpd/ssl_error_log
-
 
113
maxretry = 2
112
maxretry = 2
114
 
113
 
115
# Bannissement sur tout les ports après 3 refus de SSH (tentative d'accès par brute-force)
114
# Bannissement sur tout les ports après 3 refus de SSH (tentative d'accès par brute-force)
116
[ssh-iptables]
115
[ssh-iptables]
117
 
116
 
118
enabled = true
117
enabled = true
119
#enabled  = false
118
#enabled  = false
120
filter   = sshd
119
filter   = sshd
121
action   = iptables-allports[name=SSH]
120
action   = iptables-allports[name=SSH]
122
logpath  = /var/log/auth.log
121
logpath  = /var/log/auth.log
123
maxretry = 3
122
maxretry = 3
124
 
123
 
125
# Bannissement sur tous les ports après 5 échecs de connexion sur le centre de contrôle (ACC)
124
# Bannissement sur tous les ports après 5 échecs de connexion sur le centre de contrôle (ACC)
126
[alcasar_acc]
125
[alcasar_acc]
127
 
126
 
128
enabled = true
127
enabled = true
129
#enabled = false
128
#enabled = false
130
backend = auto
129
backend = auto
131
filter = alcasar_acc
130
filter = alcasar_acc
132
action = iptables-allports[name=alcasar_acc]
131
action = iptables-allports[name=alcasar_acc]
133
logpath = /var/log/httpd/ssl_error_log
132
logpath = /var/log/lighttpd/access.log
134
maxretry = 5
133
maxretry = 6
135
 
134
 
136
# Bannissement sur tout les ports après 5 echecs de connexion pour un usager
135
# Bannissement sur tout les ports après 5 echecs de connexion pour un usager
137
[alcasar_intercept]
136
[alcasar_intercept]
138
 
137
 
139
enabled = true
138
enabled = true
140
#enabled = false
139
#enabled = false
141
backend = auto
140
backend = auto
142
filter = alcasar_intercept
141
filter = alcasar_intercept
143
action = iptables-allports[name=alcasar_intercept]
142
action = iptables-allports[name=alcasar_intercept]
144
logpath = /var/log/httpd/ssl_request_log
143
logpath = /var/log/lighttpd/access.log
145
maxretry = 5
144
maxretry = 5
146
 
145
 
147
# Bannissement sur tout les port après 5 échecs de changement de mot de passe
146
# Bannissement sur tout les port après 5 échecs de changement de mot de passe
148
# 5 POST pour changer le mot de passe que le POST soit ok ou non.
147
# 5 POST pour changer le mot de passe que le POST soit ok ou non.
149
[alcasar_change-pwd]
148
[alcasar_change-pwd]
150
 
149
 
151
enabled = true
150
enabled = true
152
#enabled = false
151
#enabled = false
153
backend = auto
152
backend = auto
154
filter = alcasar_change-pwd
153
filter = alcasar_change-pwd
155
action = iptables-allports[name=alcasar_change-pwd]
154
action = iptables-allports[name=alcasar_change-pwd]
156
logpath = /var/log/httpd/ssl_request_log
155
logpath = /var/log/lighttpd/access.log
157
maxretry = 5
156
maxretry = 5
158
 
157
 
159
EOF
158
EOF
160
 
159
 
161
##################################################
160
##################################################
162
## Mise en place des filtres spécifiques	##
161
## Mise en place des filtres spécifiques	##
163
## - Mod_evasive.conf				##
162
## - Mod_evasive.conf				##
164
## - acc-htdigest.conf				##
163
## - acc-htdigest.conf				##
165
## - intercept.conf				##
164
## - intercept.conf				##
166
## - change-pwd.conf				##
165
## - change-pwd.conf				##
167
##################################################
166
##################################################
168
 
167
 
169
######################
168
######################
170
## MOD-EVASIVE.CONF ##
169
## MOD-EVASIVE.CONF ##
171
######################
170
######################
172
cat << EOF > $DIR_FILTER/alcasar_mod-evasive.conf
171
cat << EOF > $DIR_FILTER/alcasar_mod-evasive.conf
173
# Fail2Ban configuration file
172
# Fail2Ban configuration file
174
#
173
#
175
# Author: Cyril Jaquier
174
# Author: Cyril Jaquier
176
# Adapted by ALCASAR team
175
# Adapted by ALCASAR team
177
 
176
 
178
[Definition]
177
[Definition]
179
 
178
 
180
# Option:  failregex
179
# Option:  failregex
181
# Notes.:  regex to match the password failure messages in the logfile. The
180
# Notes.:  regex to match the password failure messages in the logfile. The
182
#          host must be matched by a group named "host". The tag "<HOST>" can
181
#          host must be matched by a group named "host". The tag "<HOST>" can
183
#          be used for standard IP/hostname matching and is only an alias for
182
#          be used for standard IP/hostname matching and is only an alias for
184
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
183
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
185
# Values:  TEXT
184
# Values:  TEXT
186
#
185
#
187
failregex =  \[client <HOST>:[0-9]+\] .*client denied by server configuration
186
failregex =  <HOST> .+\] "[^"]+" 403
188
 
187
 
189
# Option:  ignoreregex
188
# Option:  ignoreregex
190
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
189
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
191
# Values:  TEXT
190
# Values:  TEXT
192
#
191
#
193
ignoreregex = 
192
ignoreregex = 
194
EOF
193
EOF
195
 
194
 
196
#######################
195
#######################
197
## ACC-HTDIGEST.CONF ##
196
## ACC-HTDIGEST.CONF ##
198
#######################
197
#######################
199
cat << EOF > $DIR_FILTER/alcasar_acc.conf
198
cat << EOF > $DIR_FILTER/alcasar_acc.conf
200
# Fail2Ban configuration file
199
# Fail2Ban configuration file
201
#
200
#
202
# Author: Cyril Jaquier
201
# Author: Cyril Jaquier
203
# Adapted by ALCASAR team
202
# Adapted by ALCASAR team
204
 
203
 
205
[Definition]
204
[Definition]
206
 
205
 
207
# Option:  failregex
206
# Option:  failregex
208
# Notes.:  regex to match the password failure messages in the logfile. The
207
# Notes.:  regex to match the password failure messages in the logfile. The
209
#          host must be matched by a group named "host". The tag "<HOST>" can
208
#          host must be matched by a group named "host". The tag "<HOST>" can
210
#          be used for standard IP/hostname matching and is only an alias for
209
#          be used for standard IP/hostname matching and is only an alias for
211
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
210
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
212
# Values:  TEXT
211
# Values:  TEXT
213
#
212
#
214
failregex =  \[auth_digest:error\] \[client <HOST>:[0-9]+\] .*ALCASAR Control Center \(ACC\)
213
failregex =  <HOST> .+\] "[^"]+" 401
215
 
214
 
216
#[[]auth_digest:error[]] [[]client <HOST>:[0-9]\{1,5\}[]]
215
#[[]auth_digest:error[]] [[]client <HOST>:[0-9]\{1,5\}[]]
217
 
216
 
218
# Option:  ignoreregex
217
# Option:  ignoreregex
219
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
218
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
220
# Values:  TEXT
219
# Values:  TEXT
221
#
220
#
222
ignoreregex = 
221
ignoreregex = 
223
EOF
222
EOF
224
 
223
 
225
####################
224
####################
226
## INTERCEPT.CONF ##
225
## INTERCEPT.CONF ##
227
####################
226
####################
228
cat << EOF > $DIR_FILTER/alcasar_intercept.conf
227
cat << EOF > $DIR_FILTER/alcasar_intercept.conf
229
# Fail2Ban configuration file
228
# Fail2Ban configuration file
230
#
229
#
231
# Author: Cyril Jaquier
230
# Author: Cyril Jaquier
232
# Adapted by ALCASAR team
231
# Adapted by ALCASAR team
233
 
232
 
234
[Definition]
233
[Definition]
235
 
234
 
236
# Option:  failregex
235
# Option:  failregex
237
# Notes.:  regex to match the password failure messages in the logfile. The
236
# Notes.:  regex to match the password failure messages in the logfile. The
238
#          host must be matched by a group named "host". The tag "<HOST>" can
237
#          host must be matched by a group named "host". The tag "<HOST>" can
239
#          be used for standard IP/hostname matching and is only an alias for
238
#          be used for standard IP/hostname matching and is only an alias for
240
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
239
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
241
# Values:  TEXT
240
# Values:  TEXT
242
#
241
#
243
failregex = \[<HOST>\] \"GET \/intercept\.php\?res=failed\&reason=reject
242
failregex = <HOST> .* \"GET \/intercept\.php\?res=failed\&reason=reject
244
 
243
 
245
# Option:  ignoreregex
244
# Option:  ignoreregex
246
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
245
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
247
# Values:  TEXT
246
# Values:  TEXT
248
#
247
#
249
ignoreregex = 
248
ignoreregex = 
250
EOF
249
EOF
251
 
250
 
252
#####################
251
#####################
253
## CHANGE-PWD.CONF ##
252
## CHANGE-PWD.CONF ##
254
#####################
253
#####################
255
cat << EOF > $DIR_FILTER/alcasar_change-pwd.conf
254
cat << EOF > $DIR_FILTER/alcasar_change-pwd.conf
256
 
255
 
257
# Fail2Ban configuration file
256
# Fail2Ban configuration file
258
#
257
#
259
# Author: Cyril Jaquier
258
# Author: Cyril Jaquier
260
# Adapted by ALCASAR team
259
# Adapted by ALCASAR team
261
 
260
 
262
[Definition]
261
[Definition]
263
 
262
 
264
# Option:  failregex
263
# Option:  failregex
265
# Notes.:  regex to match the password failure messages in the logfile. The
264
# Notes.:  regex to match the password failure messages in the logfile. The
266
#          host must be matched by a group named "host". The tag "<HOST>" can
265
#          host must be matched by a group named "host". The tag "<HOST>" can
267
#          be used for standard IP/hostname matching and is only an alias for
266
#          be used for standard IP/hostname matching and is only an alias for
268
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
267
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
269
# Values:  TEXT
268
# Values:  TEXT
270
#
269
#
271
failregex = \[<HOST>\] \"POST \/password\.php
270
failregex = <HOST> .* \"POST \/password\.php
272
 
271
 
273
 
272
 
274
# Option:  ignoreregex
273
# Option:  ignoreregex
275
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
274
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
276
# Values:  TEXT
275
# Values:  TEXT
277
#
276
#
278
ignoreregex = 
277
ignoreregex = 
279
EOF
278
EOF
280
 
279
 
281
##############################################
280
##############################################
282
##   Log sur ULOG quand iptables-allports   ##
281
##   Log sur ULOG quand iptables-allports   ##
283
##############################################
282
##############################################
284
[ -f $ACTION_ALLPORTS ] && [ ! -e $ACTION_ALLPORTS.default ] && mv $ACTION_ALLPORTS $ACTION_ALLPORTS.default
283
[ -f $ACTION_ALLPORTS ] && [ ! -e $ACTION_ALLPORTS.default ] && mv $ACTION_ALLPORTS $ACTION_ALLPORTS.default
285
cat << EOF > $ACTION_ALLPORTS
284
cat << EOF > $ACTION_ALLPORTS
286
# Fail2Ban configuration file
285
# Fail2Ban configuration file
287
#
286
#
288
# Author: Cyril Jaquier
287
# Author: Cyril Jaquier
289
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
288
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
290
# 			made active on all ports from original iptables.conf
289
# 			made active on all ports from original iptables.conf
291
# Adapted by ALCASAR team
290
# Adapted by ALCASAR team
292
 
291
 
293
[Definition]
292
[Definition]
294
 
293
 
295
# Option:  actionstart
294
# Option:  actionstart
296
# Notes.:  command executed once at the start of Fail2Ban.
295
# Notes.:  command executed once at the start of Fail2Ban.
297
# Values:  CMD
296
# Values:  CMD
298
#
297
#
299
actionstart = iptables -N fail2ban-<name>
298
actionstart = iptables -N fail2ban-<name>
300
              iptables -A fail2ban-<name> -j RETURN
299
              iptables -A fail2ban-<name> -j RETURN
301
              iptables -I <chain> -p <protocol> -j fail2ban-<name>
300
              iptables -I <chain> -p <protocol> -j fail2ban-<name>
302
 
301
 
303
# Option:  actionstop
302
# Option:  actionstop
304
# Notes.:  command executed once at the end of Fail2Ban
303
# Notes.:  command executed once at the end of Fail2Ban
305
# Values:  CMD
304
# Values:  CMD
306
#
305
#
307
actionstop = iptables -D <chain> -p <protocol> -j fail2ban-<name>
306
actionstop = iptables -D <chain> -p <protocol> -j fail2ban-<name>
308
             iptables -F fail2ban-<name>
307
             iptables -F fail2ban-<name>
309
             iptables -X fail2ban-<name>
308
             iptables -X fail2ban-<name>
310
 
309
 
311
# Option:  actioncheck
310
# Option:  actioncheck
312
# Notes.:  command executed once before each actionban command
311
# Notes.:  command executed once before each actionban command
313
# Values:  CMD
312
# Values:  CMD
314
#
313
#
315
actioncheck = iptables -n -L <chain> | grep -q fail2ban-<name>
314
actioncheck = iptables -n -L <chain> | grep -q fail2ban-<name>
316
 
315
 
317
# Option:  actionban
316
# Option:  actionban
318
# Notes.:  command executed when banning an IP. Take care that the
317
# Notes.:  command executed when banning an IP. Take care that the
319
#          command is executed with Fail2Ban user rights.
318
#          command is executed with Fail2Ban user rights.
320
# Tags:    <ip>  IP address
319
# Tags:    <ip>  IP address
321
#          <failures>  number of failures
320
#          <failures>  number of failures
322
#          <time>  unix timestamp of the ban time
321
#          <time>  unix timestamp of the ban time
323
# Values:  CMD
322
# Values:  CMD
324
 
323
 
325
actionban = iptables -I fail2ban-<name> 1 -s <ip> -j DROP
324
actionban = iptables -I fail2ban-<name> 1 -s <ip> -j DROP
326
 
325
 
327
# Option:  actionunban
326
# Option:  actionunban
328
# Notes.:  command executed when unbanning an IP. Take care that the
327
# Notes.:  command executed when unbanning an IP. Take care that the
329
#          command is executed with Fail2Ban user rights.
328
#          command is executed with Fail2Ban user rights.
330
# Tags:    <ip>  IP address
329
# Tags:    <ip>  IP address
331
#          <failures>  number of failures
330
#          <failures>  number of failures
332
#          <time>  unix timestamp of the ban time
331
#          <time>  unix timestamp of the ban time
333
# Values:  CMD
332
# Values:  CMD
334
#
333
#
335
actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP
334
actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP
336
 
335
 
337
[Init]
336
[Init]
338
 
337
 
339
# Defaut name of the chain
338
# Defaut name of the chain
340
#
339
#
341
name = default
340
name = default
342
 
341
 
343
# Option:  protocol
342
# Option:  protocol
344
# Notes.:  internally used by config reader for interpolations.
343
# Notes.:  internally used by config reader for interpolations.
345
# Values:  [ tcp | udp | icmp | all ] Default: tcp
344
# Values:  [ tcp | udp | icmp | all ] Default: tcp
346
#
345
#
347
protocol = tcp
346
protocol = tcp
348
 
347
 
349
# Option:  chain
348
# Option:  chain
350
# Notes    specifies the iptables chain to which the fail2ban rules should be
349
# Notes    specifies the iptables chain to which the fail2ban rules should be
351
#          added
350
#          added
352
# Values:  STRING  Default: INPUT
351
# Values:  STRING  Default: INPUT
353
chain = INPUT
352
chain = INPUT
354
 
353
 
355
EOF
354
EOF
356
 
355