Subversion Repositories ALCASAR

Rev

Rev 2357 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2357 Rev 2487
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: fail2ban.sh 2357 2017-07-27 14:29:28Z tom.houdayer $
2
# $Id: fail2ban.sh 2487 2018-02-25 12:49:14Z 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
filter = alcasar_mod-evasive
109
filter = alcasar_mod-evasive
109
action = iptables-allports[name=alcasar_mod-evasive]
110
action = iptables-allports[name=alcasar_mod-evasive]
110
logpath = /var/log/httpd/error_log
111
logpath = /var/log/httpd/error_log
111
          /var/log/httpd/ssl_error_log
112
          /var/log/httpd/ssl_error_log
112
maxretry = 2
113
maxretry = 2
113
 
114
 
114
# Bannissement sur tout les ports après 3 refus de SSH (tentative d'accès par brute-force)
115
# Bannissement sur tout les ports après 3 refus de SSH (tentative d'accès par brute-force)
115
[ssh-iptables]
116
[ssh-iptables]
116
 
117
 
117
enabled = true
118
enabled = true
118
#enabled  = false
119
#enabled  = false
119
filter   = sshd
120
filter   = sshd
120
action   = iptables-allports[name=SSH]
121
action   = iptables-allports[name=SSH]
121
logpath  = /var/log/auth.log
122
logpath  = /var/log/auth.log
122
maxretry = 3
123
maxretry = 3
123
 
124
 
124
# Bannissement sur tous les ports après 5 échecs de connexion sur le centre de contrôle (ACC)
125
# Bannissement sur tous les ports après 5 échecs de connexion sur le centre de contrôle (ACC)
125
[alcasar_acc]
126
[alcasar_acc]
126
 
127
 
127
enabled = true
128
enabled = true
128
#enabled = false
129
#enabled = false
-
 
130
backend = auto
129
filter = alcasar_acc
131
filter = alcasar_acc
130
action = iptables-allports[name=alcasar_acc]
132
action = iptables-allports[name=alcasar_acc]
131
logpath = /var/log/httpd/ssl_error_log
133
logpath = /var/log/httpd/ssl_error_log
132
maxretry = 5
134
maxretry = 5
133
 
135
 
134
# Bannissement sur tout les ports après 5 echecs de connexion pour un usager
136
# Bannissement sur tout les ports après 5 echecs de connexion pour un usager
135
[alcasar_intercept]
137
[alcasar_intercept]
136
 
138
 
137
enabled = true
139
enabled = true
138
#enabled = false
140
#enabled = false
-
 
141
backend = auto
139
filter = alcasar_intercept
142
filter = alcasar_intercept
140
action = iptables-allports[name=alcasar_intercept]
143
action = iptables-allports[name=alcasar_intercept]
141
logpath = /var/log/httpd/ssl_request_log
144
logpath = /var/log/httpd/ssl_request_log
142
maxretry = 5
145
maxretry = 5
143
 
146
 
144
# Bannissement sur tout les port après 5 échecs de changement de mot de passe
147
# Bannissement sur tout les port après 5 échecs de changement de mot de passe
145
# 5 POST pour changer le mot de passe que le POST soit ok ou non.
148
# 5 POST pour changer le mot de passe que le POST soit ok ou non.
146
[alcasar_change-pwd]
149
[alcasar_change-pwd]
147
 
150
 
148
enabled = true
151
enabled = true
149
#enabled = false
152
#enabled = false
-
 
153
backend = auto
150
filter = alcasar_change-pwd
154
filter = alcasar_change-pwd
151
action = iptables-allports[name=alcasar_change-pwd]
155
action = iptables-allports[name=alcasar_change-pwd]
152
logpath = /var/log/httpd/ssl_request_log
156
logpath = /var/log/httpd/ssl_request_log
153
maxretry = 5
157
maxretry = 5
154
 
158
 
155
EOF
159
EOF
156
 
160
 
157
##################################################
161
##################################################
158
## Mise en place des filtres spécifiques	##
162
## Mise en place des filtres spécifiques	##
159
## - Mod_evasive.conf				##
163
## - Mod_evasive.conf				##
160
## - acc-htdigest.conf				##
164
## - acc-htdigest.conf				##
161
## - intercept.conf				##
165
## - intercept.conf				##
162
## - change-pwd.conf				##
166
## - change-pwd.conf				##
163
##################################################
167
##################################################
164
 
