Guest User

/etc/fail2ban/jail.conf

a guest
Sep 18th, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.64 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
  22. bantime  = 600
  23. maxretry = 3
  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 = awaax@betacraft.fr
  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. # Choose default action.  To change, just override value of 'action' with the
  73. # interpolation to the chosen action shortcut (e.g.  action_mw, action_mwl, etc) in jail.local
  74. # globally (section [DEFAULT]) or per specific section
  75. action = %(action_mw)s
  76.  
  77. #
  78. # JAILS
  79. #
  80.  
  81. # Next jails corresponds to the standard configuration in Fail2ban 0.6 which
  82. # was shipped in Debian. Enable any defined here jail by including
  83. #
  84. # [SECTION_NAME]
  85. # enabled = true
  86.  
  87. #
  88. # in /etc/fail2ban/jail.local.
  89. #
  90. # Optionally you may override any other parameter (e.g. banaction,
  91. # action, port, logpath, etc) in that section within jail.local
  92.  
  93. [ssh]
  94.  
  95. enabled  = true
  96. port     = ssh
  97. filter   = sshd
  98. logpath  = /var/log/auth.log
  99. maxretry = 6
  100.  
  101. [dropbear]
  102.  
  103. enabled  = false
  104. port     = ssh
  105. filter   = sshd
  106. logpath  = /var/log/dropbear
  107. maxretry = 6
  108.  
  109. # Generic filter for pam. Has to be used with action which bans all ports
  110. # such as iptables-allports, shorewall
  111. [pam-generic]
  112.  
  113. enabled  = false
  114. # pam-generic filter can be customized to monitor specific subset of 'tty's
  115. filter   = pam-generic
  116. # port actually must be irrelevant but lets leave it all for some possible uses
  117. port     = all
  118. banaction = iptables-allports
  119. port     = anyport
  120. logpath  = /var/log/auth.log
  121. maxretry = 6
  122.  
  123. [xinetd-fail]
  124.  
  125. enabled   = false
  126. filter    = xinetd-fail
  127. port      = all
  128. banaction = iptables-multiport-log
  129. logpath   = /var/log/daemon.log
  130. maxretry  = 2
  131.  
  132.  
  133. [ssh-ddos]
  134.  
  135. enabled  = false
  136. port     = ssh
  137. filter   = sshd-ddos
  138. logpath  = /var/log/auth.log
  139. maxretry = 6
  140.  
  141. #
  142. # HTTP servers
  143. #
  144.  
  145. [apache]
  146.  
  147. enabled  = false
  148. port     = http,https
  149. filter   = apache-auth
  150. logpath  = /var/log/apache*/*error.log
  151. maxretry = 6
  152.  
  153. # default action is now multiport, so apache-multiport jail was left
  154. # for compatibility with previous (<0.7.6-2) releases
  155. [apache-multiport]
  156.  
  157. enabled   = false
  158. port      = http,https
  159. filter    = apache-auth
  160. logpath   = /var/log/apache*/*error.log
  161. maxretry  = 6
  162.  
  163. [apache-noscript]
  164.  
  165. enabled  = false
  166. port     = http,https
  167. filter   = apache-noscript
  168. logpath  = /var/log/apache*/*error.log
  169. maxretry = 6
  170.  
  171. [apache-overflows]
  172.  
  173. enabled  = false
  174. port     = http,https
  175. filter   = apache-overflows
  176. logpath  = /var/log/apache*/*error.log
  177. maxretry = 2
  178.  
  179. #
  180. # FTP servers
  181. #
  182.  
  183. [vsftpd]
  184.  
  185. enabled  = false
  186. port     = ftp,ftp-data,ftps,ftps-data
  187. filter   = vsftpd
  188. logpath  = /var/log/vsftpd.log
  189. # or overwrite it in jails.local to be
  190. # logpath = /var/log/auth.log
  191. # if you want to rely on PAM failed login attempts
  192. # vsftpd's failregex should match both of those formats
  193. maxretry = 6
  194.  
  195.  
  196. [proftpd]
  197.  
  198. enabled  = false
  199. port     = ftp,ftp-data,ftps,ftps-data
  200. filter   = proftpd
  201. logpath  = /var/log/proftpd/proftpd.log
  202. maxretry = 6
  203.  
  204.  
  205. [pure-ftpd]
  206.  
  207. enabled  = false
  208. port     = ftp,ftp-data,ftps,ftps-data
  209. filter   = pure-ftpd
  210. logpath  = /var/log/auth.log
  211. maxretry = 6
  212.  
  213.  
  214. [wuftpd]
  215.  
  216. enabled  = false
  217. port     = ftp,ftp-data,ftps,ftps-data
  218. filter   = wuftpd
  219. logpath  = /var/log/auth.log
  220. maxretry = 6
  221.  
  222.  
  223. #
  224. # Mail servers
  225. #
  226.  
  227. [postfix]
  228.  
  229. enabled  = false
  230. port     = smtp,ssmtp
  231. filter   = postfix
  232. logpath  = /var/log/mail.log
  233.  
  234.  
  235. [couriersmtp]
  236.  
  237. enabled  = false
  238. port     = smtp,ssmtp
  239. filter   = couriersmtp
  240. logpath  = /var/log/mail.log
  241.  
  242.  
  243. #
  244. # Mail servers authenticators: might be used for smtp,ftp,imap servers, so
  245. # all relevant ports get banned
  246. #
  247.  
  248. [courierauth]
  249.  
  250. enabled  = false
  251. port     = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
  252. filter   = courierlogin
  253. logpath  = /var/log/mail.log
  254.  
  255.  
  256. [sasl]
  257.  
  258. enabled  = false
  259. port     = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
  260. filter   = sasl
  261. # You might consider monitoring /var/log/mail.warn instead if you are
  262. # running postfix since it would provide the same log lines at the
  263. # "warn" level but overall at the smaller filesize.
  264. logpath  = /var/log/mail.log
  265.  
  266. [dovecot]
  267.  
  268. enabled = false
  269. port    = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
  270. filter  = dovecot
  271. logpath = /var/log/mail.log
  272.  
  273. # DNS Servers
  274.  
  275.  
  276. # These jails block attacks against named (bind9). By default, logging is off
  277. # with bind9 installation. You will need something like this:
  278. #
  279. # logging {
  280. #     channel security_file {
  281. #         file "/var/log/named/security.log" versions 3 size 30m;
  282. #         severity dynamic;
  283. #         print-time yes;
  284. #     };
  285. #     category security {
  286. #         security_file;
  287. #     };
  288. # };
  289. #
  290. # in your named.conf to provide proper logging
  291.  
  292. # !!! WARNING !!!
  293. #   Since UDP is connection-less protocol, spoofing of IP and imitation
  294. #   of illegal actions is way too simple.  Thus enabling of this filter
  295. #   might provide an easy way for implementing a DoS against a chosen
  296. #   victim. See
  297. #    http://nion.modprobe.de/blog/archives/690-fail2ban-+-dns-fail.html
  298. #   Please DO NOT USE this jail unless you know what you are doing.
  299. #[named-refused-udp]
  300. #
  301. #enabled  = false
  302. #port     = domain,953
  303. #protocol = udp
  304. #filter   = named-refused
  305. #logpath  = /var/log/named/security.log
  306.  
  307. [named-refused-tcp]
  308.  
  309. enabled  = false
  310. port     = domain,953
  311. protocol = tcp
  312. filter   = named-refused
  313. logpath  = /var/log/named/security.log
  314.  
  315. [apache-nodnsuse]
  316.  
  317. enabled = true
  318. port    = http, https
  319. filter  = apache-nodnsuse
  320. logpath = /var/log/apache*/*error.log
  321. maxretry = 1
  322. banTime = 86400
Advertisement
Add Comment
Please, Sign In to add comment