Learning center

Diagnose a forbidden Kubernetes auth can-i impersonation check

When kubectl auth can-i --as is itself forbidden, read which action the error names. The server may have denied the operator permission to impersonate the subject before it evaluated the subject's requested action.

Suppose an operator investigating fictional system:serviceaccount:jobs:report-reader receives an error saying the operator cannot impersonate the service account. That response gives no decision about the report reader's ability to get ConfigMaps. Inspect the original workload's audit record, or have an authorized maintainer run a self-check from the workload's existing approved credential context. An operator already permitted to impersonate can run a scoped check that preserves relevant identity attributes. Kubernetes user impersonation ยท kubectl auth can-i

Send the original denial and the failed diagnostic as separate events. Impersonation is a privileged capability. A single unanswered diagnostic does not itself justify granting it.

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