Subversion Repositories configs

Rev

Rev 5 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
# Fail2Ban jail base specification file
2
#
3
# HOW TO ACTIVATE JAILS:
4
#
5
# YOU SHOULD NOT MODIFY THIS FILE.
6
#
7
# It will probably be overwitten or improved in a distribution update.
8
#
9
# Provide customizations in a jail.local file or a jail.d/customisation.local.
10
# For example to change the default bantime for all jails and to enable the
11
# ssh-iptables jail the following (uncommented) would appear in the .local file.
12
# See man 5 jail.conf for details.
13
#
14
# [DEFAULT]
15
# bantime = 3600
16
#
17
# [ssh-iptables]
18
# enabled = true
19
 
20
 
21
 
22
# Comments: use '#' for comment lines and ';' (following a space) for inline comments
23
 
24
# The DEFAULT allows a global definition of the options. They can be overridden
25
# in each jail afterwards.
26
 
27
[DEFAULT]
28
 
29
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
30
# ban a host which matches an address in this list. Several addresses can be
31
# defined using space separator.
32
ignoreip = 127.0.0.1/8
33
 
34
# "bantime" is the number of seconds that a host is banned.
35
bantime  = 600
36
 
37
# A host is banned if it has generated "maxretry" during the last "findtime"
38
# seconds.
39
findtime  = 600
40
 
41
# "maxretry" is the number of failures before a host get banned.
42
maxretry = 3
43
 
44
# "backend" specifies the backend used to get files modification.
45
# Available options are "pyinotify", "gamin", "polling" and "auto".
46
# This option can be overridden in each jail as well.
47
#
48
# pyinotify: requires pyinotify (a file alteration monitor) to be installed.
49
#              If pyinotify is not installed, Fail2ban will use auto.
50
# gamin:     requires Gamin (a file alteration monitor) to be installed.
51
#              If Gamin is not installed, Fail2ban will use auto.
52
# polling:   uses a polling algorithm which does not require external libraries.
53
# auto:      will try to use the following backends, in order:
54
#              pyinotify, gamin, polling.
55
backend = auto
56
 
57
# "usedns" specifies if jails should trust hostnames in logs,
58
#   warn when DNS lookups are performed, or ignore all hostnames in logs
59
#
60
# yes:   if a hostname is encountered, a DNS lookup will be performed.
61
# warn:  if a hostname is encountered, a DNS lookup will be performed,
62
#        but it will be logged as a warning.
63
# no:    if a hostname is encountered, will not be used for banning,
64
#        but it will be logged as info.
65
usedns = warn
66
 
67
 
68
# This jail corresponds to the standard configuration in Fail2ban.
69
# The mail-whois action send a notification e-mail with a whois request
70
# in the body.
71
 
72
[ssh-iptables]
73
 
74
enabled  = true
75
filter   = sshd
76
action   = iptables[name=SSH, port=ssh, protocol=tcp]
77
           sendmail-whois[name=SSH, dest=root, sender=fail2ban@example.com, sendername="Fail2Ban"]
78
logpath  = /var/log/secure
79
maxretry = 5
80
 
81
[proftpd-iptables]
82
 
83
enabled  = false
84
filter   = proftpd
85
action   = iptables[name=ProFTPD, port=ftp, protocol=tcp]
86
           sendmail-whois[name=ProFTPD, dest=you@example.com]
87
logpath  = /var/log/proftpd/proftpd.log
88
maxretry = 6
89
 
90
 
91
# This jail forces the backend to "polling".
92
[sasl-iptables]
93
 
94
enabled  = false
95
filter   = postfix-sasl
96
backend  = polling
97
action   = iptables[name=sasl, port=smtp, protocol=tcp]
98
           sendmail-whois[name=sasl, dest=you@example.com]
99
logpath  = /var/log/mail.log
100
 
101
 
102
# ASSP SMTP Proxy Jail
103
[assp]
104
 
105
enabled = false
106
filter  = assp
107
action  = iptables-multiport[name=assp,port="25,465,587"]
108
logpath = /root/path/to/assp/logs/maillog.txt
109
 
110
 
111
# Here we use TCP-Wrappers instead of Netfilter/Iptables. "ignoreregex" is
112
# used to avoid banning the user "myuser".
113
[ssh-tcpwrapper]
114
 
115
enabled     = false
116
filter      = sshd
117
action      = hostsdeny[daemon_list=sshd]
118
              sendmail-whois[name=SSH, dest=you@example.com]
119
ignoreregex = for myuser from
120
logpath     = /var/log/sshd.log
121
 
122
 
123
# Here we use blackhole routes for not requiring any additional kernel support
124
# to store large volumes of banned IPs
125
[ssh-route]
126
 
127
enabled  = false
128
filter   = sshd
129
action   = route
130
logpath  = /var/log/sshd.log
131
maxretry = 5
132
 
133
 
134
# Here we use a combination of Netfilter/Iptables and IPsets
135
# for storing large volumes of banned IPs
136
#
137
# IPset comes in two versions. See ipset -V for which one to use
138
# requires the ipset package and kernel support.
139
[ssh-iptables-ipset4]
140
 
141
enabled  = false
142
filter   = sshd
143
action   = iptables-ipset-proto4[name=SSH, port=ssh, protocol=tcp]
144
logpath  = /var/log/sshd.log
145
maxretry = 5
146
 
147
 
148
[ssh-iptables-ipset6]
149
 
150
enabled  = false
151
filter   = sshd
152
action   = iptables-ipset-proto6[name=SSH, port=ssh, protocol=tcp, bantime=600]
153
logpath  = /var/log/sshd.log
154
maxretry = 5
155
 
156
 
157
# bsd-ipfw is ipfw used by BSD. It uses ipfw tables.
158
# table number must be unique.
159
#
160
# This will create a deny rule for that table ONLY if a rule
161
# for the table doesn't ready exist.
162
#
163
[ssh-bsd-ipfw]
164
 
165
enabled  = false
166
filter   = sshd
167
action   = bsd-ipfw[port=ssh,table=1]
168
logpath  = /var/log/auth.log
169
maxretry = 5
170
 
171
 
172
# This jail demonstrates the use of wildcards in "logpath".
173
# Moreover, it is possible to give other files on a new line.
174
[apache-tcpwrapper]
175
 
176
enabled  = false
177
filter	 = apache-auth
178
action   = hostsdeny
179
logpath  = /var/log/apache*/*error.log
180
           /home/www/myhomepage/error.log
181
maxretry = 6
182
 
183
 
184
[nginx-http-auth]
185
 
186
enabled = false
187
filter  = nginx-http-auth
188
action  = iptables-multiport[name=nginx-http-auth,port="80,443"]
189
logpath = /var/log/nginx/error.log
190
 
191
 
192
# The hosts.deny path can be defined with the "file" argument if it is
193
# not in /etc.
194
[postfix-tcpwrapper]
195
 
196
enabled  = false
197
filter   = postfix
198
action   = hostsdeny[file=/not/a/standard/path/hosts.deny]
199
           sendmail[name=Postfix, dest=you@example.com]
200
logpath  = /var/log/postfix.log
201
bantime  = 300
202
 
203
 
204
# Do not ban anybody. Just report information about the remote host.
205
# A notification is sent at most every 600 seconds (bantime).
206
[vsftpd-notification]
207
 
208
enabled  = false
209
filter   = vsftpd
210
action   = sendmail-whois[name=VSFTPD, dest=you@example.com]
211
logpath  = /var/log/vsftpd.log
212
maxretry = 5
213
bantime  = 1800
214
 
215
 
216
# Same as above but with banning the IP address.
217
[vsftpd-iptables]
218
 
219
enabled  = false
220
filter   = vsftpd
221
action   = iptables[name=VSFTPD, port=ftp, protocol=tcp]
222
           sendmail-whois[name=VSFTPD, dest=you@example.com]
223
logpath  = /var/log/vsftpd.log
224
maxretry = 5
225
bantime  = 1800
226
 
227
 
228
# Ban hosts which agent identifies spammer robots crawling the web
229
# for email addresses. The mail outputs are buffered.
230
[apache-badbots]
231
 
232
enabled  = false
233
filter   = apache-badbots
234
action   = iptables-multiport[name=BadBots, port="http,https"]
235
           sendmail-buffered[name=BadBots, lines=5, dest=you@example.com]
236
logpath  = /var/www/*/logs/access_log
237
bantime  = 172800
238
maxretry = 1
239
 
240
 
241
# Use shorewall instead of iptables.
242
[apache-shorewall]
243
 
244
enabled  = false
245
filter   = apache-noscript
246
action   = shorewall
247
           sendmail[name=Postfix, dest=you@example.com]
248
logpath  = /var/log/apache2/error_log
249
 
250
 
251
# Monitor roundcube server
252
[roundcube-iptables]
253
 
254
enabled  = false
255
filter   = roundcube-auth
256
action   = iptables-multiport[name=RoundCube, port="http,https"]
257
logpath  = /var/log/roundcube/userlogins
258
 
259
 
260
# Monitor SOGo groupware server
261
[sogo-iptables]
262
 
263
enabled  = false
264
filter   = sogo-auth
265
# without proxy this would be:
266
# port    = 20000
267
action   = iptables-multiport[name=SOGo, port="http,https"]
268
logpath  = /var/log/sogo/sogo.log
269
 
270
 
271
# Ban attackers that try to use PHP's URL-fopen() functionality
272
# through GET/POST variables. - Experimental, with more than a year
273
# of usage in production environments.
274
[php-url-fopen]
275
 
276
enabled  = false
277
action   = iptables-multiport[name=php-url-open, port="http,https"]
278
filter   = php-url-fopen
279
logpath  = /var/www/*/logs/access_log
280
maxretry = 1
281
 
282
 
283
[suhosin]
284
 
285
enabled  = false
286
filter   = suhosin
287
action   = iptables-multiport[name=suhosin, port="http,https"]
288
# adapt the following two items as needed
289
logpath  = /var/log/lighttpd/error.log
290
maxretry = 2
291
 
292
 
293
[lighttpd-auth]
294
 
295
enabled  = false
296
filter   = lighttpd-auth
297
action   = iptables-multiport[name=lighttpd-auth, port="http,https"]
298
# adapt the following two items as needed
299
logpath  = /var/log/lighttpd/error.log
300
maxretry = 2
301
 
302
 
303
# This jail uses ipfw, the standard firewall on FreeBSD. The "ignoreip"
304
# option is overridden in this jail. Moreover, the action "mail-whois" defines
305
# the variable "name" which contains a comma using "". The characters '' are
306
# valid too.
307
[ssh-ipfw]
308
 
309
enabled  = false
310
filter   = sshd
311
action   = ipfw[localhost=192.168.0.1]
312
           sendmail-whois[name="SSH,IPFW", dest=you@example.com]
313
logpath  = /var/log/auth.log
314
ignoreip = 168.192.0.1
315
 
316
 
317
# !!! WARNING !!!
318
#   Since UDP is connection-less protocol, spoofing of IP and imitation
319
#   of illegal actions is way too simple.  Thus enabling of this filter
320
#   might provide an easy way for implementing a DoS against a chosen
321
#   victim. See
322
#    http://nion.modprobe.de/blog/archives/690-fail2ban-+-dns-fail.html
323
#   Please DO NOT USE this jail unless you know what you are doing.
324
#
325
# IMPORTANT: see filter.d/named-refused for instructions to enable logging
326
# This jail blocks UDP traffic for DNS requests.
327
# [named-refused-udp]
328
#
329
# enabled  = false
330
# filter   = named-refused
331
# action   = iptables-multiport[name=Named, port="domain,953", protocol=udp]
332
#            sendmail-whois[name=Named, dest=you@example.com]
333
# logpath  = /var/log/named/security.log
334
# ignoreip = 168.192.0.1
335
 
336
# IMPORTANT: see filter.d/named-refused for instructions to enable logging
337
# This jail blocks TCP traffic for DNS requests.
338
[named-refused-tcp]
339
 
340
enabled  = false
341
filter   = named-refused
342
action   = iptables-multiport[name=Named, port="domain,953", protocol=tcp]
343
           sendmail-whois[name=Named, dest=you@example.com]
344
logpath  = /var/log/named/security.log
345
ignoreip = 168.192.0.1
346
 
347
 
348
[asterisk]
349
 
350
enabled  = false
351
filter   = asterisk
352
action   = iptables-multiport[name=asterisk-tcp, port="5060,5061", protocol=tcp]
353
           iptables-multiport[name=asterisk-udp, port="5060,5061", protocol=udp]
354
           sendmail-whois[name=Asterisk, dest=you@example.com, sender=fail2ban@example.com]
355
logpath  = /var/log/asterisk/messages
356
maxretry = 10
357
 
358
#  Historical support (before https://github.com/fail2ban/fail2ban/issues/37 was fixed )
359
#  use [asterisk] for new jails
360
[asterisk-tcp]
361
 
362
enabled  = false
363
filter   = asterisk
364
action   = iptables-multiport[name=asterisk-tcp, port="5060,5061", protocol=tcp]
365
           sendmail-whois[name=Asterisk, dest=you@example.com, sender=fail2ban@example.com]
366
logpath  = /var/log/asterisk/messages
367
maxretry = 10
368
 
369
 
370
#  Historical support (before https://github.com/fail2ban/fail2ban/issues/37 was fixed )
371
#  use [asterisk] for new jails
372
[asterisk-udp]
373
 
374
enabled  = false
375
filter	 = asterisk
376
action   = iptables-multiport[name=asterisk-udp, port="5060,5061", protocol=udp]
377
           sendmail-whois[name=Asterisk, dest=you@example.com, sender=fail2ban@example.com]
378
logpath  = /var/log/asterisk/messages
379
maxretry = 10
380
 
381
 
382
[mysqld-iptables]
383
 
384
enabled  = false
385
filter   = mysqld-auth
386
action   = iptables[name=mysql, port=3306, protocol=tcp]
387
           sendmail-whois[name=MySQL, dest=root, sender=fail2ban@example.com]
388
logpath  = /var/log/mysqld.log
389
maxretry = 5
390
 
391
 
392
[mysqld-syslog-iptables]
393
 
394
enabled  = false
395
filter   = mysqld-auth
396
action   = iptables[name=mysql, port=3306, protocol=tcp]
397
logpath  = /var/log/daemon.log
398
maxretry = 5
399
 
400
 
401
# Jail for more extended banning of persistent abusers
402
# !!! WARNING !!!
403
#   Make sure that your loglevel specified in fail2ban.conf/.local
404
#   is not at DEBUG level -- which might then cause fail2ban to fall into
405
#   an infinite loop constantly feeding itself with non-informative lines
406
[recidive]
407
 
408
enabled  = false
409
filter   = recidive
410
logpath  = /var/log/fail2ban.log
411
action   = iptables-allports[name=recidive]
412
           sendmail-whois-lines[name=recidive, logpath=/var/log/fail2ban.log]
413
bantime  = 604800  ; 1 week
414
findtime = 86400   ; 1 day
415
maxretry = 5
416
 
417
 
418
# PF is a BSD based firewall
419
[ssh-pf]
420
 
421
enabled  = false
422
filter   = sshd
423
action   = pf
424
logpath  = /var/log/sshd.log
425
maxretry = 5
426
 
427
 
428
[3proxy]
429
 
430
enabled = false
431
filter  = 3proxy
432
action  = iptables[name=3proxy, port=3128, protocol=tcp]
433
logpath = /var/log/3proxy.log
434
 
435
 
436
[exim]
437
 
438
enabled = false
439
filter  = exim
440
action  = iptables-multiport[name=exim,port="25,465,587"]
441
logpath = /var/log/exim/mainlog
442
 
443
 
444
[exim-spam]
445
 
446
enabled = false
447
filter  = exim-spam
448
action  = iptables-multiport[name=exim-spam,port="25,465,587"]
449
logpath = /var/log/exim/mainlog
450
 
451
 
452
[perdition]
453
 
454
enabled = false
455
filter  = perdition
456
action  = iptables-multiport[name=perdition,port="110,143,993,995"]
457
logpath = /var/log/maillog
458
 
459
 
460
[uwimap-auth]
461
 
462
enabled = false
463
filter  = uwimap-auth
464
action  = iptables-multiport[name=uwimap-auth,port="110,143,993,995"]
465
logpath = /var/log/maillog
466
 
467
 
468
[osx-ssh-ipfw]
469
 
470
enabled  = false
471
filter   = sshd
472
action   = osx-ipfw
473
logpath  = /var/log/secure.log
474
maxretry = 5
475
 
476
 
477
[ssh-apf]
478
 
479
enabled = false
480
filter  = sshd
481
action  = apf[name=SSH]
482
logpath = /var/log/secure
483
maxretry = 5
484
 
485
 
486
[osx-ssh-afctl]
487
 
488
enabled  = false
489
filter   = sshd
490
action   = osx-afctl[bantime=600]
491
logpath  = /var/log/secure.log
492
maxretry = 5
493
 
494
 
495
[webmin-auth]
496
 
497
enabled = false
498
filter  = webmin-auth
499
action  = iptables-multiport[name=webmin,port="10000"]
500
logpath = /var/log/auth.log
501
 
502
 
503
# dovecot defaults to logging to the mail syslog facility
504
# but can be set by syslog_facility in the dovecot configuration.
505
[dovecot]
506
 
507
enabled = false
508
filter  = dovecot
509
action  = iptables-multiport[name=dovecot, port="pop3,pop3s,imap,imaps,submission,smtps,sieve", protocol=tcp]
510
logpath = /var/log/mail.log
511
 
512
 
513
[dovecot-auth]
514
 
515
enabled = false
516
filter  = dovecot
517
action  = iptables-multiport[name=dovecot-auth, port="pop3,pop3s,imap,imaps,submission,smtps,sieve", protocol=tcp]
518
logpath = /var/log/secure
519
 
520
 
521
[selinux-ssh]
522
enabled = false
523
filter  = selinux-ssh
524
action  = iptables[name=SELINUX-SSH, port=ssh, protocol=tcp]
525
logpath  = /var/log/audit/audit.log
526
maxretry = 5