From bf4cfc22e89bc4db946fa801ddc8b7a61a763133 Mon Sep 17 00:00:00 2001 From: Alex Brasetvik Date: Fri, 28 Nov 2014 18:58:37 +0100 Subject: [PATCH 01/57] Support connecting to Elasticsearch protected with basic auth --- src/server/config/kibana.yml | 8 ++++++++ src/server/routes/proxy.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/config/kibana.yml b/src/server/config/kibana.yml index c4e1d8345973..fc9a6ec42e3b 100644 --- a/src/server/config/kibana.yml +++ b/src/server/config/kibana.yml @@ -7,6 +7,14 @@ host: "0.0.0.0" # The Elasticsearch instance to use for all your queries. elasticsearch: "http://localhost:9200" +# If your Elasticsearch is protected with basic auth: +# username: user +# password: pass + +# preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false, +# then the host you use to connect to *this* Kibana instance will be sent. +preserve_elasticsearch_host: true + # Kibana uses an index in Elasticsearch to store saved searches, visualizations # and dashboards. It will create a new index if it doesn't already exist. kibanaIndex: ".kibana" diff --git a/src/server/routes/proxy.rb b/src/server/routes/proxy.rb index f9fb1090db19..5ad20b8c6603 100644 --- a/src/server/routes/proxy.rb +++ b/src/server/routes/proxy.rb @@ -9,7 +9,7 @@ class Proxy < Base use Rack::ReverseProxy do reverse_proxy_options timeout: config["request_timeout"] @global_options[:verify_ssl] = config["verifySSL"].nil? ? true : config["verifySSL"] - reverse_proxy(/^\/elasticsearch(.*)$/, "#{config["elasticsearch"]}$1") + reverse_proxy(/^\/elasticsearch(.*)$/, "#{config["elasticsearch"]}$1", username: config["username"], password: config["password"], preserve_host: config["preserve_elasticsearch_host"]) end end end From fcbd3f42c7a6071ac2c919d4145058424e2fbef1 Mon Sep 17 00:00:00 2001 From: Alex Brasetvik Date: Sat, 29 Nov 2014 08:52:23 +0100 Subject: [PATCH 02/57] Do not expose credentials through /config --- src/server/routes/home.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/routes/home.rb b/src/server/routes/home.rb index df4216bea52e..18b078e0409f 100644 --- a/src/server/routes/home.rb +++ b/src/server/routes/home.rb @@ -14,7 +14,9 @@ class Home < Base data = settings.config.clone() plugins = external_plugins.concat(bundled_plugins) data['plugins'] = plugins - data.delete('elasticsearch') + + # Remove keys we do not want to expose + ["elasticsearch", "username", "password"].each { |key| data.delete(key) } json data end From f1de40ccf7be4817ce79a2d32fe4fda3234907bc Mon Sep 17 00:00:00 2001 From: Alex Brasetvik Date: Mon, 1 Dec 2014 21:36:24 +0100 Subject: [PATCH 03/57] Prefix username/password with elasticsearch_ --- src/server/config/kibana.yml | 4 ++-- src/server/routes/home.rb | 2 +- src/server/routes/proxy.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/config/kibana.yml b/src/server/config/kibana.yml index fc9a6ec42e3b..8e32bfa8ecca 100644 --- a/src/server/config/kibana.yml +++ b/src/server/config/kibana.yml @@ -8,8 +8,8 @@ host: "0.0.0.0" elasticsearch: "http://localhost:9200" # If your Elasticsearch is protected with basic auth: -# username: user -# password: pass +# elasticsearch_username: user +# elasticsearch_password: pass # preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false, # then the host you use to connect to *this* Kibana instance will be sent. diff --git a/src/server/routes/home.rb b/src/server/routes/home.rb index 18b078e0409f..8846da7185bb 100644 --- a/src/server/routes/home.rb +++ b/src/server/routes/home.rb @@ -16,7 +16,7 @@ class Home < Base data['plugins'] = plugins # Remove keys we do not want to expose - ["elasticsearch", "username", "password"].each { |key| data.delete(key) } + ["elasticsearch", "elasticsearch_username", "elasticsearch_password"].each { |key| data.delete(key) } json data end diff --git a/src/server/routes/proxy.rb b/src/server/routes/proxy.rb index 5ad20b8c6603..5dd35d6f5467 100644 --- a/src/server/routes/proxy.rb +++ b/src/server/routes/proxy.rb @@ -9,7 +9,7 @@ class Proxy < Base use Rack::ReverseProxy do reverse_proxy_options timeout: config["request_timeout"] @global_options[:verify_ssl] = config["verifySSL"].nil? ? true : config["verifySSL"] - reverse_proxy(/^\/elasticsearch(.*)$/, "#{config["elasticsearch"]}$1", username: config["username"], password: config["password"], preserve_host: config["preserve_elasticsearch_host"]) + reverse_proxy(/^\/elasticsearch(.*)$/, "#{config["elasticsearch"]}$1", username: config["elasticsearch_username"], password: config["elasticsearch_password"], preserve_host: config["preserve_elasticsearch_host"]) end end end From aba90184d99aa474dcc1811645363043a88a9dcf Mon Sep 17 00:00:00 2001 From: Alex Brasetvik Date: Mon, 1 Dec 2014 21:37:05 +0100 Subject: [PATCH 04/57] Break long line --- src/server/routes/proxy.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/routes/proxy.rb b/src/server/routes/proxy.rb index 5dd35d6f5467..e5aaa5f2c821 100644 --- a/src/server/routes/proxy.rb +++ b/src/server/routes/proxy.rb @@ -9,7 +9,10 @@ class Proxy < Base use Rack::ReverseProxy do reverse_proxy_options timeout: config["request_timeout"] @global_options[:verify_ssl] = config["verifySSL"].nil? ? true : config["verifySSL"] - reverse_proxy(/^\/elasticsearch(.*)$/, "#{config["elasticsearch"]}$1", username: config["elasticsearch_username"], password: config["elasticsearch_password"], preserve_host: config["preserve_elasticsearch_host"]) + reverse_proxy(/^\/elasticsearch(.*)$/, "#{config["elasticsearch"]}$1", + username: config["elasticsearch_username"], + password: config["elasticsearch_password"], + preserve_host: config["preserve_elasticsearch_host"]) end end end From 2ed9f358f6f19d8bb941d1ba810340bd47a46701 Mon Sep 17 00:00:00 2001 From: Thibaut Marmin Date: Wed, 3 Dec 2014 18:05:40 +0100 Subject: [PATCH 05/57] Use relative paths instead of absolute Closes #1630 --- src/kibana/index.html | 8 ++++---- src/kibana/styles/_variables.less | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kibana/index.html b/src/kibana/index.html index bd71139bc3c9..19c224b4cda1 100644 --- a/src/kibana/index.html +++ b/src/kibana/index.html @@ -5,7 +5,7 @@ - + Kibana 4 - - - + + +