AKS Mid
You set up an aks mid tier role by binding scoped Kubernetes roles to your team groups. This gives engineers debug rights in a single namespace while blocking full cluster admin power. Most teams start by handing out broad cluster roles to speed up daily work. Over time, those wide roles let users run risky commands or read sensitive data across every namespace. A middle tier of permissions gives operators what they need to fix broken pods safely. How to build an aks mid permission model with
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 aks mid tier role by binding scoped Kubernetes roles to your team groups. This gives engineers debug rights in a single namespace while blocking full cluster admin power. Most teams start by handing out broad cluster roles to speed up daily work. Over time, those wide roles let users run risky commands or read sensitive data across every namespace. A middle tier of permissions gives operators what they need to fix broken pods safely.
How to build an aks mid permission model with native RBAC
Kubernetes role-based access control uses additive rules to grant permissions. There are no deny rules in this system. You start with zero rights and add specific verbs for each resource. A Role sets permissions inside one single namespace. A ClusterRole sets permissions across the whole cluster, including nodes and all namespaces.
To build an aks mid setup, you create a Role or reuse a ClusterRole. Then you link it to a team with a RoleBinding inside their target namespace. When a RoleBinding points to a ClusterRole, the user gets those rights only inside that one namespace. This lets platform teams write one standard middle-tier template and apply it to many separate namespaces.
Engineers in a mid-tier role often need to read pod logs or open a shell. In Kubernetes RBAC, these actions use subresources written with a slash, such as pod logs or pod exec. You must grant permissions on both the top-level pod resource and the specific subresource. If you leave out the exec subresource, users can view pod status but cannot run commands inside the container.
What native RBAC solves and what it leaves open
Native Kubernetes RBAC solves the problem of who can reach which API endpoint. It stops a developer in one namespace from deleting workloads in another namespace. It also separates cluster-wide node duties from daily app support tasks.
Still, native RBAC stops checking once the API server approves the request. When a mid-tier role includes pod exec rights, the user gets an open shell inside the container. RBAC cannot check which shell commands the engineer runs inside that session. An engineer can inspect app files, print secret keys, or query connected databases from that pod.
AKS Managed Identity: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Standard API audit logs record that an exec session started on a specific pod. They do not record the shell commands typed or the output returned inside the stream. If a pod holds database credentials, anyone with exec rights can pull raw records like emails or card numbers. Teams need a way to inspect individual commands and mask sensitive output in flight.
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 runs as an open-source proxy, a sidecar for your Kubernetes API, checking requests and responses without replacing RBAC.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run. 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 is the difference between a RoleBinding and a ClusterRoleBinding?
A RoleBinding grants permissions inside one specific Kubernetes namespace. A ClusterRoleBinding grants permissions across all namespaces and cluster-scoped resources like nodes.
Can I add a deny rule to block one specific pod in an aks mid role?
No, Kubernetes RBAC rules are only additive and do not support deny rules. To restrict access, you must grant rights only to the exact resources needed.
How does Kubernetes control access to pod logs and shell sessions?
Kubernetes treats logs and exec sessions as subresources under the main pod resource. You must add explicit rules for those subresources in your role definition.
Teams that document these role rules and review logs each month catch config drift early. Clear ownership for each role keeps live systems simple to run and easy to audit across the whole team.
Related guides
In this post