EKS Clusters

Published
Length
3 min read

Luis Felipe Dias

All posts

You manage eks clusters by mapping cloud identities to native Kubernetes roles and bindings. These rules control which users can read resources or run commands in pods. Most teams start by giving developers broad roles to speed up daily work. When roles are too broad, anyone can read secrets or change live apps. Over time, tracking who ran what command inside a container becomes very hard. How native permissions work in eks clusters In eks clusters, the Kubernetes API server checks every requ

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 manage eks clusters by mapping cloud identities to native Kubernetes roles and bindings. These rules control which users can read resources or run commands in pods. Most teams start by giving developers broad roles to speed up daily work. When roles are too broad, anyone can read secrets or change live apps. Over time, tracking who ran what command inside a container becomes very hard.

How native permissions work in eks clusters

In eks clusters, the Kubernetes API server checks every request using role-based rules. A Role sets permissions inside one single namespace. A ClusterRole sets permissions across the whole cluster. It can cover cluster-wide items like nodes or resources in every namespace. Rules in Kubernetes are only additive. There are no deny rules in this system.

To give a user permissions, you create a binding. A RoleBinding grants permissions inside one specific namespace. It can point to a Role in that namespace or a shared ClusterRole. A ClusterRoleBinding grants access across the entire cluster at once. Teams use these bindings to separate prod workloads from test namespaces.

Kubernetes also uses subresources to control specific actions on pods. For example, reading pod logs or running commands uses subresource rules. The API writes these rules with a slash between the resource and subresource. You must grant permission to the pod exec subresource before a user can open a shell.

Why role bindings alone leave gaps in flight

Native roles and bindings solve the first part of cluster security. They decide which engineer can log in and reach a specific namespace. They also block unauthorized users from listing pods or reading cluster secrets. This setup works well for static API requests like viewing deployments.

Still, a large gap opens up when an engineer needs to debug a live pod. Once a binding allows pod exec, Kubernetes steps out of the way. The API server only checks if the user can start the session. It does not inspect the shell commands that run inside the container afterward.

EKS Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Inside that shell, a user can run database tools or inspect local files. Native audit logs show that an exec session started on a pod. They do not record the exact commands typed or the output returned on screen. If a pod holds database keys, the user can query customer tables directly. Sensitive data like emails, phone numbers, or card numbers can appear in plain text. Native roles cannot rewrite or mask those fields inside an active terminal stream.

Scoping daily cluster tasks for engineering teams

To reduce risk, teams should avoid giving out cluster-wide bindings for daily work. Start by creating narrow Roles that only cover a single team namespace. Grant read-only permissions for pods and logs by default. Most daily checks only require viewing pod status and reading recent app logs.

Keep pod exec and secret reading rules out of standard developer roles. When someone needs to run a command inside a pod, treat it with care. Review why the action is needed and limit which namespaces allow shell sessions. By separating read rules from interactive shell rules, you keep prod workloads much safer.

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

How do Role and ClusterRole differ in Kubernetes?

A Role only grants permissions inside a single namespace. A ClusterRole grants permissions across all namespaces or for cluster-wide items like nodes.

Can I write a deny rule in Kubernetes RBAC?

No, permissions in Kubernetes RBAC are purely additive. You start with zero access and add rules through bindings, with no deny rules available.

Do Kubernetes audit logs capture commands run inside a pod shell?

Native audit logs record that a user connected to the pod exec subresource. They do not capture the interactive shell commands or outputs inside that session.

The query runs. The emails stay hidden.