Overview

FieldValue
ID1050
NameCreate SubjectAccessReviews (check arbitrary permissions)
Risk CategoryInformation Disclosure
Risk LevelMedium
Role TypeClusterRole
API Groupsauthorization.k8s.io
Resourcessubjectaccessreviews
Verbscreate
TagsInformationDisclosure RBACQuery

Description

Permits submitting SubjectAccessReview requests to check if an arbitrary user, group, or service account has specific permissions cluster-wide. This can be used for reconnaissance to understand the RBAC configuration and identify potential privilege escalation paths.

Abuse Scenarios

  1. Check if a specific service account can create pods in any namespace.
kubectl auth can-i create pods --as=system:serviceaccount:<namespace>:<serviceaccount-name> --all-namespaces
# Example: kubectl auth can-i create pods --as=system:serviceaccount:kube-system:default --all-namespaces
  1. Check if a specific user can delete nodes.
kubectl auth can-i delete nodes --as=user:<username>
# Example: kubectl auth can-i delete nodes --as=admin