The NIST RBAC family is usually presented in layers:
Kubernetes implements a practical subset of this model. RKE2 then ships a specific default configuration: Node plus RBAC authorization, bootstrap credentials, system identities for kubelets and controllers, and packaged cluster components with their own ServiceAccounts.
Kubernetes still has both ideas. A Role or ClusterRole is a named permission set. A Group in a certificate or identity provider is a collection of users. Bindings connect the two.
On RKE2, a typical API request is authenticated with a client certificate or a ServiceAccount token, authorized by the Node and RBAC authorizers, and then admitted by plugins such as NodeRestriction.
users, roles, and permissions, which are operations applied to objects.In Kubernetes terms:
| NIST idea | Kubernetes object or concept |
|---|---|
| User | User, Group, or ServiceAccount |
| Role | Role or ClusterRole |
| Permission | a PolicyRule: apiGroups, resources, verbs, optional resourceNames |
| Object | an API resource such as pods, secrets, nodes, or a non-resource URL such as /healthz |
| User-role assignment | RoleBinding or ClusterRoleBinding |
| Session | a kubeconfig context, an API token, or an impersonated identity |
get pods, create deployments, list secrets.On a Kubernetes platform, the “enterprise” roles are often team names, namespaces, and environments: team-a-dev, team-a-prod-readonly, platform-admin.
Role. If any bound rule allows the request, RBAC allows it.resources: ["*"] and verbs: ["*"] applies not only to objects that exist today, but also to API types added later, including CustomResourceDefinitions.Kubernetes does not ask a human to “activate role X” at login in the NIST sense. Activation is implicit:
kubectl impersonate temporarily acts as another user, group, or ServiceAccount.Certificate lifetime, token expiration, and impersonation policy are the closest built-in substitutes for session control.

