Send a custom Header to Elasticsearch via Kibana Proxy


(Varun Sharma) #1

So I am having my own strategy (via Plugin) for Kibana server object to enable SSO. I want the same token to be passed on to all requests to Elasticsearch so my interceptor over there can authenticate the request. Any clean way I can make this happen via Plugin without touching the actual source code?
Is there something that the server object expose for this?
Kibana in question: 5.4.1

Edit:-
I know about :-

elasticsearch.requestHeadersWhitelist
elasticsearch.customHeaders

But I am using Yar (Hapi Library) for token management so will have to add a header that way.

I am adding my own Headers to the request in my HapiJS (Default) Strategy before passing on to next but these requests with path :-
/.kibana/config/5.4.1
Keeps on popping up with only 3 headers :-
[Host, Content-Length, Connection]
Unless I add a elasticsearch.customHeaders: with my desired Headers (Static, But mine HAVE to be dynamic)


(Tyler Smalley) #2

There are not currently any hooks to programmatically add headers to the ES requests. Feel free to open a feature request here: https://github.com/elastic/kibana/issues/new


(Varun Sharma) #3

But if I'm giving value to :-

elasticsearch.username:
elasticsearch.password:

Then at least that should be regarded in every kibana 'internal' request. Could you tell me more about the requests with raw_path :-
/.kibana/config/5.4.1


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.