168
 
165
######################
169
######################
166
## MOD-EVASIVE.CONF ##
170
## MOD-EVASIVE.CONF ##
167
######################
171
######################
168
cat << EOF > $DIR_FILTER/alcasar_mod-evasive.conf
172
cat << EOF > $DIR_FILTER/alcasar_mod-evasive.conf
169
# Fail2Ban configuration file
173
# Fail2Ban configuration file
170
#
174
#
171
# Author: Cyril Jaquier
175
# Author: Cyril Jaquier
172
# Adapted by ALCASAR team
176
# Adapted by ALCASAR team
173
 
177
 
174
[Definition]
178
[Definition]
175
 
179
 
176
# Option:  failregex
180
# Option:  failregex
177
# Notes.:  regex to match the password failure messages in the logfile. The
181
# Notes.:  regex to match the password failure messages in the logfile. The
178
#          host must be matched by a group named "host". The tag "<HOST>" can
182
#          host must be matched by a group named "host". The tag "<HOST>" can
179
#          be used for standard IP/hostname matching and is only an alias for
183
#          be used for standard IP/hostname matching and is only an alias for
180
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
184
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
181
# Values:  TEXT
185
# Values:  TEXT
182
#
186
#
183
failregex =  \[client <HOST>:[0-9]+\] .*client denied by server configuration
187
failregex =  \[client <HOST>:[0-9]+\] .*client denied by server configuration
184
 
188
 
185
# Option:  ignoreregex
189
# Option:  ignoreregex
186
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
190
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
187
# Values:  TEXT
191
# Values:  TEXT
188
#
192
#
189
ignoreregex = 
193
ignoreregex = 
190
EOF
194
EOF
191
 
195
 
192
#######################
196
#######################
193
## ACC-HTDIGEST.CONF ##
197
## ACC-HTDIGEST.CONF ##
194
#######################
198
#######################
195
cat << EOF > $DIR_FILTER/alcasar_acc.conf
199
cat << EOF > $DIR_FILTER/alcasar_acc.conf
196
# Fail2Ban configuration file
200
# Fail2Ban configuration file
197
#
201
#
198
# Author: Cyril Jaquier
202
# Author: Cyril Jaquier
199
# Adapted by ALCASAR team
203
# Adapted by ALCASAR team
200
 
204
 
201
[Definition]
205
[Definition]
202
 
206
 
203
# Option:  failregex
207
# Option:  failregex
204
# Notes.:  regex to match the password failure messages in the logfile. The
208
# Notes.:  regex to match the password failure messages in the logfile. The
205
#          host must be matched by a group named "host". The tag "<HOST>" can
209
#          host must be matched by a group named "host". The tag "<HOST>" can
206
#          be used for standard IP/hostname matching and is only an alias for
210
#          be used for standard IP/hostname matching and is only an alias for
207
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
211
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
208
# Values:  TEXT
212
# Values:  TEXT
209
#
213
#
210
failregex =  \[auth_digest:error\] \[client <HOST>:[0-9]+\] .*ALCASAR Control Center \(ACC\)
214
failregex =  \[auth_digest:error\] \[client <HOST>:[0-9]+\] .*ALCASAR Control Center \(ACC\)
211
 
215
 
212
#[[]auth_digest:error[]] [[]client <HOST>:[0-9]\{1,5\}[]]
216
#[[]auth_digest:error[]] [[]client <HOST>:[0-9]\{1,5\}[]]
213
 
217
 
214
# Option:  ignoreregex
218
# Option:  ignoreregex
215
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
219
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
216
# Values:  TEXT
220
# Values:  TEXT
217
#
221
#
218
ignoreregex = 
222
ignoreregex = 
219
EOF
223
EOF
220
 
224
 
221
####################
225
####################
222
## INTERCEPT.CONF ##
226
## INTERCEPT.CONF ##
223
####################
227
####################
224
cat << EOF > $DIR_FILTER/alcasar_intercept.conf
228
cat << EOF > $DIR_FILTER/alcasar_intercept.conf
225
# Fail2Ban configuration file
229
# Fail2Ban configuration file
226
#
230
#
227
# Author: Cyril Jaquier
231
# Author: Cyril Jaquier
228
# Adapted by ALCASAR team
232
# Adapted by ALCASAR team
229
 
