EKS Hamster

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an eks hamster app by binding Kubernetes roles to its service account. This setup lets the pod watch usage metrics and change container size requests on its own. Many teams take a shortcut and grant cluster-wide admin rights during initial tests. Broad permissions let a single compromised pod read secrets or alter workloads across every namespace. How an eks hamster setup uses Kubernetes RBAC In Kubernetes, role-based rules control what users and workloads can read or change. Every

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 hamster app by binding Kubernetes roles to its service account. This setup lets the pod watch usage metrics and change container size requests on its own. Many teams take a shortcut and grant cluster-wide admin rights during initial tests. Broad permissions let a single compromised pod read secrets or alter workloads across every namespace.

How an eks hamster setup uses Kubernetes RBAC

In Kubernetes, role-based rules control what users and workloads can read or change. Every rule in this system is additive, which means there are no deny rules. You start with zero access and add specific permissions for each task.

A standard Role sets permissions inside a single namespace. A ClusterRole sets permissions across the entire cluster, including nodes and all namespaces. When you deploy an eks hamster pod, it needs to read usage data and update pod specs. You grant these rights by creating a binding.

A RoleBinding connects a Role or ClusterRole to a user or service account in one namespace. A ClusterRoleBinding grants those permissions across every namespace in the cluster. If your scaling tool only manages one team's app, a single RoleBinding keeps its reach contained. If the tool watches nodes and pods everywhere, it relies on a ClusterRoleBinding.

Kubernetes also uses subresources to control specific actions on a pod. The API server writes these subresources with a slash, such as pods and log or pods and exec. Granting access to the top-level pod resource does not open these subresources on its own. You must list each subresource in the role rules if a person or tool needs them.

Why native roles are only the first step

Native Kubernetes roles do a great job of deciding who can talk to the API server. They check the identity of the caller and verify if the requested action is allowed. This stops random pods or unauthorized engineers from deleting deployments or reading cluster secrets.

Still, native role bindings stop checking once the request passes the API gate. When an engineer gets pod exec rights to debug an eks hamster issue, the cluster opens a shell. Kubernetes knows who opened the session, but it does not inspect the commands typed inside that shell. An engineer with exec rights in a namespace can run any binary inside that container.

EKS Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

The same gap appears when engineers query databases or internal services from inside a pod. Role rules cannot filter out sensitive fields like emails, phone numbers, card numbers, or national IDs. They also cannot pause a risky command inside a live shell to ask a peer for approval. Because RBAC rules are static and additive, teams often leave broad debug roles active all day. Closing this gap requires control over individual commands and queries while they run.

Steps to tighten permissions for cluster workloads

Start by auditing every ClusterRoleBinding tied to your scaling and monitoring pods. Replace cluster-wide bindings with namespace RoleBindings whenever a tool only serves one project. You can still reference a shared ClusterRole inside a RoleBinding to avoid writing duplicate rules.

Next, separate automated pod accounts from human debug roles. The service account for your workload never needs pod exec subresource rights. Keep exec rules out of standard developer roles until a real outage happens. Finally, inspect the logs from the API server to spot unused permissions and remove them.

Check Kubernetes API requests and responses on the wire

Kubernetes RBAC decides who may call the API server. RBAC does not check response payloads or split listing Secret names from reading Secret values when a role grants get access. With hoop.dev, you run an open-source HTTP proxy, a sidecar for your Kubernetes API. The kubectl client changes only the server address it talks to while RBAC stays in place.

On each call, hoop.dev guardrails read the method, normalized path, and headers to refuse bad deletes or full Secret reads with a 403 error. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs. Every request and verdict is logged without storing bearer tokens. View the project on GitHub.

Frequently asked questions

Can I write a Kubernetes RBAC rule to deny pod exec for one specific pod?

No, Kubernetes RBAC rules are purely additive and do not support deny rules. To block access, you must remove the broad grant and only add permissions for approved resources.

Should I use a RoleBinding or a ClusterRoleBinding for an eks hamster service account?

Use a RoleBinding if the workload only watches and updates pods inside one namespace. Use a ClusterRoleBinding only when the pod must read nodes or manage pods across all namespaces.

Does granting read access to pods also allow reading pod logs?

No, pod logs are a separate subresource in the Kubernetes API. You must explicitly include the log subresource in your Role or ClusterRole rules to allow log reading.

The query runs. The emails stay hidden.