-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Management] If "All" cluster privileges is selected, allowing unchecked other options is misleading #18482
Comments
Original comment by @skearns64: ++ this is a bug. It's not a critical one, but it can lead to a misunderstanding of cluster privileges. I'm happy with your suggested approach, but I prefer the behavior to be: "if I marked this as low-fruit on the assumption that is true, anyone is welcome to remove that label if I've guessed wrong :) |
Pinging @elastic/kibana-security |
Now that the cluster privileges are using a multi-select dropdown, the interaction is a bit different, but still misleading. I think in general we would want a more comprehensive solution, since I believe that we have other cluster privileges that effectively grant other cluster privileges. Or to say another way, some privileges are subsets of other privileges, and we shouldn't only come up with a solution to the |
Since this issue was opened, we have started relying on the "builtin privileges API" to populate the available cluster and index privileges. In order to make progress here, we would need to enhance the ES API to give us the relationship between each of these privileges. Kibana does not have enough information to make this determination on its own. |
@elastic/es-security do you have thoughts on the technical feasibility of this? Essentially, this is asking for a privilege hierarchy for cluster (and I suppose index) privileges, so we know which privileges are subsets of others. |
On the ES side, to improve error message when access is denied, @tvernum added sorting for both index and cluster privileges (elastic/elasticsearch#60357, elastic/elasticsearch#66900) so that we can recommend privileges from least to most powerful. The sorting is not perfect though. It is based on the number of privileges implied by a privilege, e.g. The current GetBuiltinPrivileges API return privileges sorted by names. We can change (maybe subject to BWC) the sort order to be "least-to-most-powerful" as described above if this is helpful for Kibana. Alternatively, it may also be possible to build full hierarchy of the privileges. A new API is probably needed to expose this result. This will be an overall larger effort. |
Thanks, Yang. It sounds like what we would really need is the full hierarchy, but I don't think it's worth taking on at this point given that it's not a trivial amount of work. |
I don't think it's a huge technical effort. We know which privileges imply which other privileges, and we can find a way to return that in an API. But the existing API isn't really designed to be evolved that way. I threw something together in the background (tvernum/elasticsearch@b118aa329d7) that horribly abuses the current API by adding a
The problem isn't the amount of work (I hacked something together on a couple of hours while working on something else), it's coming up with a way to fit it into ES without just adding a whole new API. |
I don't think it's huge either. I meant it is a "larger" effort, not "large" ("larger" than just sorting the existing returned values in GetPrivileges API that is).
That's where the majority of work would be. I suspect the Clients team would rather dislike the idea of having a query parameter to control the response format. I haven't asked them, but it feels something challenging with existing client generation framework. I think this is an idea worth exploring in general. I had similar thought when trying to come up a way for HasPrivileges to return "partial". It is a middle-ground between breaking changes and entirely new APIs. Our BWC guideline says:
But did not say anything about whether it is a breaking change if we add the above two together. Some clarification on this topic would be very helpful. |
For this specific API, maybe we can get away with just adding a new top level field, say |
I don't have a strong opinion to be honest, privilege's specific |
You could have something like:
I haven't attempted to work out how well that sits with the API guidelines. It's a bit of a band-aid though, because it solves this immediate need, but doesn't help prepare for any future changes. |
Yeah, I meant that having |
Original comment by @stacey-gammon:
Unless I am missing something, the following seems to give the role security access:
But this doesn't:
Is there any reason, that selecting "All" doesn't automatically select all the other options, and if one of the sub areas is unchecked, then it would automatically uncheck "all"?
cc @skearns64 @cjcenizal @snide
The text was updated successfully, but these errors were encountered: