GitHub SSO for Kubernetes AKS
You set up github sso for kubernetes aks by linking your identity provider to your cluster. You then bind your developer groups to native Kubernetes roles. Most platform teams start this process to stop sharing static cluster admin keys. They map source control teams to cluster roles so engineers can log in fast. Still, teams often grant broad permissions just to unblock daily work. When roles are too wide, one login lets a user change any namespace. How github sso for kubernetes aks works in
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 github sso for kubernetes aks by linking your identity provider to your cluster. You then bind your developer groups to native Kubernetes roles. Most platform teams start this process to stop sharing static cluster admin keys. They map source control teams to cluster roles so engineers can log in fast. Still, teams often grant broad permissions just to unblock daily work. When roles are too wide, one login lets a user change any namespace.
How github sso for kubernetes aks works in practice
Kubernetes does not store user accounts inside the cluster. Instead, the API server trusts an external identity system to check who is logging in. When an engineer runs a command, the login flow checks their GitHub identity first. The provider sends back a token that holds the user name and team groups.
Once the API server trusts the token, native role-based access control takes over. In Kubernetes, a Role or ClusterRole holds rules that represent a set of permissions. These permissions are purely additive, which means there are no deny rules at all. A standard Role always sets permissions within one single namespace. A ClusterRole is not namespaced and can cover cluster-wide resources like nodes.
To connect your GitHub teams to these rules, you create bindings. A RoleBinding grants permissions inside one namespace to a user or group. A ClusterRoleBinding grants access across the entire cluster at once. A RoleBinding can also reference a ClusterRole to keep rule templates simple inside one namespace.
Why native role bindings are only half the story
Linking GitHub groups to cluster roles solves the first step of security. You know which engineer logged in, and you can remove their access when they leave. You no longer have to rotate shared client certificates every time a team changes.
Still, native role bindings only check identity at the API door. Once a role grants access to pod subresources, the cluster steps back. In Kubernetes RBAC, subresources like pod logs or pod exec use a slash in the rule name. If a developer has permission to run exec on a pod, they get a shell.
Kubernetes RBAC + AKS Managed Identity: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Inside that shell, Kubernetes RBAC cannot see what the user types. The API server knows a session started, but not which commands ran inside the container. In the same way, reading pod logs can expose raw emails, phone numbers, or card numbers. Native roles decide who can open the stream, not what happens to data in flight.
Keeping namespaces and subresources tight
To reduce risk with native tools, keep your bindings as small as possible. Avoid using ClusterRoleBindings for everyday developer work on the cluster. Bind GitHub teams to specific namespaces using standard RoleBindings instead. This stops a developer on one app from reading secrets in another namespace.
Be very careful when you grant permissions for subresources like pod exec. Separate the roles that can view pod status from the roles that can open shells. Because Kubernetes rules are purely additive, you cannot add a deny rule later to block one dangerous action. You must build small roles from the start and add rules only when needed.
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
Can I add a deny rule in Kubernetes RBAC to block one GitHub team?
No, Kubernetes RBAC permissions are purely additive and do not support deny rules. To block a team, you must remove the RoleBinding or ClusterRoleBinding that grants the permission.
What is the difference between a RoleBinding and a ClusterRoleBinding for AKS?
A RoleBinding grants permissions to your GitHub group inside one specific namespace only. A ClusterRoleBinding grants those permissions across every namespace and cluster-scoped resource at once.
How does Kubernetes control access to pod logs and shell sessions?
Kubernetes treats logs and exec sessions as subresources written with a slash in RBAC rules. You must grant specific permission for those subresources in a Role or ClusterRole.
Related guides
In this post