Kubernetes Dashboard Authentication

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up kubernetes dashboard authentication by creating a user identity and binding it to RBAC rules. The dashboard passes that user token to the API server to check every action. Many teams start by granting broad cluster roles so engineers can fix broken apps fast. Overly broad roles let any signed-in user read secrets, delete workloads, or run container shells. How kubernetes dashboard authentication works with RBAC The dashboard does not keep its own list of users or passwords. Instead

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 dashboard authentication by creating a user identity and binding it to RBAC rules. The dashboard passes that user token to the API server to check every action. Many teams start by granting broad cluster roles so engineers can fix broken apps fast. Overly broad roles let any signed-in user read secrets, delete workloads, or run container shells.

How kubernetes dashboard authentication works with RBAC

The dashboard does not keep its own list of users or passwords. Instead, it relies on the cluster API server to check every single request. When an engineer signs in, the web interface forwards their token to the API server. The API server checks this identity against role-based rules before it returns any cluster data.

In Kubernetes RBAC, a Role or a ClusterRole holds a specific set of permission rules. All rules in this system are additive, which means there are no deny rules. A Role sets permissions inside one single namespace for local work. A ClusterRole is not namespaced and covers cluster-wide objects like nodes or all namespaces at once.

To connect a user to those rules, admins create a binding object in the cluster. A RoleBinding grants permissions inside one namespace and can point to a Role or ClusterRole. A ClusterRoleBinding grants permissions across the entire cluster at once. If a team binds a dashboard user to a broad ClusterRole, that user gets wide control.

What native roles solve and what they leave open

Native RBAC is great at deciding which API endpoints a user can reach. Admins can limit a team to one namespace using a standard RoleBinding. They can also control subresources, which appear in rules as a resource name with a slash. For example, pod logs and pod exec sessions are separate subresources under the main pod object.

Still, RBAC only checks if a user may call an endpoint at login and request time. It does not inspect what happens inside the session once the API server says yes. If a role allows pod exec, the engineer can open a shell inside the running container. Native RBAC cannot approve individual shell commands or block risky scripts run inside that shell.

Kubernetes RBAC + Multi-Factor Authentication (MFA): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Data exposure in the browser is another major gap for platform teams. When a role allows reading pod logs or config data, the API sends raw text back. Those logs often hold sensitive customer data like emails, phone numbers, card numbers, or national IDs. Native cluster roles cannot rewrite matched fields in results to hide those details on the screen.

Scoping permissions for day-to-day cluster tasks

To reduce risk, teams should avoid giving cluster-wide bindings to human dashboard users. Start by creating a narrow Role in each namespace where a team runs its apps. Grant read-only verbs on basic workload objects so engineers can check pod status and events. Keep secret read rules and pod exec subresources out of the base developer role.

When an engineer needs to run a command or inspect a secret, treat that as separate. Static tokens shared in team chat channels make it impossible to tell who ran a change. Tie every login to an individual person so the cluster audit log shows the real user. Even with clean roles, teams still need a way to govern live commands and sensitive output.

Add request guardrails and response masking beside Kubernetes

Cluster roles and service accounts govern who reaches the Kubernetes API. Still, a broad role or agent can delete workloads or print sensitive values from ConfigMaps and logs. In practice, hoop.dev runs beside the API server as a sidecar for your Kubernetes API and checks every request and response alongside RBAC.

With hoop.dev Kubernetes controls, guardrails can allow listing Secret names while refusing reads of Secret data before execution. Data masking redacts matched keys in returned JSON responses and log streams in memory. Furthermore, hoop.dev holds SOC 2 Type II and is MIT licensed on GitHub.

Frequently asked questions

Does the Kubernetes dashboard store user accounts?

No, the dashboard does not store accounts or manage its own permission database. It passes the user identity to the Kubernetes API server, which checks RBAC rules for every request.

Can I add a deny rule to block one specific namespace in the dashboard?

No, Kubernetes RBAC permissions are purely additive and do not support deny rules. To restrict a user to specific namespaces, use separate RoleBindings instead of a ClusterRoleBinding.

How do I let dashboard users view pods without letting them open a container shell?

Grant read permissions on the main pods resource and the pod log subresource in your Role. Leave the pod exec subresource out of the Role so the API server blocks shell requests.

The query runs. The emails stay hidden.