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] Legacy Config Deprecations in 7.10 #68497

Closed
jloleysens opened this issue Jun 8, 2020 · 12 comments · Fixed by #75406
Closed

[Console] Legacy Config Deprecations in 7.10 #68497

jloleysens opened this issue Jun 8, 2020 · 12 comments · Fixed by #75406
Assignees
Labels
Feature:Console Dev Tools Console Feature Feature:Dev Tools 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

@jloleysens
Copy link
Contributor

Currently, Console uses the following config to act as a proxy between Kibana and ES:

export interface ESConfigForProxy {

The hosts, customHeaders and ssl settings all come from internal platform config we get through the remaining Console legacy plugin code: https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/console_legacy/index.ts.

In 7.10 this will no longer be running and Console will not be able to act as a proxy anymore in many environments.

It would be great if the proxy functionality that Console has implemented became part of the platform so that internal config can remain internal (except for the hosts value that we still send through to the client so that copy as curl can work).

A temporary alternative can be to just expose the required config through the platform somehow.

CC @restrry @flash1293

@jloleysens jloleysens added Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Jun 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@mshustov mshustov added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Jun 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@cjcenizal
Copy link
Contributor

Relates to #65028

@pgayvallet
Copy link
Contributor

Moved back to 7.10 roadmap, as it is, in fact, blocker as elasticsearch.legacy.config$ is not exposed on the public ES contract and was only available internally and in legacy.

There are two slightly different needs here:

  • Have a way to access elasticsearch.hosts config property for the 'copy as curl' client-side feature
  • Have a way to have a proxy between Kibana and ES for the console plugin.

Two options then, the quick one and the good one.

The quick one

  • add a getConfig API to the ES setup contract that would return the whole ElasticsearchConfigType

Definitely the easiest solution (or temporary solution). Definitely not the best one in term of security or isolation, as any plugin can access the whole ES configuration, but realistically, this was already the case in legacy, so it's not a regression, just a non-improvement.

The good one

  • add an API such as getHosts to the ES setup contract to access the elasticsearch.hosts config property (or a subset of the whole config if we think exposing other options make sense)
  • adapt the console proxy (src/plugins/console/server/routes/api/console/proxy/create_handler.ts) and move it into core.

No need to argument much. Compared to previous option, the ES config (well, except from hosts or anything we would be exposing because of the first point) stays internal to core, so it's just better in term of isolation and security. Apart from the fact that it is more work, I'm not sure I see any downside compared to the alternative?

Only restraining factor is the timing here. We need to get this done for 7.10, and I'm not sure we really have the capacity to directly implement the ES proxy in core, so I feel like doing 1/ now and 2/ later might be the most viable option.

@restrry @joshdover wdyt?

@mshustov
Copy link
Contributor

so I feel like doing 1/ now and 2/ later might be the most viable option.

Totally agree 🚢

@pgayvallet
Copy link
Contributor

Just created #73055 to unblock this issue.

@elastic/es-ui Once #73055 is merged, do you think you could tackle this one in the beginning of 7.10?

@jloleysens
Copy link
Contributor Author

Hey @pgayvallet , thanks for working on this.

Just to clarify:

  1. is the idea that once expose es config on es setup contract #73055 is merged we should be able to remove the remaining legacy console code?
  2. "could tackle this one in the beginning of 7.10?" are you referring to the changes we will need to make on Console because I think we will need to make these changes for 7.10?

Also happy to assist working on moving the console proxy to core when time comes, let me know!

@joshdover
Copy link
Contributor

Answer for Pierre while he is out:

1. is the idea that once #73055 is merged we should be able to remove the remaining legacy console code?

I believe so, yes. From what I can tell the only purpose of the legacy console plugin is to expose the Elasticsearch URL to the frontend. #73055 should make this possible in the new platform.

2. "could tackle this one in the beginning of 7.10?" are you referring to the changes we will need to make on Console because I think we will need to make these changes for 7.10?

Yes, we're aiming to remove all legacy plugins in 7.10. Once #73055 is in, it would be very helpful for us if you all could tackle the last bit of work of removing the legacy console plugin.

@jloleysens
Copy link
Contributor Author

Thanks @joshdover !

@pgayvallet
Copy link
Contributor

@jloleysens just got back, sorry for the delay. Actively working on #73055 right now.

Yea, once #73055 is merged, you will be able to remove the legacy 'bridge' you were using to access the config from the legacy plugin. The changes should also be trivial, as we will just be exposing legacy.config$ from the ES service to the KP plugins (we were only exposing it to the legacy plugin until now).

Only minor modification I can see is that in your legacy console_legacy plugin, you were exporting elasticsearchUrl to the client-side using uiExports. This is no longer possible in KP plugins and should be replaced with a specific endpoint and ajax call from the client-side (I know this is a little more bothersome than how it was done in legacy, but unfortunately this is the only replacement we got the injected vars right now, and I think it should not be a issue for you?)

@pgayvallet
Copy link
Contributor

FYI, #73055 has just been merged, you should be good to go.

@jloleysens
Copy link
Contributor Author

Great, thanks for the update @pgayvallet , I'll be sure to get this in for 7.10

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 Feature:Dev Tools 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

Successfully merging a pull request may close this issue.

6 participants