{"id":1453,"date":"2010-10-25T00:39:08","date_gmt":"2010-10-24T16:39:08","guid":{"rendered":"http:\/\/www.banbanli.net\/blog\/?p=1453"},"modified":"2010-10-27T13:46:47","modified_gmt":"2010-10-27T05:46:47","slug":"fail2ban","status":"publish","type":"post","link":"http:\/\/www.banbanli.net\/blog\/?p=1453","title":{"rendered":"fail2ban"},"content":{"rendered":"<p>\u5148\u5b89\u88dd\uff0c\u4e4b\u5f8c\u5728\u5fae\u8abf\uff5e<\/p>\n<p>Using Fail2ban with Dovecot<\/p>\n<p>Create the filter file \/etc\/fail2ban\/filter.d\/dovecot-pop3imap.conf:<\/p>\n<p><code>[Definition]<br \/>\nfailregex = (?: pop3-login|imap-login): (?:Authentication failure|Aborted login \\(auth failed|Aborted login \\(tried to use disabled|Disconnected \\(auth failed).*rip=(?P\\S*),.*<br \/>\nignoreregex =<\/code><\/p>\n<p>Add the following to \/etc\/fail2ban\/jail.conf:<\/p>\n<p><code>[dovecot-pop3imap]<br \/>\nenabled = true<br \/>\nfilter = dovecot-pop3imap<br \/>\naction = iptables-multiport[name=dovecot-pop3imap, port=\"pop3,imap\", protocol=tcp]<br \/>\nlogpath = \/var\/log\/maillog<br \/>\nmaxretry = 20<br \/>\nfindtime = 1200<br \/>\nbantime = 1200<\/code><\/p>\n<p>refer<br \/>\nhttp:\/\/wiki.dovecot.org\/HowTo\/Fail2Ban<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u5b89\u88dd\uff0c\u4e4b\u5f8c\u5728\u5fae\u8abf\uff5e Using Fail2ban with Dovecot Create the filter file \/etc\/fail2ban\/filter.d\/dovecot-pop3imap.conf: [Definition] failregex = (?: pop3-login|imap-login): (?:Authentication failure|Aborted login \\(auth failed|Aborted login \\(tried to use disabled|Disconnected \\(auth failed).*rip=(?P\\S*),.* ignoreregex = Add the following to \/etc\/fail2ban\/jail.conf: [dovecot-pop3imap] enabled = true filter = dovecot-pop3imap action = iptables-multiport[name=dovecot-pop3imap, port=&#8221;pop3,imap&#8221;, protocol=tcp] logpath = \/var\/log\/maillog maxretry = 20 findtime = 1200 &hellip; <a href=\"http:\/\/www.banbanli.net\/blog\/?p=1453\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">fail2ban<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-1453","post","type-post","status-publish","format-standard","hentry","category-daily"],"_links":{"self":[{"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1453"}],"version-history":[{"count":3,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1453\/revisions"}],"predecessor-version":[{"id":1459,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1453\/revisions\/1459"}],"wp:attachment":[{"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1453"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}