On RKE2, the local privileged identity is often the server kubeconfig at /etc/rancher/rke2/rke2.yaml. That file is an administrative credential, not a team role. Production platforms then map people through Rancher, OIDC, or another identity provider onto Kubernetes User and Group names.
Kubernetes does not implement a general role-inheritance graph the way NIST Hierarchical RBAC does. Instead it offers three practical substitutes:
ClusterRole into many namespaces with RoleBinding;admin, edit, and view;
A Kubernetes analogue is a namespace permission stack:
view can list most objects but cannot read Secrets;edit can change workload objects and can read Secrets;admin can also manage Roles and RoleBindings inside the namespace;cluster-admin can do anything in any namespace.
Group subject.dev, stage, prod)Specialist inherits from Physician
ClusterRole aggregation is the Kubernetes connector-role mechanism. A controller copies rules from labeled ClusterRoles into admin, edit, or view. Direct edits to aggregated rules are overwritten.
In Kubernetes, namespaces are the usual OU analogue for application teams. They are not a complete security boundary by themselves: cluster roles, node access, persistent volumes, and some admission policies still cross namespaces. They are, however, the right place to bind most day-to-day permissions.
Limited hierarchies remain common in commercial authorization products
RKE2 and Kubernetes sit closer to the Stanford layering than to a full NIST inheritance graph: a job function (platform-operator) is composed from tasks (upgrade nodes, inspect workloads) that become API entitlements (get nodes, list pods).
Kubernetes does not enforce SSD automatically. Conflicting RoleBindings can both exist. Static SoD is therefore an operational policy: code review, admission policy, and periodic binding audits.
Kubernetes sessions are request-scoped. Dynamic SoD is only as strong as credential hygiene: short-lived tokens, no shared cluster-admin kubeconfig, and no standing impersonation rights.
root or superuser role that is routinely active.On an RKE2 cluster, cluster-admin and membership in system:masters break Property 4. Those identities exist for break-glass administration. They should not be the daily credential for application work.
doctor-on-call only for specific people and hoursKubernetes RBAC lives in the rbac.authorization.k8s.io API group and uses four objects:
| Object | Scope | Purpose |
|---|---|---|
Role | namespaced | names a permission set inside one namespace |
ClusterRole | cluster | names a permission set for cluster-scoped resources, or a reusable set of namespaced permissions |
RoleBinding | namespaced | grants a Role, or a ClusterRole limited to that namespace, to subjects |
ClusterRoleBinding | cluster | grants a ClusterRole across the cluster |
A RoleBinding may reference:
Role in the same namespace, orClusterRole, in which case the ClusterRole’s namespaced permissions apply only inside the RoleBinding’s namespace.A ClusterRoleBinding is required to grant cluster-scoped power such as listing Nodes, or to grant namespaced permissions in every namespace.
A binding names one or more subjects:
sub / email claim.O=) field.system:serviceaccount:<namespace>:<name>. Group forms include system:serviceaccounts and system:serviceaccounts:<namespace>.A permission rule is a tuple, not a Linux capability:
1
2
3
4
5
6
7
8
9
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: team-a
name: pod-reader
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
Important details:
apiGroups: [""] means the core API group.pods/log and pods/exec are not implied by pods./healthz can appear only on ClusterRoles.bind, escalate, and impersonate are high-risk verbs because they let a subject grant or assume permissions they do not already have.| ClusterRole | Typical binding | Meaning |
|---|---|---|
cluster-admin | system:masters via ClusterRoleBinding | superuser: any verb on any resource |
admin | RoleBinding in a namespace | namespace administrator, including Roles and RoleBindings, but not cluster objects |
edit | RoleBinding in a namespace | mutate most namespace objects; can read Secrets |
view | RoleBinding in a namespace | read most namespace objects; cannot read Secrets |
edit can escalate in practice: reading Secrets may reveal ServiceAccount tokens, and creating Pods can run as another ServiceAccount in the same namespace. view omits Secrets for that reason.
In production, engineers translate job functions and workload identities into the smallest practical permission sets, then review how those permissions can combine through role bindings, aggregation, impersonation, or ServiceAccount tokens.
The joint NSA and CISA Kubernetes Hardening Guide connects Kubernetes authorization to operational hardening, including least-privilege ServiceAccounts and restrictions on access to sensitive cluster resources.
A professional RBAC review should document:
create, update, patch, delete, bind, escalate, and impersonate;kubectl auth can-i used as an audit question rather than as a lab script.The strongest design demonstrates not only what a user can do, but also what the user is intentionally prevented from doing.
RKE2 is a CNCF-certified Kubernetes distribution. It does not replace Kubernetes RBAC with a different model. It packages Kubernetes with:
The RKE2 CIS Hardening Guide is explicit: RKE2 will not rewrite the host OS for you, and several CIS controls still need operator action.
flowchart TD
Client["kubectl, controller, kubelet, or Pod"]
AuthN["Authentication<br/>client cert, bearer token, or bootstrap token"]
NodeAuthz["Node authorizer"]
RBACAuthz["RBAC authorizer"]
Admit["Admission<br/>NodeRestriction, PSA, webhooks, quotas"]
Etcd["etcd / API object"]
Client --> AuthN
AuthN -->|identity: User, Groups, Extra| NodeAuthz
NodeAuthz -->|allowed| Admit
NodeAuthz -->|not a node request| RBACAuthz
RBACAuthz -->|allowed| Admit
RBACAuthz -->|denied| Deny["HTTP 403"]
Admit -->|accepted| Etcd
Admit -->|rejected| Reject["admission error"]
Authorizers are consulted in order. The Node authorizer handles kubelet requests associated with a Node. Other requests fall through to RBAC. If neither authorizer allows the request, the API server denies it.
RKE2’s CIS self-assessment documents the default API-server flag:
--authorization-mode=Node,RBAC
It also documents that AlwaysAllow must not be used. Overriding authorization mode in /etc/rancher/rke2/config.yaml is a high-impact change.
Kubelets need to read Secrets for Pods scheduled to them, report Pod status, and register node identity. Granting every kubelet the old system:node ClusterRole would let one node read every Secret.
The Node authorizer plus the NodeRestriction admission plugin instead scope a kubelet’s power to objects related to that node. RKE2 enables NodeRestriction by default in the hardened API-server argument set.
This is a specialized form of least privilege: the identity is still a system component, but its permission set is request- and node-dependent.
RKE2 writes administrative kubeconfig files on server nodes:
| Path | Role |
|---|---|
/etc/rancher/rke2/rke2.yaml | cluster-access kubeconfig for local kubectl / Helm |
/var/lib/rancher/rke2/server/cred/admin.kubeconfig | admin credential checked by CIS file-permission controls |
Official cluster-access documentation tells operators to point kubectl at /etc/rancher/rke2/rke2.yaml, or to copy that file and replace 127.0.0.1 with a reachable server address.
Those files typically authenticate as a member of system:masters. That group is bound to cluster-admin and bypasses RBAC evaluation. Removing RoleBindings cannot revoke system:masters. Treat the file like a root password:
600, ownership root:root on the admin kubeconfig;Course FABRIC slices often start from this bootstrap identity. That is convenient for learning the API. It is not a model for team access.
Creating a Linux user on an RKE2 node does not create a Kubernetes user. Authorization happens at the API server, not in /etc/passwd.
To become a Kubernetes user, the client must present an identity the API server accepts, commonly:
CN as the username and O as groups;This is why the later cloud-security lecture spends time on kubeconfig fields: certificate-authority-data, client-certificate-data, and client-key-data are authentication material. RBAC only starts after those fields identify a subject.
A fresh RKE2 cluster already contains many ClusterRoles and bindings. Most system: names are owned by the control plane. They are labeled kubernetes.io/bootstrapping=rbac-defaults. Editing them can break node registration, controllers, or core DNS.
Examples of the idea, not an exhaustive inventory:
kube-system;The Metrics Server lecture already showed that RKE2 manages add-on manifests under /var/lib/rancher/rke2/server/manifests/. Those charts install not only Deployments, but also the RBAC those Deployments need. Do not hand-edit the generated manifests; customize through supported RKE2 configuration.
A practical RKE2 tenancy model:
| Namespace | Typical occupants | Typical RBAC posture |
|---|---|---|
kube-system | RKE2 packaged components | tightly held; operators, not app teams |
kube-public, kube-node-lease | cluster plumbing | leave defaults unless you know why |
default | unused in production | do not deploy apps here |
team-* or project-* | application workloads | RoleBindings to view / edit / custom Roles |
Namespaces are cheap isolation for RBAC and ResourceQuotas. They are not a substitute for NetworkPolicy, Pod Security, or node isolation.
Default RBAC grants almost no extra power to ServiceAccounts outside kube-system. A Pod that never talks to the API often still received a token historically, because Kubernetes automounted the namespace default ServiceAccount.
CIS control 5.1.5 therefore asks operators to:
automountServiceAccountToken: false on the default ServiceAccount in each namespace;RKE2 automatically applies the automount restriction in some system namespaces (kube-system, kube-node-lease, and a few operator namespaces). Namespaces created by students or platform users still need this policy. That is an RBAC-adjacent identity control, not a Role object, and it is one of the controls RKE2 will not finish for you.
RKE2 ships cluster services that look like ordinary workloads but are part of the platform:
rke2-metrics-server.Those components need cluster-scoped permissions that an application should never have: watching Endpoints, reading Nodes, or mutating Ingress status. Mixing application Deployments into kube-system so they “just work” collapses that boundary.
The correct pattern is the Core RBAC one: a distinct role for a distinct job function. The ingress controller has an ingress-controller role. The quote-of-the-day API has a role that, if it needs the API at all, can get and list only its own objects.
RKE2 can run without the Rancher management server. When Rancher is present, it becomes an enterprise mapping layer:
The academic “global to local mapping” slides describe exactly this problem. Rancher project roles are the enterprise permission; Kubernetes RBAC is the system privilege. Losing that distinction leads to granting cluster-admin because it is the only role anyone remembers.