233
 
230
[Definition]
234
[Definition]
231
 
235
 
232
# Option:  failregex
236
# Option:  failregex
233
# Notes.:  regex to match the password failure messages in the logfile. The
237
# Notes.:  regex to match the password failure messages in the logfile. The
234
#          host must be matched by a group named "host". The tag "<HOST>" can
238
#          host must be matched by a group named "host". The tag "<HOST>" can
235
#          be used for standard IP/hostname matching and is only an alias for
239
#          be used for standard IP/hostname matching and is only an alias for
236
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
240
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
237
# Values:  TEXT
241
# Values:  TEXT
238
#
242
#
239
failregex = \[<HOST>\] \"GET \/intercept\.php\?res=failed\&reason=reject
243
failregex = \[<HOST>\] \"GET \/intercept\.php\?res=failed\&reason=reject
240
 
244
 
241
# Option:  ignoreregex
245
# Option:  ignoreregex
242
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
246
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
243
# Values:  TEXT
247
# Values:  TEXT
244
#
248
#
245
ignoreregex = 
249
ignoreregex = 
246
EOF
250
EOF
247
 
251
 
248
#####################
252
#####################
249
## CHANGE-PWD.CONF ##
253
## CHANGE-PWD.CONF ##
250
#####################
254
#####################
251
cat << EOF > $DIR_FILTER/alcasar_change-pwd.conf
255
cat << EOF > $DIR_FILTER/alcasar_change-pwd.conf
252
 
256
 
253
# Fail2Ban configuration file
257
# Fail2Ban configuration file
254
#
258
#
255
# Author: Cyril Jaquier
259
# Author: Cyril Jaquier
256
# Adapted by ALCASAR team
260
# Adapted by ALCASAR team
257
 
261
 
258
[Definition]
262
[Definition]
259
 
263
 
260
# Option:  failregex
264
# Option:  failregex
261
# Notes.:  regex to match the password failure messages in the logfile. The
265
# Notes.:  regex to match the password failure messages in the logfile. The
262
#          host must be matched by a group named "host". The tag "<HOST>" can
266
#          host must be matched by a group named "host". The tag "<HOST>" can
263
#          be used for standard IP/hostname matching and is only an alias for
267
#          be used for standard IP/hostname matching and is only an alias for
264
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
268
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
265
# Values:  TEXT
269
# Values:  TEXT
266
#
270
#
267
failregex = \[<HOST>\] \"POST \/password\.php
271
failregex = \[<HOST>\] \"POST \/password\.php
268
 
272
 
269
 
273
 
270
# Option:  ignoreregex
274
# Option:  ignoreregex
271
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
275
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
272
# Values:  TEXT
276
# Values:  TEXT
273
#
277
#
274
ignoreregex = 
278
ignoreregex = 
275
EOF
279
EOF
276
 
280
 
277
##############################################
281
##############################################
278
##   Log sur ULOG quand iptables-allports   ##
282
##   Log sur ULOG quand iptables-allports   ##
279
##############################################
283
##############################################
280
[ -f $ACTION_ALLPORTS ] && [ ! -e $ACTION_ALLPORTS.default ] && mv $ACTION_ALLPORTS $ACTION_ALLPORTS.default
284
[ -f $ACTION_ALLPORTS ] && [ ! -e $ACTION_ALLPORTS.default ] && mv $ACTION_ALLPORTS $ACTION_ALLPORTS.default
281
cat << EOF > $ACTION_ALLPORTS
285
cat << EOF > $ACTION_ALLPORTS
282
# Fail2Ban configuration file
286
# Fail2Ban configuration file
283
#
287
#
284
# Author: Cyril Jaquier
288
# Author: Cyril Jaquier
285
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
289
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
286
# 			made active on all ports from original iptables.conf
290
# 			made active on all ports from original iptables.conf
287
# Adapted by ALCASAR team
291
# Adapted by ALCASAR team
288
 
292
 
289
[Definition]
293
[Definition]
290
 
294
 
