Kubernetes RBAC checker
Ask who can do what in a small cluster. The checker follows each RoleBinding and ClusterRoleBinding and names the rule that allows or denies the request.
What you’re looking at
Ask who can do what in a small cluster. The checker follows each RoleBinding and ClusterRoleBinding and names the rule that allows or denies the request.
Your goal: Answer five who-can-do-what questions, find the binding that over-shares secrets, and check what a cleanup would change.
- Subject
- the list of users and service accounts on the left. A service account is the identity a pod runs as.
- Verb, Resource, Namespace
- three menus under the list. Together they make one question, such as get pods in shop.
- Access check
- the right side. It shows the kubectl auth can-i command, yes or no, and which binding allowed it.
- Bindings in the cluster
- the list below, one row per binding with an Enabled switch. RB means RoleBinding, CRB means ClusterRoleBinding.
- Walkthrough
- the numbered path beside the workbench (below it on a phone). Each step says what to do and what you should see. Hints open one at a time.
Words you will meet
- RBAC
- role-based access control
Start with step 1 in the walkthrough. Every step says what to do and what you should see. The whole thing takes about 2 min to talk through.
Briefing
A small cluster runs a shop, a payments service, and monitoring. Pick a subject, a verb, a resource, and a namespace, and the checker answers like kubectl auth can-i, naming every binding that grants the request.
You can switch bindings off to see what a cleanup would change before you make it.
Subject
$ kubectl auth can-i delete pods -n shop --as maya no
No binding grants this. RBAC has no deny rules, so anything not granted is refused.
Bindings in the cluster
- RBshop/devs-readRole/pod-reader → Group dev-team
- RBshop/ci-deployRole/deployer → ServiceAccount shop/ci
- RBshop/ci-secretsClusterRole/secret-reader → ServiceAccount shop/ci
- CRBmonitoring-viewClusterRole/view-lite → ServiceAccount monitoring/prometheus
- CRBlegacy-secretsClusterRole/secret-reader → Group system:serviceaccounts
Roles and ClusterRoles
Role: shop/pod-reader - apiGroups: [""] resources: [pods, pods/log] verbs: [get, list, watch] Role: shop/deployer - apiGroups: ["apps"] resources: [deployments] verbs: [get, list, update, patch] - apiGroups: [""] resources: [configmaps] verbs: [get, list] ClusterRole: secret-reader - apiGroups: [""] resources: [secrets] verbs: [get, list] ClusterRole: view-lite - apiGroups: [""] resources: [pods, services, configmaps] verbs: [get, list, watch]
The whole walkthrough
Every step in order, written to be read aloud: 281 words, about 2 min. It gives away every answer, so try the steps first.