{"id":4394,"date":"2019-04-27T01:57:06","date_gmt":"2019-04-26T16:57:06","guid":{"rendered":"https:\/\/kumapress.com\/wp\/?p=4394"},"modified":"2019-04-27T01:57:09","modified_gmt":"2019-04-26T16:57:09","slug":"sasl%e3%81%b8%e3%81%ae%e8%be%9e%e6%9b%b8%e6%94%bb%e6%92%83%e5%af%be%e7%ad%96%e3%81%a8%e3%81%97%e3%81%a6fail2ban%e3%82%92%e5%b0%8e%e5%85%a5","status":"publish","type":"post","link":"https:\/\/kumapress.com\/?p=4394","title":{"rendered":"SASL\u3078\u306e\u8f9e\u66f8\u653b\u6483\u5bfe\u7b56\u3068\u3057\u3066fail2ban\u3092\u5c0e\u5165"},"content":{"rendered":"<p><span style=\"font-size: 14pt;\">\u3053\u3053\u3057\u3070\u3089\u304f\u304b\u3089\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306b\u5bfe\u3057\u3066\u306e\u8f9e\u66f8\u653b\u6483\u304c\u6fc0\u3057\u304f\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">Apr 21 04:18:52 www11118ui postfix\/smtpd[21283]: warning: unknown[103.231.139.127]: SASL LOGIN authentication failed: UGFzc3dvcmQ6<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u3069\u3046\u3057\u305f\u3082\u306e\u304b\u3068\u8abf\u3079\u3066\u3044\u305f\u3089\u300cfail2ban\u300d\u3092\u7686\u3055\u3093\u63a1\u7528\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4eca\u56de\u5c0e\u5165\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/span><\/p>\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n<p>\u3044\u3064\u3082\u306e\u3054\u3068\u304f<\/p>\n<p>#yum install fais2ban<\/p>\n<p>\u3053\u308c\u3067\u4e0b\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u5c55\u958b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><span style=\"font-size: 14pt;\"># ls -al \/etc\/fail2ban\/<\/span><br \/><span style=\"font-size: 14pt;\"><code>drwxr-xr-x 2 root root 4096 4\u6708 27 00:48 2019 action.d<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>-rw-r--r-- 1 root root 2313 2\u6708 18 03:17 2017 fail2ban.conf<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>drwxr-xr-x 2 root root 4096 2\u6708 18 03:17 2017 fail2ban.d<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>drwxr-xr-x 3 root root 4096 4\u6708 27 00:29 2019 filter.d<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>-rw-r--r-- 1 root root 21280 2\u6708 18 03:17 2017 jail.conf<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>drwxr-xr-x 2 root root 4096 4\u6708 27 01:11 2019 jail.d<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>-rw-r--r-- 1 root root 2375 12\u6708 9 23:36 2016 paths-common.conf<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>-rw-r--r-- 1 root root 642 12\u6708 9 23:36 2016 paths-debian.conf<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>-rw-r--r-- 1 root root 769 2\u6708 18 03:17 2017 paths-fedora.conf<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>-rw-r--r-- 1 root root 1174 12\u6708 9 23:36 2016 paths-freebsd.conf<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>-rw-r--r-- 1 root root 975 12\u6708 9 23:36 2016 paths-opensuse.conf<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>-rw-r--r-- 1 root root 290 12\u6708 9 23:36 2016 paths-osx.conf<\/code><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u5404\u8a2d\u5b9a\u60c5\u5831\u306fjail.conf\u306b\u5165\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u5fc5\u8981\u306a\u51e6\u7406\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u203b\u4eca\u56de\u306fpostfix-sasl\u3092\u6709\u52b9\u306b\u3057\u307e\u3057\u305f\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u305f\u3060\u3001jail.conf\u3092\u76f4\u63a5\u7de8\u96c6\u3059\u308b\u306e\u3067\u306a\u304f\u3001\u4e0b\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u5dee\u5206\u306e\u8a2d\u5b9a\u3092\u4e0a\u66f8\u304d\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">1)jail.local\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">2)jail.d\/local.conf\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u4eca\u56de\u306f2)\u306elocal.conf\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3044\u304f\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/span><\/p>\n\n\n<h2 class=\"wp-block-heading\">\u8a2d\u5b9a\u3092\u6709\u52b9\u306b\u3057\u307e\u3057\u3087\u3046<\/h2>\n\n\n<p><span style=\"font-size: 14pt;\">jail.d\/local.conf\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><code>[postfix-sasl]<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>enabled = true\u00a0 \u00a0# \u6709\u52b9\u306b\u3059\u308b<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>maxretry = 3\u00a0 \u00a0 \u00a0# findtime\u5185\u30673\u56de\u691c\u51fa\u3057\u305f\u3089BAN\u3059\u308b<\/code><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">jail.conf\u306bBAN\u6642\u9593(bantime:600\u79d2)\u3068\u691c\u51fa\u671f\u9593(findtime:600\u79d2)\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><code>[recidive]<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>enabled = true\u00a0 \u00a0# \u6709\u52b9\u306b\u3059\u308b<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>maxretry = 3\u00a0 \u00a0 \u00a0# 3\u56deBAN\u3055\u308c\u305f\u3089\u4e00\u9031\u9593BAN\u3059\u308b<\/code><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">jail.conf\u306bBAN\u6642\u9593(bantime:604800\u79d2)\u3068\u691c\u51fa\u671f\u9593(findtime:86400\u79d2)\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">fail2ban\u306e\u51fa\u529b\u30ed\u30b0\u3067\u3059\u304c\u3001\u5225\u306b\u30ed\u30b0\u3092\u51fa\u529b\u3055\u308c\u3066\u308b\u4f8b\u3092\u898b\u304b\u3051\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u307e\u307e\u3067\u3001syslog(\/var\/log\/message)\u306b\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u5fc5\u8981\u3067\u3057\u305f\u3089\u3001fail2ban.con\u306blogtarget\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n\n\n<h2 class=\"wp-block-heading\">fail2ban\u3092\u8d77\u52d5\u3057\u307e\u3057\u3087\u3046<\/h2>\n\n\n<p><span style=\"font-size: 14pt;\"># \/etc\/rc.d\/init.d\/fail2ban start<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u52d5\u4f5c\u72b6\u6cc1\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><code># fail2ban-client status postfix-sasl<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>Status for the jail: postfix-sasl<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>|- Filter<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>| |- Currently failed: 3<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>| |- Total failed: 15<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>| `- File list: \/var\/log\/maillog<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>`- Actions<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>|- Currently banned: 0<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>|- Total banned: 6<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>`- Banned IP list:<\/code><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u307e\u305fiptable\u3067\u3082\u78ba\u8a8d\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><code>Chain f2b-recidive (1 references)<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>target prot opt source destination<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>DROP all -- 103.231.139.146 anywhere<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>DROP all -- 103.231.139.127 anywhere<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>DROP all -- 103.231.139.79 anywhere<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>DROP all -- 185.137.111.37 anywhere<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>DROP all -- 185.137.111.162 anywhere<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>DROP all -- 103.231.139.248 anywhere<\/code><\/span><br \/><span style=\"font-size: 14pt;\"><code>RETURN all -- anywhere anywhere<\/code><\/span><\/p>\n\n\n<h2 class=\"wp-block-heading\">\u6ce8\u610f\u70b9<\/h2>\n\n\n<p><span style=\"font-size: 14pt;\">iptable\u306e\u8a2d\u5b9a\u306bf2b-recidive\u3063\u3066\u30c1\u30a7\u30fc\u30f3\u3092\u4ed8\u3051\u3066\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u305d\u306e\u305f\u3081\u3001iptable\u3092\u518d\u8d77\u52d5\u3001\u307e\u305f\u306f\u518d\u8aad\u8fbc\u3057\u305f\u5834\u5408\u3001fail2ban\u306e\u8a2d\u5b9a\u304c\u6d88\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u3053\u306e\u5834\u5408\u3001fail2ban\u3082\u518d\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p><aside class=\"row veu_insertAds after\"><div class=\"col-md-6\"><script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u7b2c 1 \u9762 - 2\uff08www.kumapress.com\uff09 -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-5987681888830890\"\r\n     data-ad-slot=\"5379270693\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script><\/div><div class=\"col-md-6\"><script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u7b2c 1 \u9762 - 1\uff08www.kumapress.com\uff09 -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-5987681888830890\"\r\n     data-ad-slot=\"7353370294\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script><\/div><\/aside>","protected":false},"excerpt":{"rendered":"<p>\u3053\u3053\u3057\u3070\u3089\u304f\u304b\u3089\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306b\u5bfe\u3057\u3066\u306e\u8f9e\u66f8\u653b\u6483\u304c\u6fc0\u3057\u304f\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002 Apr 21 04:18:52 www11118ui postfix\/smtpd[21283]: warning: unknown[103.231 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[6,126],"tags":[],"class_list":["post-4394","post","type-post","status-publish","format-standard","hentry","category-blog","category-blog-memo"],"_links":{"self":[{"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/posts\/4394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kumapress.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4394"}],"version-history":[{"count":1,"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/posts\/4394\/revisions"}],"predecessor-version":[{"id":4395,"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/posts\/4394\/revisions\/4395"}],"wp:attachment":[{"href":"https:\/\/kumapress.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kumapress.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kumapress.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}