Illustrative case: an on-call team inherits a staging cluster with no clear roster of people who can write to it. A 90-minute spike tests that inventory.
Hypothesis. The handoff roster accounts for each identifiable human with a write grant in our RBAC inventory. Record a group with unknown members as an unresolved case, not as an empty group.
Prerequisites. Use an authorized read-only export of the relevant RoleBindings, ClusterRoleBindings and every Role or ClusterRole they reference. Define write as a short list of verbs and resources in named namespaces. To resolve group subjects into individual humans, also supply a dated membership roster.
Steps
- List bindings and subjects; separate users, groups and service accounts.
- Resolve each roleRef to verbs and resources and merge into effective permissions per principal. Grants are additive: per the Kubernetes RBAC documentation, a RoleBinding grants its subjects permissions in its namespace even when it references a ClusterRole; a ClusterRoleBinding grants them cluster-wide; removing one binding can leave equivalent access elsewhere.
- Diff against the handoff ticket's roster, marking group subjects unexpanded unless membership data is supplied.
Test
Test the inventory method on a small, read-only fixture with known contents. Give it one RoleBinding in the staging namespace that grants a named user one specific write permission, its referenced role, and no other bindings. Prepare an independent expected row for that user, verb, resource and namespace before running the inventory.
Expect the staging grant and infer no corresponding grant in a neighbouring namespace. In a second fixture, remove the binding and leave the role definition untouched. The staging grant should disappear from the inventory. If it remains, trace the recorded binding and role. The test checks this inventory, not live authorization.
Note token custody: RFC 6750 notes that whoever possesses a bearer token can present it without proving possession of a separate key. Record who ran which check: PROV-DM models that agent-activity link and gives lineage, not correctness.
Limits: no admission webhooks, cloud IAM, impersonation, or proof of use. This enumerates RBAC grants, not all authorizers.
This article was created with AI assistance.
Top comments (0)