Role-Based Access Control (RBAC) is the mechanism by which Kubernetes decides whether a given identity may perform a given action on a given resource. Without RBAC, every Pod, every developer, and every CI pipeline would have equivalent access to the entire cluster, making it impossible to prevent a junior developer's misconfigured deployment from deleting production StatefulSets or a compromised CI runner from reading Secrets across all namespaces. RBAC in Kubernetes operates on three concepts: a Role (or ClusterRole) defines a set of permissions — which verbs (`get`, `list`, `watch`, `create`, `update`, `patch`, `delete`) on which API groups and resources; a RoleBinding (or ClusterRoleBinding) grants a Role to a subject (a User, a Group, or a ServiceAccount); and a ServiceAccount is the Kubernetes identity that Pods use to authenticate to the API server, distinct from human user identities which Kubernetes delegates to an external identity provider. Understanding the difference between namespace-scoped Roles and cluster-scoped ClusterRoles, and between namespace-scoped RoleBindings and cluster-scoped ClusterRoleBindings, is the foundational knowledge that determines whether access grants are correctly scoped.
The principle of least privilege — grant the minimum permissions required for a task and nothing more — is not a security nicety in Kubernetes; it is the primary defence mechanism against a widespread class of production incidents where a compromised Pod, a runaway controller, or an accidentally deployed debug tool causes collateral damage far beyond its intended scope. A Pod that needs to list ConfigMaps in its own namespace should have exactly that permission and no ability to list Secrets, delete Deployments, or read objects in other namespaces. Implementing this discipline consistently across all ServiceAccounts in a cluster is what separates a cluster with one blast radius from a cluster where a single compromised container is contained to its immediate context.