SubjectAccessReview [authorization.k8s.io/v1]
Description
SubjectAccessReview checks whether or not a user or group can perform an action.
Type
object
Required
spec
Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set |
|
| SubjectAccessReviewStatus |
.spec
Description
SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set
Type
object
Property | Type | Description |
---|---|---|
|
| Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer it needs a reflection here. |
|
| |
|
| Groups is the groups you’re testing for. |
|
| NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface |
|
| ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface |
|
| UID information about the requesting user. |
|
| User is the user you’re testing for. If you specify “User” but not “Groups”, then is it interpreted as “What if User were not a member of any groups |
.spec.extra
Description
Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer it needs a reflection here.
Type
object
.spec.nonResourceAttributes
Description
NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
Type
object
Property | Type | Description |
---|---|---|
|
| Path is the URL path of the request |
|
| Verb is the standard HTTP verb |
.spec.resourceAttributes
Description
ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface
Type
object
Property | Type | Description |
---|---|---|
|
| Group is the API Group of the Resource. ““ means all. |
|
| Name is the name of the resource being requested for a “get” or deleted for a “delete”. “” (empty) means all. |
|
| Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces “” (empty) is defaulted for LocalSubjectAccessReviews “” (empty) is empty for cluster-scoped resources “” (empty) means “all” for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview |
|
| Resource is one of the existing resource types. ““ means all. |
|
| Subresource is one of the existing resource types. “” means none. |
|
| Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. ““ means all. |
|
| Version is the API Version of the Resource. ““ means all. |
.status
Description
SubjectAccessReviewStatus
Type
object
Required
allowed
Property | Type | Description |
---|---|---|
|
| Allowed is required. True if the action would be allowed, false otherwise. |
|
| Denied is optional. True if the action would be denied, otherwise false. If both allowed is false and denied is false, then the authorizer has no opinion on whether to authorize the action. Denied may not be true if Allowed is true. |
|
| EvaluationError is an indication that some error occurred during the authorization check. It is entirely possible to get an error and be able to continue determine authorization status in spite of it. For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request. |
|
| Reason is optional. It indicates why a request was allowed or denied. |
API endpoints
The following API endpoints are available:
/apis/authorization.k8s.io/v1/subjectaccessreviews
POST
: create a SubjectAccessReview
/apis/authorization.k8s.io/v1/subjectaccessreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. |
|
| If ‘true’, then the output is pretty printed. |
HTTP method
POST
Description
create a SubjectAccessReview
Parameter | Type | Description |
---|---|---|
| SubjectAccessReview schema |
HTTP code | Reponse body |
---|---|
200 - OK | SubjectAccessReview schema |
201 - Created | SubjectAccessReview schema |
202 - Accepted | SubjectAccessReview schema |
401 - Unauthorized | Empty |