How to Configure EKS Service Account
You set up an eks service account by creating a Kubernetes identity for your pods. Next, you bind that identity to Kubernetes roles and a cloud role. Teams use this setup so apps can talk to the cluster and cloud APIs. Without dedicated accounts, pods share a default identity in their namespace. Teams often give that default account broad rights just to make deployments work. When one pod gets compromised, an attacker gains all those shared rights. Scoping each workload to its own account reduc
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 an eks service account by creating a Kubernetes identity for your pods. Next, you bind that identity to Kubernetes roles and a cloud role.
Teams use this setup so apps can talk to the cluster and cloud APIs. Without dedicated accounts, pods share a default identity in their namespace. Teams often give that default account broad rights just to make deployments work. When one pod gets compromised, an attacker gains all those shared rights. Scoping each workload to its own account reduces this risk right away.
How an eks service account works with RBAC
In Kubernetes, role-based rules control what an identity can do inside the cluster. Every permission rule is additive, and the system has no deny rules. You start with zero access and add only the actions an app needs.
A Role sets permissions inside one single namespace. In contrast, a ClusterRole is not tied to one namespace. It can cover cluster-wide objects like nodes or resources across all namespaces. It can also cover endpoints that are not standard Kubernetes resources.
To connect your eks service account to these rules, you create a binding. A RoleBinding grants rights inside one namespace and can point to a Role. A RoleBinding can also reference a ClusterRole while keeping the scope in one namespace. A ClusterRoleBinding grants permissions across the entire cluster at once.
RBAC names resources the exact same way they appear in the API URL. Some APIs use subresources, such as reading pod logs or running commands in pods. You write these subresources with a slash between the resource and the action.
Scoping cloud permissions for your workloads
Pods in a managed cluster often need to reach external cloud services. For example, an app might read files from cloud storage or send messages. In the past, teams attached broad cloud roles straight to the worker nodes. That approach let every pod on the node use the exact same cloud permissions.
Service-to-Service Authentication + Service Account Governance: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
An eks service account solves this problem by linking to an identity provider. You associate the Kubernetes account with a specific cloud role through trust rules. The cluster then mounts a token into the pod when it starts up. The app trades this token for temporary cloud credentials on the fly. Now only pods using that specific account can assume that cloud role.
Where native account controls fall short
Native roles and bindings do a great job of controlling initial identity access. They decide which pod or user can talk to a specific API endpoint. Still, these native rules stop working once the session starts running.
For example, RBAC can allow a user or pod to open an interactive shell. Once that shell opens, Kubernetes does not check individual commands inside the container. It also cannot rewrite sensitive fields like emails, phone numbers, or card numbers. If a tool prints national IDs to the screen, raw text appears.
The same gap exists when workloads or engineers run queries against data stores. Role bindings decide who logs in, not what individual statements do in flight. Teams need deeper controls to inspect commands and mask data during live sessions.
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 sits inline beside the API server as a sidecar for your Kubernetes API. For every production API call an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review alongside RBAC.
With hoop.dev Kubernetes controls, guardrails allow listing Secret names while refusing reads of Secret data before execution, and 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
Can I add a deny rule to a Kubernetes Role?
No, Kubernetes RBAC rules are purely additive and never support deny rules. To restrict an account, you must remove the binding or edit the role.
What is the difference between a RoleBinding and a ClusterRoleBinding?
A RoleBinding applies permissions inside a single namespace only. A ClusterRoleBinding grants those permissions across every namespace and cluster resource.
How does RBAC handle subresources like pod logs or exec sessions?
RBAC refers to subresources using a slash in the resource name. You must list the subresource explicitly in the role to grant access.
Related guides
In this post