Overview

FieldValue
ID1051
NameCreate LocalSubjectAccessReviews (check permissions in a namespace)
Risk CategoryInformation Disclosure
Risk LevelLow
Role TypeRole
API Groupsauthorization.k8s.io
Resourceslocalsubjectaccessreviews
Verbscreate
TagsInformationDisclosure RBACQuery

Description

Allows submitting LocalSubjectAccessReview requests to check if an arbitrary user, group, or service account has specific permissions within a particular namespace. This aids in reconnaissance of RBAC permissions within a limited scope.

Abuse Scenarios

  1. Check if a specific service account can get secrets in a given namespace.
kubectl auth can-i get secrets -n <namespace> --as=system:serviceaccount:<namespace>:<serviceaccount-name>
# Example: kubectl auth can-i get secrets -n production --as=system:serviceaccount:production:my-app-sa
  1. Check if a specific user can update deployments in a given namespace.
kubectl auth can-i update deployments -n <namespace> --as=user:<username>
# Example: kubectl auth can-i update deployments -n default --as=dev-user