Guest User

Untitled

a guest
Apr 26th, 2014
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.88 KB | None | 0 0
  1. # Fail2Ban configuration file.
  2. #
  3. # This file was composed for Debian systems from the original one
  4. # provided now under /usr/share/doc/fail2ban/examples/jail.conf
  5. # for additional examples.
  6. #
  7. # To avoid merges during upgrades DO NOT MODIFY THIS FILE
  8. # and rather provide your changes in /etc/fail2ban/jail.local
  9. #
  10. # Author: Yaroslav O. Halchenko <[email protected]>
  11. #
  12. # $Revision$
  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
  21. ignoreip = 127.0.0.1/8 83.82.18.53
  22. bantime = 3600
  23. maxretry = 5
  24.  
  25. # "backend" specifies the backend used to get files modification. Available
  26. # options are "gamin", "polling" and "auto".
  27. # yoh: For some reason Debian shipped python-gamin didn't work as expected
  28. # This issue left ToDo, so polling is default backend for now
  29. backend = auto
  30.  
  31. #
  32. # Destination email address used solely for the interpolations in
  33. # jail.{conf,local} configuration files.
  34. destemail = <RECIPIENT>@<DOMAIN>
  35.  
  36. #
  37. # ACTIONS
  38. #
  39.  
  40. # Default banning action (e.g. iptables, iptables-new,
  41. # iptables-multiport, shorewall, etc) It is used to define
  42. # action_* variables. Can be overridden globally or per
  43. # section within jail.local file
  44. banaction = iptables-multiport
  45.  
  46. # email action. Since 0.8.1 upstream fail2ban uses sendmail
  47. # MTA for the mailing. Change mta configuration parameter to mail
  48. # if you want to revert to conventional 'mail'.
  49. mta = sendmail
  50.  
  51. # Default protocol
  52. protocol = tcp
  53.  
  54. # Specify chain where jumps would need to be added in iptables-* actions
  55. chain = INPUT
  56.  
  57. #
  58. # Action shortcuts. To be used to define action parameter
  59.  
  60. # The simplest action to take: ban only
  61. action_ = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
  62.  
  63. # ban & send an e-mail with whois report to the destemail.
  64. action_mw = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
  65. %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
  66.  
  67. # ban & send an e-mail with whois report and relevant log lines
  68. # to the destemail.
  69. action_mwl = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
  70. %(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
  71.  
  72. # ban & send an e-mail with whois report and relevant log lines to abuse department
  73. # to the destemail.
  74. action_mwlabuse = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
  75. %(mta)s-complain[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s", sender=noreply@<DOMAIN>]
  76.  
  77.  
  78.  
  79. # Choose default action. To change, just override value of 'action' with the
  80. # interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local
  81. # globally (section [DEFAULT]) or per specific section
  82. action = %(action_mwlabuse)s
  83.  
  84. #
  85. # JAILS
  86. #
  87.  
  88. # Next jails corresponds to the standard configuration in Fail2ban 0.6 which
  89. # was shipped in Debian. Enable any defined here jail by including
  90. #
  91. # [SECTION_NAME]
  92. # enabled = true
  93.  
  94. #
  95. # in /etc/fail2ban/jail.local.
  96. #
  97. # Optionally you may override any other parameter (e.g. banaction,
  98. # action, port, logpath, etc) in that section within jail.local
  99.  
  100. [ssh]
  101.  
  102. enabled = true
  103. port = ssh
  104. filter = sshd
  105. logpath = /var/log/auth.log
  106. #maxretry = 6
  107. findtime = 3600
  108.  
  109. [dropbear]
  110.  
  111. enabled = false
  112. port = ssh
  113. filter = sshd
  114. logpath = /var/log/dropbear
  115. maxretry = 6
  116.  
  117. # Generic filter for pam. Has to be used with action which bans all ports
  118. # such as iptables-allports, shorewall
  119. [pam-generic]
  120.  
  121. enabled = false
  122. # pam-generic filter can be customized to monitor specific subset of 'tty's
  123. filter = pam-generic
  124. # port actually must be irrelevant but lets leave it all for some possible uses
  125. port = all
  126. banaction = iptables-allports
  127. port = anyport
  128. logpath = /var/log/auth.log
  129. maxretry = 6
  130.  
  131. [xinetd-fail]
  132.  
  133. enabled = false
  134. filter = xinetd-fail
  135. port = all
  136. banaction = iptables-multiport-log
  137. logpath = /var/log/daemon.log
  138. maxretry = 2
  139.  
  140.  
  141. [ssh-ddos]
  142.  
  143. enabled = false
  144. port = ssh
  145. filter = sshd-ddos
  146. logpath = /var/log/auth.log
  147. maxretry = 6
  148.  
  149. #
  150. # HTTP servers
  151. #
  152.  
  153. [apache]
  154.  
  155. enabled = false
  156. port = http,https
  157. filter = apache-auth
  158. logpath = /var/log/apache*/*error.log
  159. maxretry = 6
  160.  
  161. # default action is now multiport, so apache-multiport jail was left
  162. # for compatibility with previous (<0.7.6-2) releases
  163. [apache-multiport]
  164.  
  165. enabled = false
  166. port = http,https
  167. filter = apache-auth
  168. logpath = /var/log/apache*/*error.log
  169. maxretry = 6
  170.  
  171. [apache-noscript]
  172.  
  173. enabled = false
  174. port = http,https
  175. filter = apache-noscript
  176. logpath = /var/log/apache*/*error.log
  177. maxretry = 6
  178.  
  179. [apache-overflows]
  180.  
  181. enabled = false
  182. port = http,https
  183. filter = apache-overflows
  184. logpath = /var/log/apache*/*error.log
  185. maxretry = 2
  186.  
  187. #
  188. # FTP servers
  189. #
  190.  
  191. [vsftpd]
  192.  
  193. enabled = false
  194. port = ftp,ftp-data,ftps,ftps-data
  195. filter = vsftpd
  196. logpath = /var/log/vsftpd.log
  197. # or overwrite it in jails.local to be
  198. # logpath = /var/log/auth.log
  199. # if you want to rely on PAM failed login attempts
  200. # vsftpd's failregex should match both of those formats
  201. maxretry = 6
  202.  
  203.  
  204. [proftpd]
  205.  
  206. enabled = false
  207. port = ftp,ftp-data,ftps,ftps-data
  208. filter = proftpd
  209. logpath = /var/log/proftpd/proftpd.log
  210. maxretry = 6
  211.  
  212.  
  213. [pure-ftpd]
  214.  
  215. enabled = false
  216. port = ftp,ftp-data,ftps,ftps-data
  217. filter = pure-ftpd
  218. logpath = /var/log/auth.log
  219. maxretry = 6
  220.  
  221.  
  222. [wuftpd]
  223.  
  224. enabled = false
  225. port = ftp,ftp-data,ftps,ftps-data
  226. filter = wuftpd
  227. logpath = /var/log/auth.log
  228. maxretry = 6
  229.  
  230.  
  231. #
  232. # Mail servers
  233. #
  234.  
  235. [postfix]
  236.  
  237. enabled = false
  238. port = smtp,ssmtp
  239. filter = postfix
  240. logpath = /var/log/mail.log
  241.  
  242.  
  243. [couriersmtp]
  244.  
  245. enabled = false
  246. port = smtp,ssmtp
  247. filter = couriersmtp
  248. logpath = /var/log/mail.log
  249.  
  250.  
  251. #
  252. # Mail servers authenticators: might be used for smtp,ftp,imap servers, so
  253. # all relevant ports get banned
  254. #
  255.  
  256. [courierauth]
  257.  
  258. enabled = false
  259. port = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
  260. filter = courierlogin
  261. logpath = /var/log/mail.log
  262.  
  263.  
  264. [sasl]
  265.  
  266. enabled = false
  267. port = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
  268. filter = sasl
  269. # You might consider monitoring /var/log/mail.warn instead if you are
  270. # running postfix since it would provide the same log lines at the
  271. # "warn" level but overall at the smaller filesize.
  272. logpath = /var/log/mail.log
  273.  
  274. [dovecot]
  275.  
  276. enabled = false
  277. port = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
  278. filter = dovecot
  279. logpath = /var/log/mail.log
  280.  
  281. # DNS Servers
  282.  
  283.  
  284. # These jails block attacks against named (bind9). By default, logging is off
  285. # with bind9 installation. You will need something like this:
  286. #
  287. # logging {
  288. # channel security_file {
  289. # file "/var/log/named/security.log" versions 3 size 30m;
  290. # severity dynamic;
  291. # print-time yes;
  292. # };
  293. # category security {
  294. # security_file;
  295. # };
  296. # };
  297. #
  298. # in your named.conf to provide proper logging
  299.  
  300. # !!! WARNING !!!
  301. # Since UDP is connection-less protocol, spoofing of IP and imitation
  302. # of illegal actions is way too simple. Thus enabling of this filter
  303. # might provide an easy way for implementing a DoS against a chosen
  304. # victim. See
  305. # http://nion.modprobe.de/blog/archives/690-fail2ban-+-dns-fail.html
  306. # Please DO NOT USE this jail unless you know what you are doing.
  307. #[named-refused-udp]
  308. #
  309. #enabled = false
  310. #port = domain,953
  311. #protocol = udp
  312. #filter = named-refused
  313. #logpath = /var/log/named/security.log
  314.  
  315. [named-refused-tcp]
  316.  
  317. enabled = false
  318. port = domain,953
  319. protocol = tcp
  320. filter = named-refused
  321. logpath = /var/log/named/security.log
Advertisement
Add Comment
Please, Sign In to add comment