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

Compartmentalized privileges #90691

Open
kobelb opened this issue Feb 8, 2021 · 8 comments
Open

Compartmentalized privileges #90691

kobelb opened this issue Feb 8, 2021 · 8 comments
Labels
discuss Feature:Hardening Harding of Kibana from a security perspective Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! unified-security-painpoint Highlights issues that are painpoints as a result of the lack of a unified security model

Comments

@kobelb
Copy link
Contributor

kobelb commented Feb 8, 2021

The following is super hand-wavey and inspired largely by Chrome's approach to Linux Sandboxing: https://chromium.googlesource.com/chromium/src/+/master/docs/linux/sandboxing.md

Currently, Kibana runs as a single process and all code has the same privileges to the filesystem, Elasticsearch, network, etc. As a result, we continue to run into security concerns from granting Kibana privileges when it would dramatically increase the actions that an attacker would be able to perform if they found an RCE.

For example, we currently require user intervention for Ingest Manager packages to be updated because we're concerned about giving the kibana_system user too many privileges. This comes at a detriment to our end-users because they have to wait for an adequately privileged user to come around and update the packages. These inconveniences are expanding over time, and are being tracked by #89827

If we weren't worried about all of Kibana's code having the same privileges, and could for example drop privileges after initial startup, or run different plugins with different privileges, it seems like this would largely mitigate against these concerns.

@kobelb kobelb added discuss Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! Feature:Hardening Harding of Kibana from a security perspective labels Feb 8, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@kobelb
Copy link
Contributor Author

kobelb commented Feb 8, 2021

/cc @alexh97 @scunningham

@legrego
Copy link
Member

legrego commented Feb 10, 2021

I could envision the kibana_system account being leveraged [nearly] exclusively by core, with core creating lesser privileged credentials for each registered plugin. Perhaps an API Key, or something similar to an API Key.

It wouldn't prevent an RCE from reading kibana_system's credentials off of the file system, but something like nodejs/node#33504 / npm/rfcs#297 might give us what we need if/when that lands into node itself.

@pgayvallet
Copy link
Contributor

I could envision the kibana_system account being leveraged [nearly] exclusively by core, with core creating lesser privileged credentials for each registered plugin.

I'm not up to date with node's security sandboxing. Would that forces us to run all plugins in distinct processes (I don't need to explain the technical implications of implementation that), or can the sandboxing be controlled at a more granular intra-process level?

(Can I add that I really miss Java's security manager / isolated class loaders for such issues?)

@kobelb
Copy link
Contributor Author

kobelb commented Feb 16, 2021

I'm not up to date with node's security sandboxing. Would that forces us to run all plugins in distinct processes (I don't need to explain the technical implications of implementation that), or can the sandboxing be controlled at a more granular intra-process level?

As far as I'm aware, Node.js doesn't currently have any method of sandboxing code. However, operating systems themselves provide various facilities that apply to an entire process, for example: https://en.wikipedia.org/wiki/Seccomp

@Bamieh
Copy link
Member

Bamieh commented Feb 18, 2021

As far as I'm aware, Node.js doesn't currently have any method of sandboxing code.

That is true. NodeJS provides a VM API to compile/execute isolated scripts BUT they are not intended for security purposes. IMO Managing system level priviledges inside an application is just as troublesome as not having any sandboxing between modules.

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Aug 5, 2021
@legrego legrego removed EnableJiraSync loe:small Small Level of Effort impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Aug 18, 2022
@legrego legrego added the unified-security-painpoint Highlights issues that are painpoints as a result of the lack of a unified security model label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Feature:Hardening Harding of Kibana from a security perspective Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! unified-security-painpoint Highlights issues that are painpoints as a result of the lack of a unified security model
Projects
None yet
Development

No branches or pull requests

6 participants