Kubernetes User Management
You set up kubernetes user management by linking external identities to native role rules. The cluster checks who logs in and matches them to allowed actions. Most teams connect an external identity provider to the API server first. Next, admins create role bindings for developer groups across shared namespaces. When teams grant broad cluster roles to speed up work, risk grows fast. One wide permission lets a user read secrets or delete workloads across namespaces. How native kubernetes user m
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up kubernetes user management by linking external identities to native role rules. The cluster checks who logs in and matches them to allowed actions. Most teams connect an external identity provider to the API server first. Next, admins create role bindings for developer groups across shared namespaces. When teams grant broad cluster roles to speed up work, risk grows fast. One wide permission lets a user read secrets or delete workloads across namespaces.
How native kubernetes user management works
Kubernetes does not store human user accounts inside its own cluster database. Instead, the API server checks identities through external login systems or certificates. Once a user logs in, role-based access control decides what they can do. This system uses four main objects to control permissions across the cluster.
A Role sets rules for what a user can do in one namespace. A ClusterRole sets rules that reach across the whole cluster. It covers cluster-wide items like nodes and namespaced items across every namespace. All rules in this system only add permissions. There are no deny rules in native Kubernetes roles.
To give these rules to a person, you create a binding object. A RoleBinding grants permissions to a user or group inside one specific namespace. That RoleBinding can point to a local Role or a shared ClusterRole. This lets admins write one standard rule set and reuse it per namespace. A ClusterRoleBinding grants permissions across the entire cluster at once. Teams use it for cluster admins or global read-only views.
Controlling subresources like pod logs and shell access
Native roles also control access to subresources attached to main cluster objects. The API server names these subresources using a slash in the request path. For example, reading container logs uses the pod log subresource. Opening a shell inside a running container uses the pod exec subresource.
Admins must list these subresources in a Role if users need them. A user with permission to view pods cannot read logs without that rule. The same applies to running commands inside a container. You must grant the exec subresource before a user can open a shell. You can also limit subresource rules to specific pod names in that namespace.
Kubernetes RBAC + User Provisioning (SCIM): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native roles solve and where they fall short
Native RBAC solves the problem of who can call which API endpoints. It separates namespaces well and stops unauthorized users from changing cluster state. Teams can group developers by role and limit them to their own apps. For standard API calls, this built-in control works well.
Still, native RBAC stops checking once the API call passes the gate. If a role allows pod exec, the user gets an open shell session. Kubernetes does not check the individual Linux commands typed inside that container. A developer fixing a bug has the same shell power as anyone else. They can read local files, inspect memory, or pull card numbers and emails.
Static bindings also stay active until an admin removes them by hand. Teams often grant temporary shell rights during an outage and forget them later. Because rules only add permissions, overlapping bindings make it hard to track access. To control what happens inside a session, teams need command-level checks and masking.
Govern kubectl and API calls in flight
Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev sits inline as an open-source proxy, a sidecar for your Kubernetes API, without replacing RBAC. On every production call from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run or hold risky deletes for review. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.
Frequently asked questions
Does Kubernetes have a built-in user account object?
No, Kubernetes does not have user objects for human accounts. It relies on external identity systems or client certificates to verify users.
Can I write a deny rule in Kubernetes RBAC?
No, permissions in Kubernetes RBAC are only additive. You start with zero access and add allowed verbs and resources through bindings.
What is the difference between a RoleBinding and a ClusterRoleBinding?
A RoleBinding applies permissions inside a single namespace only. A ClusterRoleBinding applies permissions across every namespace and cluster-scoped resource.
Related guides
In this post