How to Configure AKS Temporary Access
You set up aks temporary access by linking cloud group assignments to native Kubernetes roles. When the time runs out, the cloud platform removes the user from the group. Many teams start by giving out broad cluster admin rights during an outage. Those standing permissions stay active long after the fix is done. A single mistake can then delete live apps or expose private keys across namespaces. How native aks temporary access works Kubernetes controls who can do what through role-based rules
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 aks temporary access by linking cloud group assignments to native Kubernetes roles. When the time runs out, the cloud platform removes the user from the group. Many teams start by giving out broad cluster admin rights during an outage. Those standing permissions stay active long after the fix is done. A single mistake can then delete live apps or expose private keys across namespaces.
How native aks temporary access works
Kubernetes controls who can do what through role-based rules on the API server. A Role holds a set of rules that work inside one single namespace. A ClusterRole holds rules that work across the whole cluster and on nodes. In Kubernetes, all rules add permissions, and there are no deny rules at all.
To give an engineer rights, you link their identity or group using a binding. A RoleBinding gives permissions inside one namespace and can point to a Role or ClusterRole. A ClusterRoleBinding gives permissions across every namespace in the entire cluster. Teams map these bindings to cloud directory groups that expire after a set clock.
When an engineer needs to fix a bug, they ask to join that group. Once approved, their token carries that group claim to the cluster API server. The API server checks the matching binding and lets the request run. When the timer ends, the directory drops the user from the group. The next API call fails because the binding no longer matches the user.
Engineers also need rights on specific API subresources to debug live pods. Kubernetes writes these subresources with a slash, such as pod logs or pod exec. You must add those subresources to the role rules if engineers need shell commands. Without them, a user can see a pod status but cannot read its logs.
What native roles solve and what they leave open
Time-bound group bindings solve the problem of standing permissions sitting idle for months. Engineers only hold active cluster rights during the hours they work on a ticket. Auditors can check group history to see who joined the privileged group and when. This setup cuts down the window where a stolen laptop can harm the cluster.
Still, Kubernetes role bindings only check who can call an API endpoint. Once a role grants pod exec rights, the API server steps out of the way. It does not inspect the shell commands that the engineer runs inside the container. A user with temporary edit rights can still read secret files or change app data.
Customer Support Access to Production + Temporary Project-Based Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Group timers also run on fixed clocks rather than matching a single task. If a user gets four hours of rights for a five-minute fix, three hours keeps the session active. During that window, every command inside a pod runs with full role power. Native roles also cannot rewrite sensitive fields like emails, phone numbers, or card numbers in output.
Why subresource rules need extra care
Granting temporary shell rights through the pod exec subresource carries high risk in production. When a role allows exec requests, the user gains a shell inside the running container. From that shell, the user can reach any network service or database the pod uses. Native role rules cannot block specific shell flags or filter what the terminal prints back.
Cluster admins often try to narrow roles down to specific named resources. While Kubernetes lets you limit rules by resource name, that check has limits on create calls. Managing dozens of small roles for each incident quickly becomes hard for platform teams. Teams end up falling back to broad editor roles just to get systems back online.
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
Can you add a deny rule to block one namespace during temporary sessions?
No, Kubernetes role rules are purely additive and never include deny rules. To limit scope, you must use a RoleBinding inside the single target namespace instead.
How do you let temporary users read pod logs without giving full edit rights?
Create a Role that grants read verbs on the pods/log subresource in that namespace. Bind that Role to your temporary group with a RoleBinding so users only read logs.
What is the difference between a RoleBinding and a ClusterRoleBinding for short sessions?
A RoleBinding applies permissions inside one specific namespace, even when it points to a ClusterRole. A ClusterRoleBinding grants those permissions across all namespaces and cluster-wide nodes at once.
Related guides
In this post