Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[console] exclude the x-elastic-product-origin header for requests performed from the dev console #90123

Closed
pgayvallet opened this issue Feb 3, 2021 · 2 comments
Assignees
Labels
Feature:Console Dev Tools Console Feature Project:SystemIndices Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@pgayvallet
Copy link
Contributor

pgayvallet commented Feb 3, 2021

To support system indices (#81536), Kibana is now adding the 'x-elastic-product-origin': 'kibana' header automatically in requests performed against ES: #79218

However, requests executed by the end user using the dev console from the UI should not be able to query system indices.

We need to remove/exclude this header in that scenario.

One option would be to do that from the console proxy

@elastic/kibana-core @elastic/es-ui

@pgayvallet pgayvallet added Feature:Console Dev Tools Console Feature Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Feb 3, 2021
@pgayvallet pgayvallet changed the title [console] [console] exclude the x-elastic-product-origin header for requests performed from the dev console Feb 3, 2021
@jloleysens
Copy link
Contributor

Hi @pgayvallet ! Has console been tested for querying system indices with this change? I ask because it looks like the x-elastic-product-origin: kibana header should not be included. Headers are included based on a user configured whitelist:

const filteredHeaders = filterHeaders(headers, esConfig.requestHeadersWhitelist);

And some other hardcoded header values:

// see https://git.io/vytQ7
extendCommaList(headers, 'x-forwarded-for', _req.info.remoteAddress);

Without any special config in elasticsearch. requestHeadersWhitelist or elasticsearch.customHeaders I am seeing the following being passed through from Kibana:

{
  authorization: 'Basic XXXXXX',
  'x-forwarded-for': '127.0.0.1',
  'x-forwarded-port': '49304',
  'x-forwarded-proto': 'http',
  'x-forwarded-host': 'localhost:5601'
}

I might not be testing with the changes you are talking about of course, just wanted to raise this console behaviour.

@joshdover
Copy link
Contributor

A test has been added that verifies the deprecation warning behavior against the Console proxy API. What's remaining is to update this test once Elasticsearch blocks these API requests completely (elastic/elasticsearch#67384). I'm going to close this and open a new issue for that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Console Dev Tools Console Feature Project:SystemIndices Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

4 participants