How to Configure AKS SSO
To set up aks sso, you link your Azure cluster to your central identity provider. Next, you map user groups to Kubernetes roles to control what each team can do. Many teams start by linking their main work directory to the cluster API server. Still, teams often grant broad cluster roles just to get builders working fast. When a role is too wide, one mistake can break live apps across the whole cluster. How aks sso and role bindings work Single sign-on handles who can log in to your Azure clus
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 aks sso, you link your Azure cluster to your central identity provider. Next, you map user groups to Kubernetes roles to control what each team can do. Many teams start by linking their main work directory to the cluster API server. Still, teams often grant broad cluster roles just to get builders working fast. When a role is too wide, one mistake can break live apps across the whole cluster.
How aks sso and role bindings work
Single sign-on handles who can log in to your Azure cluster. When an engineer runs a command, the cluster checks their identity token first. Once the identity check passes, Kubernetes RBAC decides what actions that person can take.
In Kubernetes, a Role or ClusterRole holds a set of rules for permissions. These rules are purely additive, which means there are no deny rules at all. A standard Role always sets permissions inside one single namespace. A ClusterRole is not tied to one namespace and covers cluster-wide resources like nodes. It can also cover resources across all namespaces at the same time.
To give these permissions to your single sign-on groups, you create a binding. A RoleBinding grants permissions inside one namespace and can point to a Role or ClusterRole. A ClusterRoleBinding grants permissions across the entire cluster for every namespace. Both of these bindings map your identity groups to the right Kubernetes rules.
Why native roles leave gaps during live work
Linking single sign-on with RBAC solves the problem of static cluster keys. You no longer have to share admin files with every person on the team. When someone leaves the company, removing them from the identity group blocks their cluster login.
Still, native role bindings only check permissions when an API request starts. They decide who logs in, not what specific commands do once a session begins. Kubernetes RBAC uses subresources to control actions like reading pod logs or running pod commands. In RBAC rules, the API writes these subresources with a slash, such as pods/log.
AKS Managed Identity + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
If a builder gets permission to run commands in a pod, they get a shell. Inside that shell, Kubernetes RBAC cannot check individual shell commands in flight. A user can read app memory, view local files, or pull database keys. Also, standard role rules cannot mask sensitive fields like emails or card numbers in output. Teams end up choosing between blocking pod shells completely or giving away full shell control.
How to tighten role design for daily operations
You can reduce risk by keeping ClusterRoleBinding rules away from human users. Give teams RoleBinding permissions scoped to the single namespace they actually own. Split read rules for viewing pod status from write rules that allow pod shell sessions.
When engineers need to fix a live issue, broad role bindings still fall short. Static group mappings stay active all day, even when no one is fixing a bug. To close this gap, teams need controls that work at the command and request level.
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 a Kubernetes Role for specific users?
No, Kubernetes RBAC permissions are purely additive and do not support deny rules. To block an action, you must remove the user or group from the binding that grants it.
What is the difference between a RoleBinding and a ClusterRoleBinding in AKS?
A RoleBinding grants permissions inside one specific namespace only. A ClusterRoleBinding grants permissions across the whole cluster and every namespace in it.
How does Kubernetes control who can read pod logs or open a shell?
Kubernetes uses RBAC subresources written with a slash, such as pods/log for logs. You must list these subresources in your Role or ClusterRole rules to allow them.
Related guides
In this post