{"id":1809,"date":"2015-05-11T01:18:44","date_gmt":"2015-05-10T16:18:44","guid":{"rendered":"http:\/\/tech.akat.info\/?p=1809"},"modified":"2015-05-11T01:24:15","modified_gmt":"2015-05-10T16:24:15","slug":"elasticsearch-auth%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=1809","title":{"rendered":"Elasticsearch Auth\u30d7\u30e9\u30b0\u30a4\u30f3"},"content":{"rendered":"<h1>\u6982\u8981<\/h1>\n<p>VPS\u306a\u306e\u3067\u30ed\u30fc\u30ab\u30ebIP\u304c\u306a\u3044<br \/>\n\u516c\u958b\u3059\u308b\u306e\u3082\u5acc\u306a\u306e\u3067\u3001\u8a8d\u8a3c\u3092\u304b\u3051\u305f\u3044<\/p>\n<h1>\u7d50\u8ad6<\/h1>\n<p>Elasticsearch Auth\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5229\u7528\u3057\u3088\u3046\u3068\u3057\u305f\u304c\u3001\u5225\u306e\u65b9\u6cd5\u3092\u8003\u3048\u308b\u3053\u3068\u306b\u3057\u305f<\/p>\n<h1>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h1>\n<p><a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_011859.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_011859-276x300.png\" alt=\"2015-05-11_011859\" width=\"276\" height=\"300\" class=\"alignnone size-medium wp-image-1811\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_011859-276x300.png 276w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_011859.png 309w\" sizes=\"(max-width: 276px) 100vw, 276px\" \/><\/a><br \/>\nelasticsearch\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c1.0.3\u306a\u306e\u3067\u3001authplugin\u306f1.1.0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@hostname:\/home\/shimizu# cd \/usr\/share\/elasticsearch\/bin\r\nroot@hostname:\/usr\/share\/elasticsearch\/bin# .\/elasticsearch -v\r\nVersion: 1.0.3, Build: NA\/NA, JVM: 1.7.0_79\r\nroot@hostname:\/usr\/share\/elasticsearch\/bin# .\/plugin -install org.codelibs\/elasticsearch-auth\/1.1.0\r\n-&gt; Installing org.codelibs\/elasticsearch-auth\/1.1.0...\r\nTrying http:\/\/download.elasticsearch.org\/org.codelibs\/elasticsearch-auth\/elasticsearch-auth-1.1.0.zip...\r\nTrying http:\/\/search.maven.org\/remotecontent?filepath=org\/codelibs\/elasticsearch-auth\/1.1.0\/elasticsearch-auth-1.1.0.zip...\r\nDownloading .................DONE\r\nInstalled org.codelibs\/elasticsearch-auth\/1.1.0 into \/usr\/share\/elasticsearch\/plugins\/auth\r\n\r\nroot@hostname:\/usr\/share\/elasticsearch\/bin# \/etc\/init.d\/elasticsearch restart\r\n&#x5B; ok ] Restarting elasticsearch (via systemctl): elasticsearch.service.\r\n\r\n### \u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u3001\u5f79\u5272\u3092user\u3068admin\u306b\u3059\u308b ###\r\nroot@hostname:\/usr\/share\/elasticsearch\/bin# curl -XPUT 'localhost:9200\/_auth\/account' -d &quot;{\r\n    \\&quot;authenticator\\&quot; : \\&quot;index\\&quot;,\r\n    \\&quot;username\\&quot; : \\&quot;testuser\\&quot;,\r\n    \\&quot;password\\&quot; : \\&quot;test123\\&quot;,\r\n    \\&quot;roles\\&quot; : &#x5B;\\&quot;user\\&quot;, \\&quot;admin\\&quot;]\r\n}&quot;\r\n{&quot;status&quot;:200}\r\n\r\n### \/_plugin\u914d\u4e0b\u3078\u306eGET,POST\u30e1\u30bd\u30c3\u30c9\u306f\u5f79\u5272\u304cadmin\u3067\u306a\u3044\u3068\u8a31\u53ef\u3057\u306a\u3044 ###\r\nroot@hostname:\/usr\/share\/elasticsearch\/plugins# curl -XPOST 'localhost:9200\/security\/constraint\/' -d &quot;{\r\n    \\&quot;authenticator\\&quot; : \\&quot;index\\&quot;,\r\n    \\&quot;paths\\&quot; : &#x5B;\\&quot;\/_plugin\\&quot;],\r\n    \\&quot;methods\\&quot; : &#x5B;\\&quot;get\\&quot;, \\&quot;post\\&quot;],\r\n    \\&quot;roles\\&quot; : &#x5B;\\&quot;admin\\&quot;]\r\n}&quot;\r\n{&quot;_index&quot;:&quot;security&quot;,&quot;_type&quot;:&quot;constraint&quot;,&quot;_id&quot;:&quot;oyadKwrdQzWX1koOWG-_lA&quot;,&quot;_version&quot;:1,&quot;created&quot;:true}\r\n\r\n### Reload Configuration ###\r\ncurl -XPOST 'localhost:9200\/_auth\/reload'\r\n{&quot;status&quot;:200}\r\n<\/pre>\n<h1>\u305d\u306e\u7d50\u679c<\/h1>\n<p>\/_plugin\u914d\u4e0b\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306f403\u3092\u8fd4\u5374\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f<br \/>\n<a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010922.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010922-300x60.png\" alt=\"2015-05-11_010922\" width=\"300\" height=\"60\" class=\"alignnone size-medium wp-image-1813\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010922-300x60.png 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010922.png 493w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h1>\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b<\/h1>\n<p>token\u3092\u767a\u884c\u3059\u308b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@hostname:\/usr\/share\/elasticsearch\/bin# curl -XPOST 'localhost:9200\/login' -d &quot;{\r\n    \\&quot;username\\&quot; : \\&quot;testuser\\&quot;,\r\n    \\&quot;password\\&quot; : \\&quot;test123\\&quot;\r\n}&quot;\r\n{&quot;status&quot;:200,&quot;token&quot;:&quot;c272c325e88339ac13aa09d1e881905081a53d99512b594cfaba624e7c2394664bb31eb540880e7eca6980e1bb02a76c826cedb3caf32444514ed0169a3e3070&quot;}\r\n<\/pre>\n<p>token\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u30fc\u3001\u3082\u3057\u304f\u306f\u30af\u30c3\u30ad\u30fc(eaid=&#8230;)\u3067\u6e21\u3059\u3053\u3068\u306b\u3088\u3063\u3066<br \/>\n\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3059\u308b\u4ed5\u69d8\u3068\u306e\u3053\u3068<\/p>\n<p>\u30ea\u30af\u30a8\u30b9\u30c8URL\u306b\u4ee5\u4e0b\u306etoken\u3092\u4ed8\u4e0e\u3059\u308b\u3068<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\/_search?q=*:*&amp;token=(token)\r\n<\/pre>\n<p>\u30db\u30ef\u30a4\u30c8\u30a2\u30a6\u30c8\u3057\u305forz<br \/>\n<a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010937.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010937-300x77.png\" alt=\"2015-05-11_010937\" width=\"300\" height=\"77\" class=\"alignnone size-medium wp-image-1812\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010937-300x77.png 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010937-660x168.png 660w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/05\/2015-05-11_010937.png 948w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>token\u30921\u6587\u5b57\u3067\u3082\u5909\u66f4\u3059\u308b\u3068&#8221;Not authorized&#8221;\u3068\u306a\u308b\u3053\u3068\u304b\u3089plugin\u306f\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u3066\u3044\u308b<br \/>\n\u305f\u3060\u3057\u3001\/_plugin \u914d\u4e0b\u306e\u305f\u3081\u3001\u554f\u984c\u304c\u8d77\u3053\u3063\u3066\u3044\u308b\u6a21\u69d8<br \/>\n(\/_plugin\/kibana3\/ \u306f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b)<\/p>\n<p>\u5225\u306e\u65b9\u6cd5\u3092\u8003\u3048\u305f\u307b\u3046\u304c\u3088\u3044\u304b\u3082\uff1f<\/p>\n<h1>\u53c2\u8003<\/h1>\n<p>Elasticsearch Auth\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb<\/p>\n<div class=\"oceanwp-oembed-wrap clr\"><iframe loading=\"lazy\" src=\"https:\/\/www.slideshare.net\/slideshow\/embed_code\/key\/3lRvBm0NbD7x8l\" width=\"427\" height=\"356\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" style=\"border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;\" allowfullscreen> <\/iframe> <\/p>\n<div style=\"margin-bottom:5px\"> <strong> <a href=\"https:\/\/www.slideshare.net\/shinsuke\/es-auth-plugin\" title=\"Elasticsearch Auth\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\" target=\"_blank\">Elasticsearch Auth\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb<\/a> <\/strong> from <strong><a href=\"http:\/\/www.slideshare.net\/shinsuke\" target=\"_blank\">Shinsuke Sugaya<\/a><\/strong> <\/div>\n<\/div>\n<p>elasticsearch-auth<br \/>\nhttps:\/\/github.com\/codelibs\/elasticsearch-auth<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 VPS\u306a\u306e\u3067\u30ed\u30fc\u30ab\u30ebIP\u304c\u306a\u3044 \u516c\u958b\u3059\u308b\u306e\u3082\u5acc\u306a\u306e\u3067\u3001\u8a8d\u8a3c\u3092\u304b\u3051\u305f\u3044 \u7d50\u8ad6 Elasticsearch Auth\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5229\u7528\u3057\u3088\u3046\u3068\u3057\u305f\u304c\u3001\u5225\u306e\u65b9\u6cd5\u3092\u8003\u3048\u308b\u3053\u3068\u306b\u3057\u305f \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb elasticsearch\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[70],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1809"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1809"}],"version-history":[{"count":6,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1809\/revisions"}],"predecessor-version":[{"id":1818,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1809\/revisions\/1818"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}