How to Configure AKS Read Only Access
You set up aks read only access by pairing cloud roles with Kubernetes RBAC rules. These rules let users view cluster states without changing live workloads. Many teams start by giving developers broad admin rights to fix bugs fast. Over time, wide permissions lead to accidental deletions and exposed secret values. How native aks read only access works Setting up safe view rights takes work at two distinct layers. First, you manage the cloud platform layer so users can fetch cluster credentia
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 read only access by pairing cloud roles with Kubernetes RBAC rules. These rules let users view cluster states without changing live workloads. Many teams start by giving developers broad admin rights to fix bugs fast. Over time, wide permissions lead to accidental deletions and exposed secret values.
How native aks read only access works
Setting up safe view rights takes work at two distinct layers. First, you manage the cloud platform layer so users can fetch cluster credentials. Second, you set up the Kubernetes API server to check every request. Kubernetes RBAC uses the rbac.authorization.k8s.io API group to control user actions. In this system, permissions are purely additive, and there are no deny rules. You start with zero rights and add explicit rules for each team.
A Role sets permissions inside one specific namespace for a single team. A ClusterRole is not namespaced and covers resources across the whole cluster. It can also govern cluster-scoped objects like nodes and non-resource endpoints. To grant these rights to a user, you create a binding object. A RoleBinding grants permissions inside one namespace and can reference a ClusterRole. A ClusterRoleBinding grants those permissions across every namespace in the entire cluster. For view rights, you allow read verbs on pods, deployments, and services.
Managing subresources and namespace boundaries
Engineers need more than basic object lists when they check broken apps. They also need to read pod logs to see error messages. Kubernetes RBAC refers to resources by the exact name in the API URL. Some APIs use a subresource, such as a pod log stream. In RBAC rules, you write the subresource with a slash, like pods/log. You must include pods/log in your read role so teams can debug.
You must be careful not to add the pods/exec subresource by mistake. That subresource lets users run shell commands inside a live container. A shell session lets a user alter files and break the read limit. By scoping a RoleBinding to one namespace, you limit what a team sees. The finance app team can check their own pods and read their logs. They will not see workloads that belong to other teams in the cluster.
Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native setup solves and what it leaves open
Native roles and bindings do a great job of blocking state changes. Users cannot delete pods, scale deployments down, or edit service routes. Still, native setup only checks who logs in and which API they call. It does not inspect what the response payload holds while in flight.
Even with view rights, a user might read Kubernetes secret objects if permitted. Worse, app logs often print sensitive customer data during an error spike. When an engineer reads pod logs, raw emails and phone numbers appear onscreen. Card numbers or national IDs might also show up in those log streams. Native RBAC cannot rewrite matched fields in results before they reach the user. It also creates static kubeconfig files that sit on laptops until tokens expire. Teams need a way to inspect responses and mask sensitive fields in flight.
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 proxy, a sidecar for your Kubernetes API, inline on the API connection. On every kubectl or API call an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
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, or hold risky calls for approval. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs in memory. View the project on GitHub.
Frequently asked questions
Can I add a deny rule to block secret reads in a ClusterRole?
No, Kubernetes RBAC permissions are purely additive and have no deny rules. To block secret reads, you must leave secrets out of the allowed list. Build a custom role that lists only the safe resources your team needs.
What is the difference between a RoleBinding and a ClusterRoleBinding?
A RoleBinding applies permissions inside a single namespace for a specific team. A ClusterRoleBinding grants permissions across all namespaces in the entire cluster. You can pair a reusable ClusterRole with a RoleBinding to keep scope tight.
Why can users still see sensitive data with read only permissions?
Read roles allow users to fetch pod logs and config data via APIs. If an app writes emails or card numbers to logs, users see them. Native RBAC checks the API verb, not the text inside the log response.
Related guides
In this post