-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Object level security for Application Privilege Actions #31987
Object level security for Application Privilege Actions #31987
Conversation
Replace "ClusterPrivilegePolicy" with "ConditionalClusterPrivileges" that just contains utility methods, and place the condional privileges directly on to RoleDescriptor
# Conflicts: # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/Role.java # x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStore.java
Pinging @elastic/es-security |
/** | ||
* @deprecated Use {@link #cluster(Set, Iterable)} | ||
*/ | ||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have a follow up PR to remove the uses of this method (which are all in tests)
Actually, don't review this PR. I'll leave this open for now so I can check the CI results. |
I raised #31998 instead. |
Note: We've haven't reached a definitive agreement on what the JSON looks like for this, but I think it's worth getting the review started while we keep thinking about that.
This introduces "conditional cluster privileges" to the X-Pack permissions model.
From a pure authz point of view (
Role
andAuthorizationService
), the change is simply the addition of aTransportRequest
parameter toClusterPermission
.This means that a permission is able to consider both the action name and the request content in order to decide whether a particular action should be allowed.
At the
RoleDescriptor
level, the change introduces a newConditionalClusterPrivilege
interface, alongside the existingString
action-name cluster-privileges.Logically these could be combined, but the separation allows for easy backwards compatibility in the the JSON API (and index format) for name based privileges. Traditional, action-name cluster privileges are still described by a
cluster: []
element in the JSON, while conditional privileges are described in apolicy: {}
element (the name is subject to change).For the roles API, and builtin roles providers (native + file) the only supported conditional privilege is
ManageApplicationPrivileges
represented in JSON as:which restricts the use of the Get/Put/Delete Privileges actions to those that act upon the specified application names ("my-app", "app-*")
It is possible for custom role providers to provide additional conditional privileges (documentation and examples for this will be added in a later PR).