DEV Community

Taylor Zhu
Taylor Zhu

Posted on

Review Access Grants Like Code: A Fail-Closed RBAC Gate

Kubernetes RBAC grants combine additively. A RoleBinding referencing a ClusterRole applies only in its namespace; a ClusterRoleBinding grants it cluster-wide. (Kubernetes RBAC documentation) Review: what new access does this merge grant?

This gate fits teams sharing an AI endpoint, key, or dashboard across namespaces. Prerequisites: binding read access, one owner, and impersonation permission if the check impersonates the subject.

Documented behaviour vs. proposed practice

  • Documented (Kubernetes): bindings are additive; removing one may leave equivalent access via another grant.
  • Proposed (unverified): no access change merges without the five-part packet.

Steps

  1. Inventory the grants that apply to the subject, including group membership, RoleBindings and ClusterRoleBindings.
  2. State the intended change for a specific subject, verb, API group, resource and namespace. Capture the current decision.
  3. Plan a second check in a neighbouring namespace where the same request should remain denied.
  4. Name the rollback owner. List which grants the team would restore or remove, and whether other matching grants would still allow the access.
  5. Attach five items: the inventory, intended change, authorization check results, rollback actions and owner, and approval. If an item is missing, pause the merge.

Test

Before merge, rehearse in an isolated test setup that reflects the intended scopes. Capture both decisions before applying the proposed grant there. Apply it to the test setup, then repeat exactly the same authorization questions for the same identity.

For this example, the target request should change from denied to allowed. The neighbouring request should remain denied. Save both observations with the change record.

  • If the target still denies access, inspect the subject or group, binding namespace, role reference, and whether the role grants the precise verb and resource. The binding name alone does not determine authorization.
  • If the neighbour allows the request, inspect all applicable grants there. Check other affected subjects before changing a shared binding. Rehearse rollback and repeat both checks to find out whether the requested permission actually ended.

Limits

This is not a full authorization model; it covers RBAC bindings only. Other mechanisms need review. Emergency access needs separate review. No command here was executed; verify against documentation.

This article was created with AI assistance.

Top comments (0)