Deleting one binding does not prove access ended. Kubernetes RBAC grants combine additively. A RoleBinding grants permissions in its own namespace even when it refers to a ClusterRole. A ClusterRoleBinding can grant them cluster-wide. A second grant may still cover the same request. Kubernetes RBAC documentation
Example (illustrative): workflow steps in agents-prod run as service account step-runner. The team deletes the RoleBinding in agent-artifacts that granted write access. A separate ClusterRoleBinding still grants edit cluster-wide, so the permission remains reachable.
Assumptions: RBAC is the only authorization source for this identity; the binding list and subject groups are complete. Otherwise the diff is incomplete.
Steps
- Record the service account and the groups it belongs to according to the identity system.
- List the RoleBindings and ClusterRoleBindings that apply to these subjects. Resolve their referenced roles.
- Write down the specific API group, resource, verb and namespace for the unwanted write. Record its effective decision before the change and name one control action that must keep working.
- Model removal of the proposed binding. Does any remaining rule still authorize that write for this subject?
- Accept the change only when the target write goes from allowed to denied, the control keeps its expected decision and no unintended permission is introduced.
- Recheck after the cutover retry window if a queued step could apply a binding again.
Test
This is a proposed staging check, not a report of an executed test. Define four inputs: the subject, the namespace, the API group/resource, and the verb. Also define one control action that should remain allowed. Before removal, observe the effective decision for the target write and the control. After removal, observe both again.
Expected before: target allowed, control allowed. Expected after: target denied, control allowed. If the target remains allowed, another grant still reaches the same subject; trace it before making further changes. If the control becomes denied, the proposed removal is too broad. If the subject or action cannot be established, the result is inconclusive.
Timing matters. If a write was accepted before revocation, check whether it created an artifact; revocation does not by itself undo earlier effects. Decide separately whether cleanup is needed.
This article was created with AI assistance.
Top comments (0)