How to Configure AKS Pod Security
You set up aks pod security by creating Kubernetes roles and bindings for your namespaces. You also restrict pod creation rules and subresource permissions for your team. Most teams start by granting broad cluster roles so engineers can deploy and fix apps fast. When roles are too broad, any user can run commands inside live pods or read sensitive logs. How native aks pod security works Native aks pod security relies on Kubernetes role-based access control to manage user and workload permissi
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 aks pod security by creating Kubernetes roles and bindings for your namespaces. You also restrict pod creation rules and subresource permissions for your team. Most teams start by granting broad cluster roles so engineers can deploy and fix apps fast. When roles are too broad, any user can run commands inside live pods or read sensitive logs.
How native aks pod security works
Native aks pod security relies on Kubernetes role-based access control to manage user and workload permissions. In Kubernetes, a role or cluster role holds a list of rules. These rules are always additive, which means there are no deny rules in the system. A standard role sets permissions inside one single namespace. A cluster role is not limited to a single namespace. It can cover cluster-wide resources like nodes, or namespaced resources across all namespaces.
To give permissions to a user or group, you create a binding. A role binding grants permissions inside one specific namespace. It can point to a role in that same namespace or a shared cluster role. A cluster role binding grants permissions across the entire cluster at once. When you reuse a cluster role with a local role binding, you keep rules consistent across teams.
Controlling pod subresources and runtime actions
Pod security goes beyond who can create or delete a pod. Kubernetes uses subresources to control actions like reading pod logs or running interactive commands inside containers. In your role rules, you must list these subresources explicitly to allow or block them. If a role allows pod creation, that does not by default block subresource actions unless you scope them out.
Teams often try to limit subresource permissions to specific pod names using resource name lists. Still, resource name restrictions on create requests only apply to top-level resources, not to subresources. This means a user with exec permission in a namespace can often target any pod in that namespace. You must separate namespaces carefully if you want to isolate sensitive workloads from general debugging.
What native roles solve and what keeps the session active
Native roles and bindings do a good job of deciding who can reach the cluster API. They let you separate read-only users from admins and lock down namespaces by team. This stops unauthorized users from scheduling privileged pods or viewing workloads in other namespaces.
K8s Pod Security Standards + AKS Managed Identity: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Still, native role bindings stop checking once a pod session starts. When an engineer opens an interactive shell into a pod, the role cannot inspect individual commands in flight. It also cannot mask sensitive data like emails, phone numbers, card numbers, or national IDs in output streams. Teams still need a way to approve sensitive actions and inspect what happens inside active pod 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 write a deny rule in Kubernetes RBAC to block pod exec?
No, Kubernetes permissions are purely additive and do not support deny rules. To block pod exec, you must remove that subresource permission from every role bound to the user.
What is the difference between a RoleBinding and a ClusterRoleBinding?
A role binding grants permissions inside one specific namespace only. A cluster role binding grants permissions across all namespaces and cluster-scoped resources at the same time.
Why do engineers still see sensitive data in pod logs with strict roles?
A role only checks if a user has permission to request the log subresource. Once allowed, Kubernetes sends the raw log stream without rewriting sensitive fields like emails or card numbers.
Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.
Related guides
In this post