Advertisement
ovizii

jail.local

Apr 26th, 2017
1,453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.68 KB | None | 0 0
  1. [INCLUDES]
  2.  
  3. #before = paths-distro.conf
  4. before = paths-fedora.conf
  5.  
  6. # The DEFAULT allows a global definition of the options. They can be overridden
  7. # in each jail afterwards.
  8.  
  9. [DEFAULT]
  10.  
  11. #
  12. # MISCELLANEOUS OPTIONS
  13. #
  14.  
  15. # "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
  16. # ban a host which matches an address in this list. Several addresses can be
  17. # defined using space (and/or comma) separator.
  18. ignoreip = 127.0.0.1/8
  19.  
  20. # External command that will take an tagged arguments to ignore, e.g. <ip>,
  21. # and return true if the IP is to be ignored. False otherwise.
  22. #
  23. # ignorecommand = /path/to/command <ip>
  24. ignorecommand =
  25.  
  26. # "bantime" is the number of seconds that a host is banned.
  27. # 86400 = 24h
  28. bantime = 43200
  29.  
  30. # A host is banned if it has generated "maxretry" during the last "findtime"
  31. # seconds.
  32. #findtime = 600
  33. # 43200 = 12h
  34. findtime = 86400
  35.  
  36. # "maxretry" is the number of failures before a host get banned.
  37. maxretry = 5
  38.  
  39. # "backend" specifies the backend used to get files modification.
  40. # Available options are "pyinotify", "gamin", "polling", "systemd" and "auto".
  41. # This option can be overridden in each jail as well.
  42. #
  43. # pyinotify: requires pyinotify (a file alteration monitor) to be installed.
  44. # If pyinotify is not installed, Fail2ban will use auto.
  45. # gamin: requires Gamin (a file alteration monitor) to be installed.
  46. # If Gamin is not installed, Fail2ban will use auto.
  47. # polling: uses a polling algorithm which does not require external libraries.
  48. # systemd: uses systemd python library to access the systemd journal.
  49. # Specifying "logpath" is not valid for this backend.
  50. # See "journalmatch" in the jails associated filter config
  51. # auto: will try to use the following backends, in order:
  52. # pyinotify, gamin, polling.
  53. #
  54. # Note: if systemd backend is chosen as the default but you enable a jail
  55. # for which logs are present only in its own log files, specify some other
  56. # backend for that jail (e.g. polling) and provide empty value for
  57. # journalmatch. See https://github.com/fail2ban/fail2ban/issues/959#issuecomment-74901200
  58. backend = auto
  59.  
  60. # "usedns" specifies if jails should trust hostnames in logs,
  61. # warn when DNS lookups are performed, or ignore all hostnames in logs
  62. #
  63. # yes: if a hostname is encountered, a DNS lookup will be performed.
  64. # warn: if a hostname is encountered, a DNS lookup will be performed,
  65. # but it will be logged as a warning.
  66. # no: if a hostname is encountered, will not be used for banning,
  67. # but it will be logged as info.
  68. usedns = no
  69.  
  70. # "logencoding" specifies the encoding of the log files handled by the jail
  71. # This is used to decode the lines from the log file.
  72. # Typical examples: "ascii", "utf-8"
  73. #
  74. # auto: will use the system locale setting
  75. logencoding = auto
  76.  
  77. # "enabled" enables the jails.
  78. # By default all jails are disabled, and it should stay this way.
  79. # Enable only relevant to your setup jails in your .local or jail.d/*.conf
  80. #
  81. # true: jail will be enabled and log files will get monitored for changes
  82. # false: jail is not enabled
  83. enabled = false
  84.  
  85.  
  86. # "filter" defines the filter to use by the jail.
  87. # By default jails have names matching their filter name
  88. #
  89. filter = %(__name__)s
  90.  
  91.  
  92. #
  93. # ACTIONS
  94. #
  95.  
  96. # Some options used for actions
  97.  
  98. # Destination email address used solely for the interpolations in
  99. # jail.{conf,local,d/*} configuration files.
  100. destemail = administrator@mydomain.tld
  101.  
  102. # Sender email address used solely for some actions
  103. sender = fail2ban
  104.  
  105. # E-mail action. Since 0.8.1 Fail2Ban uses sendmail MTA for the
  106. # mailing. Change mta configuration parameter to mail if you want to
  107. # revert to conventional 'mail'.
  108. #mta = sendmail
  109. mta = mail
  110.  
  111. # Default protocol
  112. protocol = tcp
  113.  
  114. # Specify chain where jumps would need to be added in iptables-* actions
  115. chain = INPUT
  116.  
  117. # Ports to be banned
  118. # Usually should be overridden in a particular jail
  119. port = 0:65535
  120.  
  121. # Format of user-agent https://tools.ietf.org/html/rfc7231#section-5.5.3
  122. fail2ban_agent = Fail2Ban/%(fail2ban_version)s
  123.  
  124. #
  125. # Action shortcuts. To be used to define action parameter
  126.  
  127. # Default banning action (e.g. iptables, iptables-new,
  128. # iptables-multiport, shorewall, etc) It is used to define
  129. # action_* variables. Can be overridden globally or per
  130. # section within jail.local file
  131. banaction = iptables-multiport
  132. banaction_allports = iptables-allports
  133.  
  134. #disabled the action with _MWL as that sends out emails :-/
  135. #action = %(action_mwl)s
  136. action = %(action_)s
  137.  
  138.  
  139. #
  140. # Mail servers
  141. #
  142.  
  143. [postfix]
  144. enabled = true
  145. port = smtp,465,submission
  146. logpath = %(postfix_log)s
  147. backend = %(postfix_backend)s
  148. action = %(action_mwl)s
  149.  
  150. [postfix-rbl]
  151. enabled = true
  152. port = smtp,465,submission
  153. logpath = %(postfix_log)s
  154. backend = %(postfix_backend)s
  155. action = %(action_mwl)s
  156. maxretry = 5
  157.  
  158. [postfix-sasl]
  159. enabled = true
  160. port = smtp,465,submission,imap3,imaps,pop3,pop3s
  161. logpath = %(postfix_log)s
  162. backend = %(postfix_backend)s
  163.  
  164. maxretry = 5
  165.  
  166. # Jail for more extended banning of persistent abusers
  167. # !!! WARNINGS !!!
  168. # 1. Make sure that your loglevel specified in fail2ban.conf/.local
  169. # is not at DEBUG level -- which might then cause fail2ban to fall into
  170. # an infinite loop constantly feeding itself with non-informative lines
  171. # 2. Increase dbpurgeage defined in fail2ban.conf to e.g. 648000 (7.5 days)
  172. # to maintain entries for failed logins for sufficient amount of time
  173.  
  174. [recidive]
  175. #enabled = true
  176. logpath = /var/log/messages
  177. banaction = %(banaction_allports)s
  178. bantime = 604800 ; 1 week
  179. findtime = 259200 ; 3 days
  180. maxretry = 5
  181. action = %(action_mwl)s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement