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

Allowing the kibana system role to get/put privileges #31201

Merged
merged 3 commits into from
Jun 26, 2018

Conversation

kobelb
Copy link
Contributor

@kobelb kobelb commented Jun 8, 2018

For Kibana to take advantage of the application privileges, the Kibana server will need to update it's privileges when they don't exist or are different than expected. Also on start-up the Kibana server will create the equivalent of the "kibana_user" and "kibana_dashboard_only_user" roles with the appropriate "resource" when they don't exist as "non reserved roles" so that users are able to modify the privileges associated with these roles.

@kobelb kobelb requested a review from tvernum June 8, 2018 12:32
@joshbressers
Copy link

This is potentially dangerous if Kibana can update privileges at will. How often do we envision this having to happen?

@kobelb kobelb requested a review from jaymode June 8, 2018 13:31
@kobelb
Copy link
Contributor Author

kobelb commented Jun 8, 2018

A discussion happened with regard to this PR in the #kibana-security Slack channel, and I've attempted to summarize and expound upon it here.

The ability to PUT privileges on start-up isn't our main concern at this point, as these are only used by the Kibana application for asserting it's own access-control.

The primary concern at this point is the ability for the Kibana system role to update arbitrary roles.

Kibana is currently creating roles on start-up for the equivalent of the "kibana_user" and "kibana_dashboard_only_user" when the xpack.security.rbac.enabled: true setting is set in the kibana.yml and the roles don't exist in Elasticsearch already. We are currently doing so for a few reasons:

  1. We only need these roles when xpack.security.rbac.enabled: true in the kibana.yml and we didn't want to be using reserved roles for these as this could potentially clutter up the list of roles when they weren't being utilized.
  2. When we do use a reserved role for the "kibana_user" this can't be modified, so the user isn't able to modify anything on the role, including the Kibana privileges which will commonly be modified as soon as Spaces is a reality
  3. We've historically only created "kibana_user" and "kibana_dashboard_only_user" roles for the default Kibana "tenant" and made the user manually create these roles for the other "tenant", creating these automatically on startup was supposed to ease this process. This one I'm less concerned with, as hopefully multi-tenant deployments just stop happening as soon as Spaces is released.

These are the existing solutions that I've thought of, or @joshbressers proposed in the #kibana-security Slack channel.

  1. Require a user with the manage_security cluster privilege login to Kibana first to create the roles.
  2. Utilize a reserved role for the new "kibana_user" and "kibana_dashboard_only_user" roles
  3. Allow the Kibana server to only create new roles, not update existing roles

@colings86 colings86 added >enhancement :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC labels Jun 11, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security

@kobelb
Copy link
Contributor Author

kobelb commented Jun 11, 2018

After some discussion, we've removed the need for the Kibana system role needing to GET/PUT roles, so this only adds the ability to for the Kibana system role to GET/PUT privileges.

@kobelb kobelb force-pushed the kibana-manage-privs branch from dd66725 to 5e4c27e Compare June 11, 2018 13:10
@kobelb kobelb changed the title Allowing the kibana system role to get/put privileges and roles Allowing the kibana system role to get/put privileges Jun 11, 2018
Copy link
Member

@jaymode jaymode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine with me for the branch right now. As long as @tvernum concurs, then lets merge this as is until we figure out how we're going to limit the scope of modifying privileges.

Copy link
Contributor

@tvernum tvernum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per @jaymode's comments, this is good for the branch but we'll need to work out the longer term plan.

@kobelb kobelb merged commit 5f36981 into elastic:security-app-privs Jun 26, 2018
@kobelb kobelb deleted the kibana-manage-privs branch June 26, 2018 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants