-
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
Explicitly Restrict API endpoints to Superusers and Operators #196271
Comments
Pinging @elastic/kibana-security (Team:Security) |
@elena-shostak let's discuss operator privileges a bit more. I expect we'll want something more granular than "is this user an operator"? |
Draft PR for operator privileges.
The simplest check we can make is looking whether What to do if operator privileges are disabled? What to do with operator privileges on prem? @legrego @azasypkin WDYT? |
Thanks for checking this. Do I understand correctly that if the operator privileges functionality is disabled, but a user has the privileges listed here, they will still be able to perform all these operations? Looking at the
@elena-shostak As far as I understand, this is an Elasticsearch configuration, and in Kibana, we might not have a way to know its value (might be worth checking with ES team?) or distinguish between the case when the operator privileges functionality is disabled and when it’s just a user who isn’t an operator. The way it’s implemented in Elasticsearch, it feels more like a complementary filter to the authorization decision - an additional layer that can be enabled or disabled, but it doesn’t replace proper privilege checks. Technically, any user can be marked as an operator via
I’m leaning towards replicating this behavior in Kibana as well unless there’s a reason for us to deviate. For instance, the Kibana endpoint could be restricted to superusers who are also operators, or it could require a specific non-superuser privilege/access tag and operator status. If the operator privileges functionality is disabled, we would just ignore the operator part of the requirement. I’m not sure yet how to best model this in the route’s security config, but that’s an implementation detail we can iterate on. Eventually, we might extend this check to more Kibana privilege areas, similar to how Elasticsearch applies it to both actions and cluster settings. But for now, restricting it to Kibana API access seems reasonable. The challenge is determining how Kibana can know whether the operator privileges functionality is enabled in the Elasticsearch cluster. If there’s no way to get this info from Elasticsearch, we could probably introduce a What do you think?
I’m not sure we can say that these privileges are taken away from superuser. To perform any operation that requires operator privileges, a superuser must still have all the necessary privileges, the only difference is that they also need to be marked as an operator. |
Sorry @azasypkin, this is the framing that I've been using, even though it's not technically correct to think of it this way. The net result is that an on-prem superuser is able to perform operations that an ECH superuser cannot, and that is due to the enforcement of operator privileges. And here, I'm referring to |
Yep, users with necessary privileges (like superusers) will be able to perform operations
I actually lean towards this one, if operator functionality is disabled we skip the operator check, but still check the superuser access.
For the privilege/access tag option, I initially wanted to distinguish between
Will check it out, in worst case we would need to mirror setting to the Kibana config |
@elena-shostak it looks like we can determine this from the
# This result is from my ECH deployment
{
"security": {
"operator_privileges": {
"available": true,
"enabled": true
}
}
} |
Some APIs in Kibana are implicitly restricted to superusers by specifying access tags that are not defined in Kibana’s authorization model. For instance, the API at key_rotation.ts uses the
access:rotateEncryptionKey
tag, which results in only superusers or privileged accounts being able to access the endpoint.We need to implement a more explicit mechanism to restrict API access to superusers or similarly privileged users, instead of relying on implicit behavior.
For the
superuser
access we can introduce explicit and reserved privilege setFor operators, we can check privileges using the
getCurrentUser().operator
method which indicates whether user is operator or not.Introduce reserved privileges set with alias corresponding to
Superuser
andOperator
:Checks performed in
api_authorization
need to be adjusted accordingly.The text was updated successfully, but these errors were encountered: