2006-09-29 04:05:50 +00:00
|
|
|
# Fail2Ban configuration file.
|
|
|
|
#
|
|
|
|
# This file was composed for Debian systems from the original one
|
|
|
|
# provided now under /usr/share/doc/fail2ban/examples/jail.conf
|
|
|
|
# for additional examples.
|
|
|
|
#
|
2006-11-06 14:23:58 +00:00
|
|
|
# To avoid merges during upgrades DO NOT MODIFY THIS FILE
|
2006-09-29 04:05:50 +00:00
|
|
|
# and rather provide your changes in /etc/fail2ban/jail.local
|
|
|
|
#
|
|
|
|
# Author: Yaroslav O. Halchenko <debian@onerussian.com>
|
|
|
|
#
|
|
|
|
# $Revision: 281 $
|
|
|
|
#
|
|
|
|
|
2010-09-27 13:16:34 +00:00
|
|
|
# The DEFAULT allows a global definition of the options. They can be overridden
|
2006-09-29 04:05:50 +00:00
|
|
|
# in each jail afterwards.
|
|
|
|
|
|
|
|
[DEFAULT]
|
|
|
|
|
|
|
|
# "ignoreip" can be an IP address, a CIDR mask or a DNS host
|
2010-09-27 13:11:47 +00:00
|
|
|
ignoreip = 127.0.0.1/8
|
2006-09-29 04:05:50 +00:00
|
|
|
bantime = 600
|
|
|
|
maxretry = 3
|
|
|
|
|
2006-11-02 02:04:57 +00:00
|
|
|
# "backend" specifies the backend used to get files modification. Available
|
|
|
|
# options are "gamin", "polling" and "auto".
|
|
|
|
# yoh: For some reason Debian shipped python-gamin didn't work as expected
|
|
|
|
# This issue left ToDo, so polling is default backend for now
|
2011-07-29 02:47:40 +00:00
|
|
|
backend = auto
|
2006-11-02 02:04:57 +00:00
|
|
|
|
|
|
|
#
|
2006-09-29 04:05:50 +00:00
|
|
|
# Destination email address used solely for the interpolations in
|
|
|
|
# jail.{conf,local} configuration files.
|
|
|
|
destemail = root@localhost
|
|
|
|
|
2007-01-04 18:08:09 +00:00
|
|
|
#
|
|
|
|
# ACTIONS
|
|
|
|
#
|
|
|
|
|
|
|
|
# Default banning action (e.g. iptables, iptables-new,
|
2011-03-23 20:59:39 +00:00
|
|
|
# iptables-multiport, shorewall, etc) It is used to define
|
|
|
|
# action_* variables. Can be overridden globally or per
|
2007-01-04 19:47:00 +00:00
|
|
|
# section within jail.local file
|
2007-01-18 15:41:49 +00:00
|
|
|
banaction = iptables-multiport
|
2007-01-04 18:08:09 +00:00
|
|
|
|
2007-08-15 02:39:54 +00:00
|
|
|
# email action. Since 0.8.1 upstream fail2ban uses sendmail
|
|
|
|
# MTA for the mailing. Change mta configuration parameter to mail
|
|
|
|
# if you want to revert to conventional 'mail'.
|
|
|
|
mta = sendmail
|
2006-10-30 03:32:29 +00:00
|
|
|
|
2007-07-25 03:46:41 +00:00
|
|
|
# Default protocol
|
|
|
|
protocol = tcp
|
|
|
|
|
2011-03-23 20:59:39 +00:00
|
|
|
# Specify chain where jumps would need to be added in iptables-* actions
|
|
|
|
chain = INPUT
|
|
|
|
|
2007-01-04 19:47:00 +00:00
|
|
|
#
|
|
|
|
# Action shortcuts. To be used to define action parameter
|
|
|
|
|
|
|
|
# The simplest action to take: ban only
|
2011-03-23 20:59:39 +00:00
|
|
|
action_ = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
2006-09-29 04:05:50 +00:00
|
|
|
|
2007-01-04 19:47:00 +00:00
|
|
|
# ban & send an e-mail with whois report to the destemail.
|
2011-03-23 20:59:39 +00:00
|
|
|
action_mw = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
|
|
|
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
|
2006-12-10 23:40:04 +00:00
|
|
|
|
2007-01-04 19:47:00 +00:00
|
|
|
# ban & send an e-mail with whois report and relevant log lines
|
|
|
|
# to the destemail.
|
2011-03-23 20:59:39 +00:00
|
|
|
action_mwl = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
|
|
|
%(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
|
|
|
|
|
2007-01-04 18:08:09 +00:00
|
|
|
# Choose default action. To change, just override value of 'action' with the
|
2007-01-04 19:47:00 +00:00
|
|
|
# interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local
|
2011-03-23 20:59:39 +00:00
|
|
|
# globally (section [DEFAULT]) or per specific section
|
2007-01-04 19:47:00 +00:00
|
|
|
action = %(action_)s
|
2007-01-04 18:08:09 +00:00
|
|
|
|
2006-09-29 04:05:50 +00:00
|
|
|
#
|
2007-01-04 18:08:09 +00:00
|
|
|
# JAILS
|
|
|
|
#
|
|
|
|
|
|
|
|
# Next jails corresponds to the standard configuration in Fail2ban 0.6 which
|
2007-08-15 02:39:54 +00:00
|
|
|
# was shipped in Debian. Enable any defined here jail by including
|
2007-01-04 18:08:09 +00:00
|
|
|
#
|
2011-03-23 20:59:39 +00:00
|
|
|
# [SECTION_NAME]
|
2006-09-29 04:05:50 +00:00
|
|
|
# enabled = true
|
2007-07-25 03:46:41 +00:00
|
|
|
|
2006-09-29 04:05:50 +00:00
|
|
|
#
|
2006-12-10 23:40:04 +00:00
|
|
|
# in /etc/fail2ban/jail.local.
|
2006-09-29 04:05:50 +00:00
|
|
|
#
|
2007-01-04 18:08:09 +00:00
|
|
|
# Optionally you may override any other parameter (e.g. banaction,
|
|
|
|
# action, port, logpath, etc) in that section within jail.local
|
2006-09-29 04:21:16 +00:00
|
|
|
|
2006-09-29 13:22:23 +00:00
|
|
|
[ssh]
|
2006-09-29 04:05:50 +00:00
|
|
|
|
2011-03-23 21:22:21 +00:00
|
|
|
enabled = true
|
|
|
|
port = ssh
|
|
|
|
filter = sshd
|
2006-09-29 04:05:50 +00:00
|
|
|
logpath = /var/log/auth.log
|
|
|
|
maxretry = 6
|
|
|
|
|
2011-03-23 21:22:21 +00:00
|
|
|
[dropbear]
|
|
|
|
|
|
|
|
enabled = false
|
|
|
|
port = ssh
|
|
|
|
filter = sshd
|
|
|
|
logpath = /var/log/dropbear
|
|
|
|
maxretry = 6
|
|
|
|
|
2007-06-25 16:51:05 +00:00
|
|
|
# Generic filter for pam. Has to be used with action which bans all ports
|
|
|
|
# such as iptables-allports, shorewall
|
|
|
|
[pam-generic]
|
|
|
|
|
2011-03-23 21:22:21 +00:00
|
|
|
enabled = false
|
2007-06-25 17:08:49 +00:00
|
|
|
# pam-generic filter can be customized to monitor specific subset of 'tty's
|
2011-03-23 21:22:21 +00:00
|
|
|
filter = pam-generic
|
2007-06-25 17:08:49 +00:00
|
|
|
# port actually must be irrelevant but lets leave it all for some possible uses
|
2011-03-23 21:22:21 +00:00
|
|
|
port = all
|
2007-06-25 16:51:05 +00:00
|
|
|
banaction = iptables-allports
|
2007-07-05 17:12:17 +00:00
|
|
|
port = anyport
|
2007-06-25 16:51:05 +00:00
|
|
|
logpath = /var/log/auth.log
|
|
|
|
maxretry = 6
|
|
|
|
|
2008-03-06 04:28:57 +00:00
|
|
|
[xinetd-fail]
|
|
|
|
|
|
|
|
enabled = false
|
|
|
|
filter = xinetd-fail
|
|
|
|
port = all
|
|
|
|
banaction = iptables-multiport-log
|
|
|
|
logpath = /var/log/daemon.log
|
|
|
|
maxretry = 2
|
|
|
|
|
2006-12-28 07:28:53 +00:00
|
|
|
|
|
|
|
[ssh-ddos]
|
|
|
|
|
2011-03-23 21:22:21 +00:00
|
|
|
enabled = false
|
|
|
|
port = ssh
|
|
|
|
filter = sshd-ddos
|
2006-12-28 07:28:53 +00:00
|
|
|
logpath = /var/log/auth.log
|
|
|
|
maxretry = 6
|
|
|
|
|
2006-09-29 04:21:16 +00:00
|
|
|
#
|
|
|
|
# HTTP servers
|
|
|
|
#
|
|
|
|
|
2006-09-29 13:22:23 +00:00
|
|
|
[apache]
|
2006-09-29 04:05:50 +00:00
|
|
|
|
2011-03-23 21:22:21 +00:00
|
|
|
enabled = false
|
|
|
|
port = http,https
|
|
|
|
filter = apache-auth
|
|
|
|
logpath = /var/log/apache*/*error.log
|
2006-09-29 04:05:50 +00:00
|
|
|
maxretry = 6
|
|
|
|
|
2007-01-18 15:41:49 +00:00
|
|
|
# default action is now multiport, so apache-multiport jail was left
|
|
|
|
# for compatibility with previous (<0.7.6-2) releases
|
2007-01-04 18:08:09 +00:00
|
|
|
[apache-multiport]
|
|
|
|
|
|
|
|
enabled = false
|
2011-03-23 21:22:21 +00:00
|
|
|
port = http,https
|
|
|
|
filter = apache-auth
|
2008-03-06 04:14:22 +00:00
|
|
|
logpath = /var/log/apache*/*error.log
|
2007-01-04 18:08:09 +00:00
|
|
|
maxretry = 6
|
2006-10-18 05:15:53 +00:00
|
|
|
|
2006-10-30 03:32:29 +00:00
|
|
|
[apache-noscript]
|
|
|
|
|
2011-03-23 21:22:21 +00:00
|
|
|
enabled = false
|
|
|
|
port = http,https
|
|
|
|
filter = apache-noscript
|
|
|
|
logpath = /var/log/apache*/*error.log
|
2006-10-30 03:32:29 +00:00
|
|
|
maxretry = 6
|
|
|
|
|
2008-03-06 04:28:57 +00:00
|
|
|
[apache-overflows]
|
|
|
|
|
2011-03-23 21:22:21 +00:00
|
|
|
enabled = false
|
|
|
|
port = http,https
|
|
|
|
filter = apache-overflows
|
|
|
|
logpath = /var/log/apache*/*error.log
|
2008-03-06 04:28:57 +00:00
|
|
|
maxretry = 2
|
|
|
|
|
2006-09-29 04:21:16 +00:00
|
|
|
#
|
|
|
|
# FTP servers
|
|
|
|
#
|
2006-09-29 04:05:50 +00:00
|
|
|
|
2006-09-29 13:22:23 +00:00
|
|
|
[vsftpd]
|
2006-09-29 04:05:50 +00:00
|
|
|
|
|
|
|
enabled = false
|
2011-03-23 21:22:21 +00:00
|
|
|
port = ftp,ftp-data,ftps,ftps-data
|
2006-09-29 04:21:16 +00:00
|
|
|
filter = vsftpd
|
2006-12-21 16:54:39 +00:00
|
|
|
logpath = /var/log/vsftpd.log
|
2006-12-22 04:54:14 +00:00
|
|
|
# or overwrite it in jails.local to be
|
|
|
|
# logpath = /var/log/auth.log
|
|
|
|
# if you want to rely on PAM failed login attempts
|
|
|
|
# vsftpd's failregex should match both of those formats
|
2006-09-29 04:21:16 +00:00
|
|
|
maxretry = 6
|
2006-09-29 04:05:50 +00:00
|
|
|
|
|
|
|
|
2006-09-29 13:22:23 +00:00
|
|
|
[proftpd]
|
2006-09-29 04:05:50 +00:00
|
|
|
|
|
|
|
enabled = false
|
2011-03-23 21:22:21 +00:00
|
|
|
port = ftp,ftp-data,ftps,ftps-data
|
2006-09-29 04:21:16 +00:00
|
|
|
filter = proftpd
|
|
|
|
logpath = /var/log/proftpd/proftpd.log
|
2006-09-29 04:05:50 +00:00
|
|
|
maxretry = 6
|
|
|
|
|
2006-10-18 05:15:53 +00:00
|
|
|
|
|
|
|
[wuftpd]
|
|
|
|
|
|
|
|
enabled = false
|
2011-03-23 21:22:21 +00:00
|
|
|
port = ftp,ftp-data,ftps,ftps-data
|
2006-10-18 05:15:53 +00:00
|
|
|
filter = wuftpd
|
|
|
|
logpath = /var/log/auth.log
|
|
|
|
maxretry = 6
|
|
|
|
|
|
|
|
|
2006-09-29 04:21:16 +00:00
|
|
|
#
|
|
|
|
# Mail servers
|
|
|
|
#
|
|
|
|
|
2006-09-29 13:22:23 +00:00
|
|
|
[postfix]
|
2006-09-29 04:21:16 +00:00
|
|
|
|
|
|
|
enabled = false
|
2011-03-23 21:22:21 +00:00
|
|
|
port = smtp,ssmtp
|
2006-09-29 04:21:16 +00:00
|
|
|
filter = postfix
|
2007-01-04 20:25:45 +00:00
|
|
|
logpath = /var/log/mail.log
|
2006-09-29 04:21:16 +00:00
|
|
|
|
2006-09-29 04:05:50 +00:00
|
|
|
|
2006-09-29 13:22:23 +00:00
|
|
|
[couriersmtp]
|
2006-09-29 04:05:50 +00:00
|
|
|
|
|
|
|
enabled = false
|
2011-03-23 21:22:21 +00:00
|
|
|
port = smtp,ssmtp
|
2006-09-29 04:05:50 +00:00
|
|
|
filter = couriersmtp
|
|
|
|
logpath = /var/log/mail.log
|
|
|
|
|
2006-09-29 04:21:16 +00:00
|
|
|
|
2007-01-18 15:41:49 +00:00
|
|
|
#
|
|
|
|
# Mail servers authenticators: might be used for smtp,ftp,imap servers, so
|
|
|
|
# all relevant ports get banned
|
|
|
|
#
|
|
|
|
|
|
|
|
[courierauth]
|
|
|
|
|
|
|
|
enabled = false
|
2011-03-23 21:22:21 +00:00
|
|
|
port = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
|
2007-01-18 15:52:48 +00:00
|
|
|
filter = courierlogin
|
2007-01-18 15:41:49 +00:00
|
|
|
logpath = /var/log/mail.log
|
|
|
|
|
|
|
|
|
2006-09-29 13:22:23 +00:00
|
|
|
[sasl]
|
2006-09-29 04:21:16 +00:00
|
|
|
|
|
|
|
enabled = false
|
2011-03-23 21:22:21 +00:00
|
|
|
port = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
|
2006-09-29 04:21:16 +00:00
|
|
|
filter = sasl
|
2011-03-23 20:09:00 +00:00
|
|
|
# You might consider monitoring /var/log/mail.warn instead if you are
|
|
|
|
# running postfix since it would provide the same log lines at the
|
|
|
|
# "warn" level but overall at the smaller filesize.
|
2006-09-29 04:21:16 +00:00
|
|
|
logpath = /var/log/mail.log
|
2007-07-24 18:10:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
# DNS Servers
|
|
|
|
|
2008-03-06 04:18:04 +00:00
|
|
|
|
|
|
|
# These jails block attacks against named (bind9). By default, logging is off
|
|
|
|
# with bind9 installation. You will need something like this:
|
|
|
|
#
|
2007-07-24 18:10:05 +00:00
|
|
|
# logging {
|
2008-03-06 04:18:04 +00:00
|
|
|
# channel security_file {
|
|
|
|
# file "/var/log/named/security.log" versions 3 size 30m;
|
|
|
|
# severity dynamic;
|
|
|
|
# print-time yes;
|
|
|
|
# };
|
|
|
|
# category security {
|
|
|
|
# security_file;
|
|
|
|
# };
|
2009-02-03 04:01:17 +00:00
|
|
|
# };
|
2008-03-06 04:18:04 +00:00
|
|
|
#
|
2007-07-24 18:10:05 +00:00
|
|
|
# in your named.conf to provide proper logging
|
|
|
|
|
2010-06-29 01:45:47 +00:00
|
|
|
# !!! WARNING !!!
|
2010-09-27 13:16:34 +00:00
|
|
|
# Since UDP is connection-less protocol, spoofing of IP and imitation
|
2010-06-29 01:45:47 +00:00
|
|
|
# of illegal actions is way too simple. Thus enabling of this filter
|
|
|
|
# might provide an easy way for implementing a DoS against a chosen
|
|
|
|
# victim. See
|
|
|
|
# http://nion.modprobe.de/blog/archives/690-fail2ban-+-dns-fail.html
|
|
|
|
# Please DO NOT USE this jail unless you know what you are doing.
|
|
|
|
#[named-refused-udp]
|
|
|
|
#
|
|
|
|
#enabled = false
|
|
|
|
#port = domain,953
|
|
|
|
#protocol = udp
|
|
|
|
#filter = named-refused
|
|
|
|
#logpath = /var/log/named/security.log
|
2007-07-29 17:20:23 +00:00
|
|
|
|
|
|
|
[named-refused-tcp]
|
|
|
|
|
|
|
|
enabled = false
|
|
|
|
port = domain,953
|
|
|
|
protocol = tcp
|
|
|
|
filter = named-refused
|
2007-08-17 16:45:18 +00:00
|
|
|
logpath = /var/log/named/security.log
|
2007-07-29 17:20:23 +00:00
|
|
|
|