291
# Option:  actionstart
295
# Option:  actionstart
292
# Notes.:  command executed once at the start of Fail2Ban.
296
# Notes.:  command executed once at the start of Fail2Ban.
293
# Values:  CMD
297
# Values:  CMD
294
#
298
#
295
actionstart = iptables -N fail2ban-<name>
299
actionstart = iptables -N fail2ban-<name>
296
              iptables -A fail2ban-<name> -j RETURN
300
              iptables -A fail2ban-<name> -j RETURN
297
              iptables -I <chain> -p <protocol> -j fail2ban-<name>
301
              iptables -I <chain> -p <protocol> -j fail2ban-<name>
298
 
302
 
299
# Option:  actionstop
303
# Option:  actionstop
300
# Notes.:  command executed once at the end of Fail2Ban
304
# Notes.:  command executed once at the end of Fail2Ban
301
# Values:  CMD
305
# Values:  CMD
302
#
306
#
303
actionstop = iptables -D <chain> -p <protocol> -j fail2ban-<name>
307
actionstop = iptables -D <chain> -p <protocol> -j fail2ban-<name>
304
             iptables -F fail2ban-<name>
308
             iptables -F fail2ban-<name>
305
             iptables -X fail2ban-<name>
309
             iptables -X fail2ban-<name>
306
 
310
 
307
# Option:  actioncheck
311
# Option:  actioncheck
308
# Notes.:  command executed once before each actionban command
312
# Notes.:  command executed once before each actionban command
309
# Values:  CMD
313
# Values:  CMD
310
#
314
#
311
actioncheck = iptables -n -L <chain> | grep -q fail2ban-<name>
315
actioncheck = iptables -n -L <chain> | grep -q fail2ban-<name>
312
 
316
 
313
# Option:  actionban
317
# Option:  actionban
314
# Notes.:  command executed when banning an IP. Take care that the
318
# Notes.:  command executed when banning an IP. Take care that the
315
#          command is executed with Fail2Ban user rights.
319
#          command is executed with Fail2Ban user rights.
316
# Tags:    <ip>  IP address
320
# Tags:    <ip>  IP address
317
#          <failures>  number of failures
321
#          <failures>  number of failures
318
#          <time>  unix timestamp of the ban time
322
#          <time>  unix timestamp of the ban time
319
# Values:  CMD
323
# Values:  CMD
320
 
324
 
321
actionban = iptables -I fail2ban-<name> 1 -s <ip> -j DROP
325
actionban = iptables -I fail2ban-<name> 1 -s <ip> -j DROP
322
 
326
 
323
# Option:  actionunban
327
# Option:  actionunban
324
# Notes.:  command executed when unbanning an IP. Take care that the
328
# Notes.:  command executed when unbanning an IP. Take care that the
325
#          command is executed with Fail2Ban user rights.
329
#          command is executed with Fail2Ban user rights.
326
# Tags:    <ip>  IP address
330
# Tags:    <ip>  IP address
327
#          <failures>  number of failures
331
#          <failures>  number of failures
328
#          <time>  unix timestamp of the ban time
332
#          <time>  unix timestamp of the ban time
329
# Values:  CMD
333
# Values:  CMD
330
#
334
#
331
actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP
335
actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP
332
 
336
 
333
[Init]
337
[Init]
334
 
338
 
335
# Defaut name of the chain
339
# Defaut name of the chain
336
#
340
#
337
name = default
341
name = default
338
 
342
 
339
# Option:  protocol
343
# Option:  protocol
340
# Notes.:  internally used by config reader for interpolations.
344
# Notes.:  internally used by config reader for interpolations.
341
# Values:  [ tcp | udp | icmp | all ] Default: tcp
345
# Values:  [ tcp | udp | icmp | all ] Default: tcp
342
#
346
#
343
protocol = tcp
347
protocol = tcp
344
 
348
 
345
# Option:  chain
349
# Option:  chain
346
# Notes    specifies the iptables chain to which the fail2ban rules should be
350
# Notes    specifies the iptables chain to which the fail2ban rules should be
347
#          added
351
#          added
348
# Values:  STRING  Default: INPUT
352
# Values:  STRING  Default: INPUT
349
chain = INPUT
353
chain = INPUT
350
 
354
 
351
EOF
355
EOF
352
 
356