Verify the access boundary from identity through to the allow and deny audit
RBAC (Role-Based Access Control): an approach that attaches roles to subjects to define which resources and actions are permitted.
Authentication determines who the caller is, and authorization determines what the caller may do. Only by separating people, workload service accounts, automation, and break-glass identities can you trace each credential's scope, lifetime, and owner.
An RBAC permission is built from a combination of verb, resource, namespace, and resourceName, and a RoleBinding attaches it to a subject. With wildcards and cluster-admin, the granted permissions can become broader than expected when new APIs are added.
Least privilege is not about shortening a list of requests; it is a two-way test that allows the actual work tasks and denies prohibited actions. Verify it with auth can-i and the audit log.
In the training example granting cluster-admin just to read logs also opens unnecessary permissions such as reading secrets. Narrow the required action to get on pods/log within a namespace. Passing only the allow test is not enough; also confirm that listing secrets is denied. The operator running the impersonation query needs their own permission too, so distinguish a failure of the test from a denial for the target role.
- Why does this happen?
- RBAC permissions are built from combinations of verb, resource, namespace, and resourceName, and a RoleBinding binds them to a subject. With wildcards and cluster-admin, permissions can become broader than expected when new APIs are added.
- When is it a problem?
- If you see shared credentials, a wildcard, or no owner, there are insufficient grounds to proceed.
- Common beginner misconceptions
- Do not put service account tokens or kubeconfig into tickets, source repositories, or shell history. Use short-lived credentials and a secret store.
- How to verify it yourself
- Inventory the identity type, owner, purpose, expiry, and issuer. Break the actual task down into verb, resource, and namespace.