Subversion Repositories configs

Rev

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

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