-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Interactive setup mode #89287
Comments
Pinging @elastic/kibana-core (Team:Core) |
Pinging @elastic/kibana-security (Team:Security) |
A few questions/remarks after our discussions in our weekly about the proposition to do that using the Regarding the UI:
Regarding the backend:
Regarding 'writing' down the config:
|
Thanks for your questions/remarks @pgayvallet, this is a great starting point for discussions: Regarding the UI:
I'm confused by this limitation. Can you explain why we wouldn't be able to bootstrap a real React app? I understand that we won't have Core services on the front-end, but why can't the
I don't understand the reasons for the limitation, but I'll accept that's true for now 🙂 Regarding the backend:
That's right, and I think that's an acceptable tradeoff. (Knowing nothing about the plugin system), could we make the
We will need to communicate with Elasticsearch, but perhaps we can do so by constructing our own client, rather than using the clients exposed by Core? Regarding 'writing' down the config: I share all of your concerns here. We'll need to take some time to discuss our options, and see what makes the most sense. For what it's worth, Elasticsearch will have a similar set of challenges, as it will also need to update its own configuration, while dealing with potential conflicts and permission constraints. I'd like to table this for now and instead focus on what (if anything) we can do to enable the experience. We'll collaborate with the ES team to see if there's an approach for config management that makes sense for both systems. |
What I mean is that I don't think our optimizer / bundler can work with 'custom' webpack entrypoints atm. I think we would need to manually bundle this application using our own specific webpack config, which is something we may want to avoid. But we will need @spalger opinion here.
Same reasons as previous point, and would also be solved if previous point is solved I think. Even if I don't exactly know how/where/when the translations are loaded from the server, if we have our client-side bundle, we can have i18n.
Joke aside, that would be doing a mini-core inside core. The notReady server is just a vanilla HAPI server atm. This thing was meant to display a plain string to the user 😄 . Plus, no core services are available when this noReady server starts, meaning that the gains would be minimals. Only pro I see (please tell me if you see more) is that the server-side code would be able to be elsewhere than inside core. But we could eventually just have it inside package imported by core instead.
The config service is loaded before
SGTM
That is, to be honest, my summary of doing anything else than a hacky solution for this feature. But don't get me wrong. I hate what we are suggesting here. And I would love to see more similar needs to have a good reason to implement something cleaner. Unfortunately, I don't think we do atm? Also I'm searching for a way to have this application be a 'normal' one. But realistically, I don't think we'll be able to graceful restart all the plugins once the configuration has been updated. We are just not ready for full configuration hot reload (or are we @joshdover?) Another question comes to mind: Will this page be authenticated? Or will the first user accessing the application be able to edit the Kibana configuration file (maybe do more?) with 'SU' privileges? |
I actually expected something like this to occur, so we do support building bundles that aren't plugins, which is how we build the core bundle. The Optimizer has "bundle type" support for "entry" bundles, which are intended to be loaded directly into HTML (several initialization scripts will need to be loaded too, like ui-shared-deps, etc, but there's a path in the optimizer for this type of stuff). What we don't have is a way for plugins to expose entries like this. We might not need to make a generic mechanism for plugins to define these, and instead we could just "hard code" these bundles into |
@legrego @thomheymann love this, we probably need to analyse more the possible user flows (working with Thom on it) based on the use case (local vs online etc.) but I think that it is a great starting point. Quick question: Could this be used for the rest of the security initialisation, except TLS? For example for the 'quick start and try offline' use-case, you potentially don't even need TLS. But we still want to turn on authentication and authorisation. Can we leverage this to manage the |
After a sync discussion with @legrego and @kobelb:
|
Some benefits I see from this approach:
Cons:
Things that are hard/annoying about both approaches:
An effort estimate for each path would be helpful, as well as any context on any other future additions we may make to this UI. If there are no plans for additional things, then maybe the notReadyServer path is more practical to get this UI in sooner. However, if we can imagine other things that users may be configuring with this UI, then maybe not. From a technical standpoint, there are very few configurations that I can imagine we'd need to require users to set up before starting Kibana, but I could be wrong. |
Agreed -- another benefit we get from decoupling from the
It won't be authenticated in the traditional sense. One idea I had was to have this setup process write a secret to its
I'm not aware of any future additions, but this could very well open the door to more once it's available.
No, I don't think there are many that are required, but there are quite a few that we could add in a followup to improve the getting started experience. I think we'd want to set the following initially (may be incomplete)
|
Where did we end up on this? Are we going to be having both Kibana and ES write the configuration to disk? |
At this point, we are planning to have both Kibana and ES write the configuration to disk. I haven't verified if this would work, but we could potentially have Kibana change the file permissions after writing its config to disk, so that it's not able to alter the config once setup mode has completed. Regarding multiple config files, it seems that support was added a long time ago (#6825 👋 Spencer) to support |
At one point, when Kibana was installed using a RPM/DEB, the |
Should be fine - the process is run as user/group
|
Do we have more details on how authentication and authorization will work for interactive setup mode? |
There are four "types" of authentication here:
Apologies if it's all known to you already and you were looking for something else, let me know if it's the case. |
Thanks for the elaboration, @azasypkin; and apologies for the vague question, there is clearly a lot of different forms of authc/authz going on here. The following is what I was primarily concerned about since we can't use ES as the basis for this authc/authz because Kibana can't communicate with ES at the time the user is using the UI:
If we're outputting the secret to stdout, if users install Kibana as a Linux subsystem or a Windows services, they won't easily be able to see stdout, right? We'll also want to make sure that we don't log this secret to the standard log output, as it's common for users to ingest the logs into Elasticsearch or other external systems, and we shouldn't assume that just because you have access to the logs that you're an operator. |
That's correct, the same goes for the case when users use Kibana Docker image in a detached mode. Unfortunately, we don't have much details here yet, and are evaluating different options from not-requiring this secret during the first few minutes after Kibana starts, to guiding users where to get this secret from or relaxing certain requirements if Kibana uses private IP range to connect to ES. We'll likely end up with a compromise solution, I'll keep this thread updated with our progress on that matter.
Yeah, we keep this in mind, thanks. |
Okay, after considering potential risks and UX implications, we agreed that the risk is fairly low, and requiring users to enter one more token/code/whatever will basically sabotage the idea of a simple and user-friendly setup. We settled on the following When Kibana starts in the interactive setup mode (= connection to ES isn't configured) it will allow anyone who can access it to configure the connection to Elasticsearch (either via enrollment process or manually), but only for a limited time (exact time is TBD). Once this time limit has passed, Kibana will no longer allow configuration over UI and ask users to restart Kibana (and hence restart the timer) that would serve as reasonable proof they are the legitimate operators. |
What |
Interactive setup mode will only be available if Kibana is not connected to Elasticsearch. The primary risk here is that, if Kibana is left in interactive setup mode, an attacker could set up a malicious ES cluster and "hijack" Kibana, configuring it to connect to the malicious cluster. The impact of this alone is low, but this would enable follow-on attacks:
Our mitigation for this is to limit the time that interactive setup mode is available, which seems to be an acceptable usability/security tradeoff. The likelihood of an attacker discovering a Kibana instance while it is in interactive setup mode (with a time limit on the order of hours) is extremely low. I don't think the scenario you described is applicable here. Elasticsearch will have security enabled by default, and if I understand correctly, you cannot use an ES enrollment token to force Kibana to connect to an unsecured cluster. Enrollment tokens will only work for secured clusters. |
@jportner couldn't this be used as a "honey pot" for valid credentials as well? An attacker could configure the Kibana instance that's in interactive setup mode to connect to their own cluster, and then monitor the network traffic when users try to login.
Users will still be able to disable security in Elasticsearch. As a result, if there's an internal Elasticsearch cluster that has security disabled and it's only protected by firewall rules or network segmentation, an attacker could use the Kibana instance to circumvent this protection. |
How would the time limit be enforced? Would it be ephemeral and the timer would reset when Kibana restarts? If so, an attacker could simply crash an instance of Kibana using an exploit and when it comes back up, it'll be in interactive setup mode. |
Yes, I think that would fall under "Steal data" in #89287 (comment).
Can you elaborate on this? At a minimum it sounds like it would necessitate an attacker finding a vulnerable Kibana instance (in interactive setup mode) and having prior knowledge of an unsecured ES cluster. If you're suggesting that hijacking the Kibana instance could allow RCE with a follow-on attack to discover/exploiting unsecured ES clusters; in that case i'd say this falls under "Compromise the Kibana machine" in #89287 (comment).
Sorry if it wasn't clear in Oleg's comment; the idea is that after the time limit, the preboot service actually writes something to disk (probably a setting to |
If you intended to use the term "data" to also include credentials, then I agree. However, the original phrasing mentioned tricking users to add data to an attacking cluster, not phish for valid credentials for other Elasticsearch clusters.
This would require that the attacker have prior knowledge of an unsecured cluster. However, it would allow them to circumvent a user's intended network segmentation.
This was not my intent. |
The Kibana and ES Security teams are seeing what it would take to enable security features by default, rather than requiring administrators to configure security on their own.
As part of this initiative, we would like to explore creating an interactive setup mode within Kibana. We would like to present an interface to the user on first launch, if we detect that they haven't explicitly configured their own connection to Elasticsearch.
This interface would allow users to provide their ES connection information. Once verified, we would write this configuration to disk, and allow the rest of Kibana to start.
Broadly speaking, this setup mode should be able to configure settings under
server.ssl.*
andelasticsearch.*
Here is a rough mockup to illustrate what we are thinking about. The options are only meant to illustrate possibilities, and do not dictate requirements or final design:
@thomheymann and I met with @joshdover today, and he proposed extending the "Not Ready Server" to accomodate this. This server currently runs after all plugins have completed their
setup
phase, but before they are allowed tostart
.Since we are looking to change the ES configuration as a result of the config UI, we might need to launch the "Not Ready Server" before plugins are allowed to run through
setup
(in case they obtain a reference to config that will go stale).There is a PR in flight which extends the "Not Ready Server" to support the
/api/status
endpoint, and allows other routes to be served via this server as well. There is potential for us to leverage this work in order to present a setup UI to the end user.Related: #102538, #104068
The text was updated successfully, but these errors were encountered: