How to Configure EKS Temporary Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up eks temporary access by mapping short-lived cloud roles to Kubernetes RBAC rules. An engineer assumes an expiring cloud role that binds to a specific cluster permission set. Many teams skip this step and hand out permanent cluster admin keys instead. Broad standing permissions let anyone delete workloads or read secrets long after a fix ends. How eks temporary access works with native roles Amazon EKS relies on two separate layers to check who logs in and what they do. The cloud pr

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 eks temporary access by mapping short-lived cloud roles to Kubernetes RBAC rules. An engineer assumes an expiring cloud role that binds to a specific cluster permission set. Many teams skip this step and hand out permanent cluster admin keys instead. Broad standing permissions let anyone delete workloads or read secrets long after a fix ends.

How eks temporary access works with native roles

Amazon EKS relies on two separate layers to check who logs in and what they do. The cloud provider checks the identity first through short-lived tokens tied to an IAM role. Once the user logs in, Kubernetes RBAC checks what API actions that identity can run. In Kubernetes RBAC, a Role sets permissions inside one namespace. A ClusterRole sets permissions across the whole cluster or for cluster-wide items like nodes. You connect a user or group to these rules with a RoleBinding or ClusterRoleBinding.

Permissions in Kubernetes RBAC are purely additive, which means there are no deny rules. You start with zero rights and add rules for each resource and verb. To grant temporary rights, admins let an engineer assume a cloud role for one hour. That cloud role maps to a Kubernetes group inside the cluster access config. When the cloud role session expires, the user loses the mapped Kubernetes rights right away. Teams also create temporary RoleBindings and delete them after an incident ends.

Managing pod subresources and namespace scopes

Most engineers need temporary rights to check broken pods or read app logs during outages. Kubernetes treats pod logs and interactive shells as subresources under the main pod API object. When you write RBAC rules, you must list these subresources explicitly to allow log reads. Giving a role rights to view pods does not let that user open a shell. You have to grant permission on the exec subresource before an engineer can run commands.

Scoping these rights to a single namespace keeps one team from touching another team's apps. You can reference a shared ClusterRole inside a local RoleBinding to save time. That setup restricts the user to the single namespace where the RoleBinding lives. Even with tight namespace bounds, subresource rules still create risk during live sessions. Once RBAC allows the exec subresource, the API server permits any shell command inside that pod.

EKS Access Management + Customer Support Access to Production: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native role bindings solve and what they miss

Expiring cloud roles and scoped RoleBindings stop engineers from holding permanent keys on their laptops. If someone steals a token hours later, the expired credential will not work. Namespace limits also stop a developer from changing settings in other parts of the cluster.

Still, native RBAC only checks if a user can start an action at the door. It cannot inspect the commands an engineer runs inside an open pod shell. A user with temporary exec rights can still print secret keys or read customer emails. Native logs show that an exec session started, but not the shell commands or output. Also, if an admin grants temporary pod read rights, the user sees all raw log data. Native RBAC cannot rewrite sensitive fields like phone numbers or card numbers in log output.

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 I write a deny rule in Kubernetes RBAC to block specific commands?

No, Kubernetes RBAC rules are purely additive and do not support deny rules. If a role grants exec rights, RBAC cannot block specific shell commands inside the container.

Should I use a RoleBinding or a ClusterRoleBinding for short tasks?

Use a RoleBinding whenever the engineer only needs to fix apps in one namespace. A ClusterRoleBinding grants rights across all namespaces, which is too broad for most tasks.

How do I let a user read pod logs without giving full pod control?

Create a Role that grants read rights only on the pod log subresource. Do not include the exec subresource or write verbs on the main pod object.

The query runs. The emails stay hidden.