How to Configure EKS Audit Log
To set up an eks audit log, turn on control plane logging in your cluster settings. This feature sends API server records straight to your cloud log storage. Teams often turn on these logs to track who changes cluster objects. Still, broad roles still let users run risky commands inside pods. Native logs record the initial API call, not what happens inside a live shell. How the eks audit log and cluster roles work Every action in a Kubernetes cluster goes through the API server. When a person
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.
To set up an eks audit log, turn on control plane logging in your cluster settings. This feature sends API server records straight to your cloud log storage. Teams often turn on these logs to track who changes cluster objects. Still, broad roles still let users run risky commands inside pods. Native logs record the initial API call, not what happens inside a live shell.
How the eks audit log and cluster roles work
Every action in a Kubernetes cluster goes through the API server. When a person or app makes a request, the API server checks their role. It also writes an entry to the eks audit log. This log shows who made the call, when it happened, and whether it passed.
Kubernetes uses a role system to control who can do what. A Role sets rules within one single namespace. A ClusterRole sets rules across the whole cluster. It can cover nodes, non-resource endpoints, or objects across all namespaces. A RoleBinding gives permissions inside one namespace by linking to a Role or ClusterRole. A ClusterRoleBinding gives permissions across the entire cluster.
In Kubernetes, permissions are only additive. There are no deny rules in this system. You start with no permissions and add rules as needed. When you grant a broad role, you cannot add a separate rule to block one piece.
Some API calls use a subresource, such as reading pod logs or opening a pod shell. In role rules, the subresource name uses a slash after the main resource name. When an engineer opens a shell into a pod, the API server checks that subresource rule. Then the eks audit log records that the user started an exec session.
What native cluster logging solves and what it misses
Turning on the eks audit log solves a major problem for security teams. It gives you a clear trail of API calls against the cluster control plane. You can see when a deployment changes or when someone reads a secret object. You can also see when a role binding changes or when a node joins.
Still, native cluster logs have a big blind spot during daily work. Role bindings only decide who can start a request at the API server door. They do not inspect what happens inside a session after it starts. When a user opens a shell into a pod, the API log only notes the start.
Audit Log Integrity + EKS Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Once inside the container, the engineer might run database queries or read local files. They might view sensitive customer data like emails, phone numbers, card numbers, or national IDs. The native eks audit log does not capture the commands typed inside that shell. It also cannot rewrite sensitive fields in query results before they reach the screen.
Why teams need deeper control over cluster sessions
Most teams try to fix this gap by tightening their Kubernetes roles. They remove broad cluster bindings and create smaller roles for each namespace. This step reduces risk, but engineers still need pod shells to fix broken apps. Because permissions are only additive, anyone with shell rights gets full control inside that container.
Also, managing static keys and local cluster files for every engineer takes a lot of time. If a developer leaves a key on a laptop, someone else could use it. The audit trail will show the API call, but only after the bad action happens. Teams need a way to check each command in flight and mask sensitive data fields.
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
What does the eks audit log capture by default?
It captures requests sent to the Kubernetes API server. Each record shows the user, the target resource, the action type, and the response code.
Can Kubernetes RBAC block a single command inside a pod shell?
No, Kubernetes roles only allow or block the initial subresource request to open the shell. Also, role rules are only additive and do not support deny rules for specific shell commands.
How can teams protect sensitive data during pod debugging?
Teams should limit who can open pod shells using tight namespace roles. For active sessions, they can use data masking that rewrites matched fields like emails or card numbers in results.
Related guides
In this post