elasticsearch - Kibana 4, Logstash dashboard: how do I require Nginx authentication when saving but allow anonymous views? -
i require auth_basic nginx authentication save kibana 4 dashboards allow view dashboards without authentication.
i installed elk (elasticsearch 1.4.5, logstash 1:1.5.2-1, , kibana 4.1.1) stack on ubuntu 14.04 using digitalocean tutorial.
because kibana uses browser based javascript sends queries elasticsearch, i'm not sure how figure out secure.
digitalocean provides nginx config secure access kibana 4.
file:/etc/nginx/sites-available/default server { listen 80; return 301 https://logstash.nyc.3top.com; } server { listen 443; ssl on; ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate_key /etc/nginx/ssl/server.key; server_name logstash.example.com; access_log /var/log/nginx/kibana.access.log; auth_basic "restricted access"; auth_basic_user_file /etc/nginx/htpasswd.users; location / { proxy_pass http://localhost:5601; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection 'upgrade'; proxy_set_header host $host; proxy_cache_bypass $http_upgrade; } } elastic provided nginx sample config accomplish kibana 3 not kibana 4:
server { listen *:80 ; server_name kibana.myhost.org; access_log /var/log/nginx/kibana.myhost.org.access.log; location / { root /usr/share/kibana3; index index.html index.htm; } location ~ ^/_aliases$ { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; } location ~ ^/.*/_aliases$ { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; } location ~ ^/_nodes$ { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; } location ~ ^/.*/_search$ { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; } location ~ ^/.*/_mapping { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; } # password protected end points location ~ ^/kibana-int/dashboard/.*$ { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; limit_except { proxy_pass http://127.0.0.1:9200; auth_basic "restricted"; auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; } } location ~ ^/kibana-int/temp.*$ { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; limit_except { proxy_pass http://127.0.0.1:9200; auth_basic "restricted"; auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; } } } does know how kibana 4?
here config files elasticsearch , kibana:
/etc/elasticsearch/elasticsearch.yml
network.host: localhost /opt/kibana/config/kibana.yml
port: 5601 host: "localhost" elasticsearch_url: "http://localhost:9200" elasticsearch_preserve_host: true kibana_index: ".kibana" default_app_id: "discover" request_timeout: 300000 shard_timeout: 0 verify_ssl: true bundled_plugin_ids: - plugins/dashboard/index - plugins/discover/index - plugins/doc/index - plugins/kibana/index - plugins/markdown_vis/index - plugins/metric_vis/index - plugins/settings/index - plugins/table_vis/index - plugins/vis_types/index - plugins/visualize/index
you might need leverage nginx's conditional capabilities achieve this. this gist might starting point. let me know if works you.
Comments
Post a Comment