GitHub SSO for Kubernetes Openshift
You set up github sso for kubernetes openshift by linking your cluster identity provider to your GitHub teams. Next, you bind those external groups to native cluster roles so engineers can log in. Many teams start by mapping a whole developer group to a broad role. This quick fix speeds up onboarding across the cluster. Still, broad roles give too many people full read and write power. One bad command can delete live workloads or leak private keys. How github sso for kubernetes openshift works
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 openshift by linking your cluster identity provider to your GitHub teams. Next, you bind those external groups to native cluster roles so engineers can log in. Many teams start by mapping a whole developer group to a broad role. This quick fix speeds up onboarding across the cluster. Still, broad roles give too many people full read and write power. One bad command can delete live workloads or leak private keys.
How github sso for kubernetes openshift works with cluster roles
The login flow starts when an engineer tries to reach the cluster API server. The cluster sends the user to GitHub to prove who they are. GitHub checks the user and sends back their account name and team list. The cluster reads those team names and checks its own role bindings.
In Kubernetes and OpenShift, a Role or ClusterRole holds a list of rules. These rules are purely additive, which means there are no deny rules at all. A standard Role always sets rules inside one single namespace. A ClusterRole is not tied to one namespace and covers cluster-wide items like nodes. It can also cover resources across every namespace at once.
To connect your GitHub teams to these rules, 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 whole cluster. Once you link a GitHub team to a binding, every team member gets those exact rules.
Why native roles fall short during live sessions
Linking GitHub groups to cluster roles solves the first step of security. You know who logs in, and you can remove a user from GitHub to cut off their account. You can also split rules by namespace so teams only touch their own apps. The cluster API server checks these rules before it runs any request.
Still, native role bindings stop working once a session starts inside a pod. In cluster rules, subresources like pod logs or pod exec use a slash in the resource name. If a role allows pod exec, the engineer can open a shell inside a running container. From that shell, the cluster API server no longer checks each command they type.
Kubernetes RBAC + OpenShift RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
This leaves a big gap during daily work and incident fixes. An engineer with shell access can read local files or query a database from the pod. The cluster knows who opened the shell, but not what commands ran inside it. Also, pod logs often print raw emails, phone numbers, card numbers, or national IDs. Native roles let a user read the whole log stream or none of it. They cannot rewrite matched fields in results before the text hits the user screen.
How to keep cluster roles tight and safe
Start by mapping small GitHub teams to single namespaces with a RoleBinding. Avoid using a ClusterRoleBinding for daily developer work unless the team manages cluster nodes. Keep read roles separate from write roles so most users only view pod states.
Treat subresources like pod exec and pod logs with extra care. Do not put pod exec rules into your base developer role. Instead, split shell rights into a distinct role that requires a clear reason to use. Even with tight roles, remember that native permissions only check the door at login time. Controlling what commands run inside a shell or what data appears in logs requires runtime checks.
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 sits inline as an open-source proxy, a sidecar for your Kubernetes API, without replacing RBAC. On every production call from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run or hold risky deletes for review. 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 write a deny rule to block one GitHub user from a namespace?
No, native cluster permissions are purely additive and have no deny rules. You must remove the user from the GitHub team that holds the role binding.
What is the difference between a RoleBinding and a ClusterRoleBinding for GitHub teams?
A RoleBinding gives a GitHub team permissions inside one single namespace. A ClusterRoleBinding gives that GitHub team permissions across the entire cluster at once.
Does GitHub SSO control what commands a user runs inside a pod shell?
No, SSO and role bindings only check if the user can start the pod exec subresource. Once the shell opens, native cluster roles do not filter or block individual shell commands.
Related guides
In this post