jail.local 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984
  1. # See jail.conf(5) man page for more information
  2. # Comments: use '#' for comment lines and ';' (following a space) for inline comments
  3. [INCLUDES]
  4. #before = paths-distro.conf
  5. before = paths-debian.conf
  6. # The DEFAULT allows a global definition of the options. They can be overridden
  7. # in each jail afterwards.
  8. ### Default ### {{{
  9. [DEFAULT]
  10. ### Misc Options ### {{{
  11. #
  12. # MISCELLANEOUS OPTIONS
  13. #
  14. # "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
  15. # ban a host which matches an address in this list. Several addresses can be
  16. # defined using space separator.
  17. ## Local host, and MA
  18. ignoreip = 127.0.0.1 205.166.94.31 2600:3c03::f03c:91ff:fe56:c573
  19. # External command that will take an tagged arguments to ignore, e.g. <ip>,
  20. # and return true if the IP is to be ignored. False otherwise.
  21. #
  22. # ignorecommand = /path/to/command <ip>
  23. ignorecommand =
  24. # "bantime" is the number of seconds that a host is banned.
  25. ## Three days
  26. bantime = 259200
  27. # A host is banned if it has generated "maxretry" during the last "findtime"
  28. ## one day
  29. findtime = 86400
  30. # "maxretry" is the number of failures before a host get banned.
  31. maxretry = 5
  32. # "backend" specifies the backend used to get files modification.
  33. # Available options are "pyinotify", "gamin", "polling", "systemd" and "auto".
  34. # This option can be overridden in each jail as well.
  35. #
  36. # pyinotify: requires pyinotify (a file alteration monitor) to be installed.
  37. # If pyinotify is not installed, Fail2ban will use auto.
  38. # gamin: requires Gamin (a file alteration monitor) to be installed.
  39. # If Gamin is not installed, Fail2ban will use auto.
  40. # polling: uses a polling algorithm which does not require external libraries.
  41. # systemd: uses systemd python library to access the systemd journal.
  42. # Specifying "logpath" is not valid for this backend.
  43. # See "journalmatch" in the jails associated filter config
  44. # auto: will try to use the following backends, in order:
  45. # pyinotify, gamin, polling.
  46. backend = auto
  47. # "usedns" specifies if jails should trust hostnames in logs,
  48. # warn when DNS lookups are performed, or ignore all hostnames in logs
  49. #
  50. # yes: if a hostname is encountered, a DNS lookup will be performed.
  51. # warn: if a hostname is encountered, a DNS lookup will be performed,
  52. # but it will be logged as a warning.
  53. # no: if a hostname is encountered, will not be used for banning,
  54. # but it will be logged as info.
  55. usedns = warn
  56. # "logencoding" specifies the encoding of the log files handled by the jail
  57. # This is used to decode the lines from the log file.
  58. # Typical examples: "ascii", "utf-8"
  59. #
  60. # auto: will use the system locale setting
  61. logencoding = auto
  62. # "enabled" enables the jails.
  63. # By default all jails are disabled, and it should stay this way.
  64. # Enable only relevant to your setup jails in your .local or jail.d/*.conf
  65. #
  66. # true: jail will be enabled and log files will get monitored for changes
  67. # false: jail is not enabled
  68. enabled = false
  69. # "filter" defines the filter to use by the jail.
  70. # By default jails have names matching their filter name
  71. #
  72. filter = %(__name__)s
  73. ### End Misc Options ### }}}
  74. ### Actions ### {{{
  75. #
  76. # ACTIONS
  77. #
  78. # Some options used for actions
  79. # Destination email address used solely for the interpolations in
  80. # jail.{conf,local,d/*} configuration files.
  81. destemail = root@localhost
  82. # Sender email address used solely for some actions
  83. sender = root@localhost
  84. # E-mail action. Since 0.8.1 Fail2Ban uses sendmail MTA for the
  85. # mailing. Change mta configuration parameter to mail if you want to
  86. # revert to conventional 'mail'.
  87. mta = mail
  88. #mta = sendmail
  89. # Default protocol
  90. protocol = tcp
  91. # Specify chain where jumps would need to be added in iptables-* actions
  92. chain = INPUT
  93. # Ports to be banned
  94. # Usually should be overridden in a particular jail
  95. port = 0:65535
  96. #
  97. # Action shortcuts. To be used to define action parameter
  98. # Default banning action (e.g. iptables, iptables-new,
  99. # iptables-multiport, shorewall, etc) It is used to define
  100. # action_* variables. Can be overridden globally or per
  101. # section within jail.local file
  102. banaction = iptables-multiport
  103. # The simplest action to take: ban only
  104. action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
  105. # ban & send an e-mail with whois report to the destemail.
  106. action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
  107. %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
  108. # ban & send an e-mail with whois report and relevant log lines
  109. # to the destemail.
  110. action_mwl = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
  111. %(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
  112. # See the IMPORTANT note in action.d/xarf-login-attack for when to use this action
  113. #
  114. # ban & send a xarf e-mail to abuse contact of IP address and include relevant log lines
  115. # to the destemail.
  116. action_xarf = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
  117. xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath=%(logpath)s, port="%(port)s"]
  118. # Report block via blocklist.de fail2ban reporting service API
  119. #
  120. # See the IMPORTANT note in action.d/blocklist_de.conf for when to
  121. # use this action. Create a file jail.d/blocklist_de.local containing
  122. # [Init]
  123. # blocklist_de_apikey = {api key from registration]
  124. #
  125. action_blocklist_de = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s"]
  126. # Report ban via badips.com, and use as blacklist
  127. #
  128. # See BadIPsAction docstring in config/action.d/badips.py for
  129. # documentation for this action.
  130. #
  131. # NOTE: This action relies on banaction being present on start and therefore
  132. # should be last action defined for a jail.
  133. #
  134. action_badips = badips.py[category="%(name)s", banaction="%(banaction)s"]
  135. # Choose default action. To change, just override value of 'action' with the
  136. # interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local
  137. # globally (section [DEFAULT]) or per specific section
  138. action = %(action_)s
  139. ### End Actions ### }}}
  140. ### End Default ### }}}
  141. ### Jails ### {{{
  142. #
  143. # JAILS
  144. #
  145. ### SSH Servers ### {{{
  146. #
  147. # SSH servers
  148. #
  149. ### ssh ### {{{
  150. [sshd]
  151. enabled = true
  152. maxretry = 3
  153. ## one hour
  154. #bantime = 3600
  155. ## ten minutes
  156. #findtime = 600
  157. ## One Week
  158. bantime = 604800
  159. ## Four days
  160. findtime = 345600
  161. #port = 500,8080
  162. port = 0:21,23:65535
  163. logpath = %(sshd_log)s
  164. [sshd-bad-protocol]
  165. enabled = true
  166. maxretry = 1
  167. ## One week
  168. bantime = 604800
  169. ## Four days
  170. findtime = 345600
  171. #port = 500,8080
  172. port = 0:21,23:65535
  173. logpath = %(sshd_log)s
  174. [sshd-bad-users]
  175. enabled = true
  176. maxretry = 5
  177. ## One week
  178. bantime = 604800
  179. ## Four days
  180. findtime = 345600
  181. #port = 500,8080
  182. port = 0:21,23:65535
  183. logpath = %(sshd_log)s
  184. [sshd-bad-users-known]
  185. enabled = true
  186. maxretry = 1
  187. ## One week
  188. bantime = 604800
  189. ## Four days
  190. findtime = 345600
  191. #port = 500,8080
  192. port = 0:21,23:65535
  193. logpath = %(sshd_log)s
  194. ### End ssh ### }}}
  195. ### endlessh ### {{{
  196. [endlessh]
  197. enabled = true
  198. maxretry = 1000
  199. ## One month
  200. bantime = 2419200
  201. ## five days
  202. findtime = 432000
  203. port = 0:65535
  204. logpath = /var/log/endlessh.log
  205. ### End endlessh ### }}}
  206. ### dropbear ### {{{
  207. [dropbear]
  208. port = ssh
  209. logpath = %(dropbear_log)s
  210. ### End dropbear ### }}}
  211. ### selinux ### {{{
  212. [selinux-ssh]
  213. port = ssh
  214. logpath = %(auditd_log)s
  215. maxretry = 5
  216. ### End selinux ### }}}
  217. ### End SSH Servers ### }}}
  218. ### HTTP Servers ### {{{
  219. #
  220. # HTTP servers
  221. #
  222. ### apache ### {{{
  223. [apache-auth]
  224. port = http,https
  225. logpath = %(apache_error_log)s
  226. [apache-badbots]
  227. # Ban hosts which agent identifies spammer robots crawling the web
  228. # for email addresses. The mail outputs are buffered.
  229. port = http,https
  230. logpath = %(apache_access_log)s
  231. bantime = 172800
  232. maxretry = 1
  233. [apache-noscript]
  234. port = http,https
  235. logpath = %(apache_error_log)s
  236. maxretry = 6
  237. [apache-overflows]
  238. port = http,https
  239. logpath = %(apache_error_log)s
  240. maxretry = 2
  241. [apache-nohome]
  242. port = http,https
  243. logpath = %(apache_error_log)s
  244. maxretry = 2
  245. [apache-botsearch]
  246. port = http,https
  247. logpath = %(apache_error_log)s
  248. maxretry = 2
  249. [apache-modsecurity]
  250. port = http,https
  251. logpath = %(apache_error_log)s
  252. maxretry = 2
  253. [apache-shellshock]
  254. port = http,https
  255. logpath = $(apache_error_log)s
  256. maxretry = 1
  257. ### End apache ### }}}
  258. ### nginx ### {{{
  259. [nginx-http-auth]
  260. enabled = true
  261. filter = nginx-http-auth
  262. ports = http,https
  263. #logpath = %(nginx_error_log)s
  264. logpath = /var/log/nginx/error.log
  265. [nginx-noscript]
  266. enabled = true
  267. #port = http,https
  268. port = 0:21,23:499,501:65535
  269. filter = nginx-noscript
  270. logpath = /var/log/nginx/access.log
  271. maxretry = 4
  272. ## One week
  273. bantime = 604800
  274. ## Four days
  275. findtime = 345600
  276. [nginx-badbots]
  277. enabled = true
  278. #port = http,https
  279. port = 0:21,23:499,501:65535
  280. filter = nginx-badbots
  281. logpath = /var/log/nginx/access.log
  282. maxretry = 1
  283. ## One week
  284. bantime = 604800
  285. ## Four days
  286. findtime = 345600
  287. [nginx-botsearch]
  288. enabled = true
  289. port = http,https
  290. filter = nginx-botsearch
  291. logpath = /var/log/nginx/access.log
  292. maxretry = 2
  293. ## One week
  294. bantime = 604800
  295. ## Four days
  296. findtime = 345600
  297. [nginx-nohome]
  298. enabled = true
  299. port = http,https
  300. filter = nginx-nohome
  301. logpath = /var/log/nginx/access.log
  302. maxretry = 2
  303. ## One week
  304. bantime = 604800
  305. ## Four days
  306. findtime = 345600
  307. [nginx-noproxy]
  308. enabled = false
  309. port = http,https
  310. filter = nginx-noproxy
  311. logpath = /var/log/nginx/access.log
  312. maxretry = 2
  313. ## One week
  314. bantime = 604800
  315. ## Four days
  316. findtime = 345600
  317. [nginx-lurkers]
  318. enabled = true
  319. #port = http,https
  320. port = 0:21,23:499,501:65535
  321. filter = nginx-lurkers
  322. logpath = /var/log/nginx/access.log
  323. /var/log/nginx/ttrss_access.log
  324. /var/log/nginx/piwik_access.log
  325. /var/log/nginx/irpg_access.log
  326. /var/log/nginx/pit_access.log
  327. /var/log/nginx/shaarli_access.log
  328. /var/log/nginx/glow_access.log
  329. /var/log/nginx/up.log
  330. maxretry = 1
  331. ## One Month
  332. bantime = 2628002
  333. ## Four days
  334. findtime = 345600
  335. [nginx-bbb-sent]
  336. enabled = true
  337. #port = http,https
  338. port = 0:21,23:499,501:65535
  339. filter = nginx-bbb-sent
  340. logpath = /var/log/nginx/access.log
  341. maxretry = 1
  342. ## One Month
  343. bantime = 2628002
  344. ## Four days
  345. findtime = 345600
  346. [nginx-req-limit]
  347. enabled = false
  348. port = http,https
  349. filter = nginx-limit-req
  350. logpath = /var/log/nginx/*error.log
  351. ## One week
  352. bantime = 604800
  353. ## Four days
  354. findtime = 345600
  355. maxretry = 10
  356. [nginx-rss-over-scrape]
  357. enabled = false
  358. port = = http,https
  359. filter = nginx-rss-over-scrape
  360. logpath = /var/log/nginx/access.log
  361. maxretry = 3
  362. ## thirty-six hours
  363. bantime = 129600
  364. ## Six hours
  365. findtime = 21600
  366. ### End nginx ### }}}
  367. ### php-url-fopen ### {{{
  368. # Ban attackers that try to use PHP's URL-fopen() functionality
  369. # through GET/POST variables. - Experimental, with more than a year
  370. # of usage in production environments.
  371. [php-url-fopen]
  372. port = http,https
  373. logpath = %(nginx_access_log)s %(apache_access_log)s
  374. ### end php-url-fopen ### }}}
  375. ### suhosin ### {{{
  376. [suhosin]
  377. port = http,https
  378. logpath = %(suhosin_log)s
  379. ### End suhosin ### }}}
  380. ### lighttpd ### {{{
  381. [lighttpd-auth]
  382. # Same as above for Apache's mod_auth
  383. # It catches wrong authentifications
  384. port = http,https
  385. logpath = %(lighttpd_error_log)s
  386. ### End lighttpd ### }}}
  387. ### End HTTP Servers ### }}}
  388. ### Webmail ### {{{
  389. #
  390. # Webmail and groupware servers
  391. #
  392. ### roundcube ### {{{
  393. [roundcube-auth]
  394. port = http,https
  395. logpath = /var/log/roundcube/userlogins
  396. ### End roundcube ### }}}
  397. ### openwebmail ### {{{
  398. [openwebmail]
  399. port = http,https
  400. logpath = /var/log/openwebmail.log
  401. ### End openwebmail ### }}}
  402. ### horde ### {{{
  403. [horde]
  404. port = http,https
  405. logpath = /var/log/horde/horde.log
  406. ### End horde ### }}}
  407. ### groupoffice ### {{{
  408. [groupoffice]
  409. port = http,https
  410. logpath = /home/groupoffice/log/info.log
  411. ### End groupoffice ### }}}
  412. ### sogo ### {{{
  413. [sogo-auth]
  414. # Monitor SOGo groupware server
  415. # without proxy this would be:
  416. # port = 20000
  417. port = http,https
  418. logpath = /var/log/sogo/sogo.log
  419. ### End sogo ### }}}
  420. ### tine20 ### {{{
  421. [tine20]
  422. logpath = /var/log/tine20/tine20.log
  423. port = http,https
  424. maxretry = 5
  425. ### End tine20 ### }}}
  426. ### End Webmail ### }}}
  427. ### Web Apps ### {{{
  428. #
  429. # Web Applications
  430. #
  431. #
  432. ### guacamole ### {{{
  433. [guacamole]
  434. port = http,https
  435. logpath = /var/log/tomcat*/catalina.out
  436. ### End quacamole ### }}}
  437. ### monit ### {{{
  438. [monit]
  439. #Ban clients brute-forcing the monit gui login
  440. filter = monit
  441. port = 2812
  442. logpath = /var/log/monit
  443. ### End monit ### }}}
  444. ### webmin ### {{{
  445. [webmin-auth]
  446. port = 10000
  447. logpath = %(syslog_authpriv)s
  448. ### End webmin ### }}}
  449. ### End Web Apps ### }}}
  450. ### HTTP Proxy Servers ### {{{
  451. #
  452. # HTTP Proxy servers
  453. #
  454. #
  455. ### squid ### {{{
  456. [squid]
  457. port = 80,443,3128,8080
  458. logpath = /var/log/squid/access.log
  459. ### End squid ### }}}
  460. ### 3proxy ### {{{
  461. [3proxy]
  462. port = 3128
  463. logpath = /var/log/3proxy.log
  464. ### End 3proxy ### }}}
  465. ### End HTTP Proxy Servers ### }}}
  466. ### FTP Servers ### {{{
  467. #
  468. # FTP servers
  469. #
  470. ### proftpd ### {{{
  471. [proftpd]
  472. port = ftp,ftp-data,ftps,ftps-data
  473. logpath = %(proftpd_log)s
  474. ### End proftpd ### }}}
  475. ### pure ### {{{
  476. [pure-ftpd]
  477. port = ftp,ftp-data,ftps,ftps-data
  478. logpath = %(pureftpd_log)s
  479. maxretry = 6
  480. ### End pure ### }}}
  481. ### gssftpd ### {{{
  482. [gssftpd]
  483. port = ftp,ftp-data,ftps,ftps-data
  484. logpath = %(syslog_daemon)s
  485. maxretry = 6
  486. ### End gssftpd ### }}}
  487. ### wuftpd ### {{{
  488. [wuftpd]
  489. port = ftp,ftp-data,ftps,ftps-data
  490. logpath = %(wuftpd_log)s
  491. maxretry = 6
  492. ### End wuftpd ### }}}
  493. ### End vsftpd ### {{{
  494. [vsftpd]
  495. # or overwrite it in jails.local to be
  496. # logpath = %(syslog_authpriv)s
  497. # if you want to rely on PAM failed login attempts
  498. # vsftpd's failregex should match both of those formats
  499. port = ftp,ftp-data,ftps,ftps-data
  500. logpath = %(vsftpd_log)s
  501. ### End vsftpd ### }}}
  502. ### End FTP Servers ### }}}
  503. ### Mail Servers ### {{{
  504. #
  505. # Mail servers
  506. #
  507. ### assp ### ### {{{
  508. # ASSP SMTP Proxy Jail
  509. [assp]
  510. port = smtp,465,submission
  511. logpath = /root/path/to/assp/logs/maillog.txt
  512. ### End assp ### }}}
  513. ### courier ### {{{
  514. [courier-smtp]
  515. port = smtp,465,submission
  516. logpath = %(syslog_mail)s
  517. ### End courier ### }}}
  518. ### postfix ### {{{
  519. [postfix]
  520. port = smtp,465,submission
  521. logpath = %(postfix_log)s
  522. ### End postfix ### }}}
  523. ### sendmail ### {{{
  524. [sendmail-auth]
  525. port = submission,465,smtp
  526. logpath = %(syslog_mail)s
  527. [sendmail-reject]
  528. port = smtp,465,submission
  529. logpath = %(syslog_mail)s
  530. ### End send mail ### }}}
  531. ### qmail ### {{{
  532. [qmail-rbl]
  533. filter = qmail
  534. port = smtp,465,submission
  535. logpath = /service/qmail/log/main/current
  536. ### End qmail ### }}}
  537. ### davecot ### {{{
  538. # dovecot defaults to logging to the mail syslog facility
  539. # but can be set by syslog_facility in the dovecot configuration.
  540. [dovecot]
  541. port = pop3,pop3s,imap,imaps,submission,465,sieve
  542. logpath = %(dovecot_log)s
  543. ### End davecot ### }}}
  544. ### sieve ### {{{
  545. [sieve]
  546. port = smtp,465,submission
  547. logpath = %(dovecot_log)s
  548. ### End sieve ### }}}
  549. ### solid ### {{{
  550. [solid-pop3d]
  551. port = pop3,pop3s
  552. logpath = %(solidpop3d_log)s
  553. ### End solid ### }}}
  554. ### exim ### {{{
  555. [exim]
  556. port = smtp,465,submission
  557. logpath = %(exim_main_log)s
  558. [exim-spam]
  559. port = smtp,465,submission
  560. logpath = %(exim_main_log)s
  561. ### End exim ### }}}
  562. ### kerio ### {{{
  563. [kerio]
  564. port = imap,smtp,imaps,465
  565. logpath = /opt/kerio/mailserver/store/logs/security.log
  566. ### End kerio ### }}}
  567. ### End Mail Servers ### }}}
  568. ### Mail Authenticators ### {{{
  569. #
  570. # Mail servers authenticators: might be used for smtp,ftp,imap servers, so
  571. # all relevant ports get banned
  572. #
  573. ### courier ### {{{
  574. [courier-auth]
  575. port = smtp,465,submission,imap3,imaps,pop3,pop3s
  576. logpath = %(syslog_mail)s
  577. ### End courier ### }}}
  578. ### postfix ### {{{
  579. [postfix-sasl]
  580. port = smtp,465,submission,imap3,imaps,pop3,pop3s
  581. # You might consider monitoring /var/log/mail.warn instead if you are
  582. # running postfix since it would provide the same log lines at the
  583. # "warn" level but overall at the smaller filesize.
  584. logpath = %(postfix_log)s
  585. ### End postfix ### }}}
  586. ### perdition ### {{{
  587. [perdition]
  588. port = imap3,imaps,pop3,pop3s
  589. logpath = %(syslog_mail)s
  590. ### End perdition ### }}}
  591. ### squirrelmail ### {{{
  592. [squirrelmail]
  593. port = smtp,465,submission,imap2,imap3,imaps,pop3,pop3s,http,https,socks
  594. logpath = /var/lib/squirrelmail/prefs/squirrelmail_access_log
  595. ### End squirrelmail ### }}}
  596. ### cyrus ### {{{
  597. [cyrus-imap]
  598. port = imap3,imaps
  599. logpath = %(syslog_mail)s
  600. ### End cyrus ### }}}
  601. ### uwimap ### {{{
  602. [uwimap-auth]
  603. port = imap3,imaps
  604. logpath = %(syslog_mail)s
  605. ### End uwimap ### }}}
  606. ### End Mail Authenticators ### }}}
  607. ### DNS Servers ### {{{
  608. #
  609. #
  610. # DNS servers
  611. #
  612. ### named ### {{{
  613. # !!! WARNING !!!
  614. # Since UDP is connection-less protocol, spoofing of IP and imitation
  615. # of illegal actions is way too simple. Thus enabling of this filter
  616. # might provide an easy way for implementing a DoS against a chosen
  617. # victim. See
  618. # http://nion.modprobe.de/blog/archives/690-fail2ban-+-dns-fail.html
  619. # Please DO NOT USE this jail unless you know what you are doing.
  620. #
  621. # IMPORTANT: see filter.d/named-refused for instructions to enable logging
  622. # This jail blocks UDP traffic for DNS requests.
  623. # [named-refused-udp]
  624. #
  625. # filter = named-refused
  626. # port = domain,953
  627. # protocol = udp
  628. # logpath = /var/log/named/security.log
  629. # IMPORTANT: see filter.d/named-refused for instructions to enable logging
  630. # This jail blocks TCP traffic for DNS requests.
  631. [named-refused]
  632. port = domain,953
  633. logpath = /var/log/named/security.log
  634. ### End named ### }}}
  635. ### nsd ### {{{
  636. [nsd]
  637. port = 53
  638. action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
  639. %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
  640. logpath = /var/log/nsd.log
  641. ### End nds ### }}}
  642. ### End DNS Servers ### }}}
  643. ### Misc Jails ### {{{
  644. #
  645. # Miscellaneous
  646. #
  647. ### fail2ban Multiple Bans ### {{{
  648. [fail2ban]
  649. enabled = false
  650. filter = fail2ban
  651. action = iptables-allports[name=fail2ban]
  652. logpath = /var/log/fail2ban*
  653. maxretry = 3
  654. # findtime: 5 days
  655. findtime = 432000
  656. # bantime: FOREVER
  657. bantime = -1
  658. ### End fail2ban Multiple ### }}}
  659. ### asterisk ### {{{
  660. [asterisk]
  661. port = 5060,5061
  662. action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
  663. %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
  664. %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
  665. logpath = /var/log/asterisk/messages
  666. maxretry = 10
  667. ### End asterisk ### }}}
  668. ### freeswitch ### {{{
  669. [freeswitch]
  670. port = 5060,5061
  671. action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
  672. %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
  673. %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
  674. logpath = /var/log/freeswitch.log
  675. maxretry = 10
  676. ### End freeswitch ### }}}
  677. ### mysqld ### {{{
  678. # To log wrong MySQL access attempts add to /etc/my.cnf in [mysqld] or
  679. # equivalent section:
  680. # log-warning = 2
  681. #
  682. # for syslog (daemon facility)
  683. # [mysqld_safe]
  684. # syslog
  685. #
  686. # for own logfile
  687. # [mysqld]
  688. # log-error=/var/log/mysqld.log
  689. [mysqld-auth]
  690. port = 3306
  691. logpath = %(mysql_log)s
  692. maxretry = 5
  693. ### End mysgld ### }}}
  694. ### recidive ### {{{
  695. # Jail for more extended banning of persistent abusers
  696. # !!! WARNING !!!
  697. # Make sure that your loglevel specified in fail2ban.conf/.local
  698. # is not at DEBUG level -- which might then cause fail2ban to fall into
  699. # an infinite loop constantly feeding itself with non-informative lines
  700. [recidive]
  701. logpath = /var/log/fail2ban.log
  702. port = all
  703. protocol = all
  704. bantime = 604800 ; 1 week
  705. findtime = 86400 ; 1 day
  706. maxretry = 5
  707. ### End recidive ### }}}
  708. ### pam-generic ### {{{
  709. # Generic filter for PAM. Has to be used with action which bans all
  710. # ports such as iptables-allports, shorewall
  711. [pam-generic]
  712. # pam-generic filter can be customized to monitor specific subset of 'tty's
  713. banaction = iptables-allports
  714. logpath = %(syslog_authpriv)s
  715. ### End pam-generic ### }}}
  716. ### xinetd-fail ### {{{
  717. [xinetd-fail]
  718. banaction = iptables-multiport-log
  719. logpath = %(syslog_daemon)s
  720. maxretry = 2
  721. ### End xinetd-fail ### }}}
  722. ### stunnel ### {{{
  723. # stunnel - need to set port for this
  724. [stunnel]
  725. logpath = /var/log/stunnel4/stunnel.log
  726. [ejabberd-auth]
  727. port = 5222
  728. logpath = /var/log/ejabberd/ejabberd.log
  729. ### End stunnel ### }}}
  730. ### counter-strike ### {{{
  731. [counter-strike]
  732. logpath = /opt/cstrike/logs/L[0-9]*.log
  733. # Firewall: http://www.cstrike-planet.com/faq/6
  734. tcpport = 27030,27031,27032,27033,27034,27035,27036,27037,27038,27039
  735. udpport = 1200,27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015
  736. action = %(banaction)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
  737. %(banaction)s[name=%(__name__)s-udp, port="%(udpport)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
  738. ### End couter-strike ### }}}
  739. ### nagios ### {{{
  740. # consider low maxretry and a long bantime
  741. # nobody except your own Nagios server should ever probe nrpe
  742. [nagios]
  743. enabled = false
  744. logpath = %(syslog_daemon)s ; nrpe.cfg may define a different log_facility
  745. maxretry = 1
  746. ### End nagios ### }}}
  747. ### oracleims ### {{{
  748. [oracleims]
  749. # see "oracleims" filter file for configuration requirement for Oracle IMS v6 and above
  750. enabled = false
  751. logpath = /opt/sun/comms/messaging64/log/mail.log_current
  752. maxretry = 6
  753. banaction = iptables-allports
  754. ### End oracleims ### }}}
  755. ### directadmin ### {{{
  756. [directadmin]
  757. enabled = false
  758. logpath = /var/log/directadmin/login.log
  759. port = 2222
  760. ### End directadmin ### }}}
  761. ### portsentry ### {{{
  762. [portsentry]
  763. enabled = false
  764. logpath = /var/lib/portsentry/portsentry.history
  765. maxretry = 1
  766. ### End portsentry ### }}}
  767. ### End Misc Jails ### }}}
  768. ### End Jails ### }}}