Learning center

Find an API group mismatch in a Kubernetes RBAC denial

Match the request's API group and resource to the Role rule. The same kind of authorization check can return different results for resources served by different API groups.

In a fictional controller, a Role grants list on deployments under apiGroups: [""]. The API returns Forbidden when the controller lists deployments in reports. Use kubectl api-resources --api-group=apps to inspect discovery and kubectl auth can-i list deployments.apps -n reports from the relevant credential context. The discovery response identifies the resource under apps. An empty group in a rule means the core API group. Kubernetes API groups ยท Kubernetes RBAC rules

Take the observed group, plural resource, verb and namespace to the Role owner. This establishes which rule failed to cover that tuple. Group, resource and verb wildcards would cover additional requests the controller does not require.

Trace another denied request.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading