How to Configure GKE SSO

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up gke sso by linking your identity provider to your Google Kubernetes Engine cluster. Then you map your user groups to native Kubernetes roles to control what teams can do. Most teams start by linking their main directory to cloud identity groups. They often give entire engineering groups broad cluster rights just to get things working fast. When a role is too wide, any developer can read secret keys or change live apps. Fixing these broad rights later takes a lot of careful testing and

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 gke sso by linking your identity provider to your Google Kubernetes Engine cluster. Then you map your user groups to native Kubernetes roles to control what teams can do. Most teams start by linking their main directory to cloud identity groups. They often give entire engineering groups broad cluster rights just to get things working fast. When a role is too wide, any developer can read secret keys or change live apps. Fixing these broad rights later takes a lot of careful testing and cleanup work.

How gke sso works with Kubernetes roles

A proper gke sso setup connects two distinct systems. First, your identity provider checks who the user is during the sign-in flow. It sends a verified identity token with the user's email and group names. Next, the Kubernetes API server reads those group claims to check what the user can do. Kubernetes uses its built-in role system to handle these permission checks.

In Kubernetes, a Role or a ClusterRole holds a list of permission rules. These rules are purely additive, which means there are no deny rules at all. You start with zero access and add rules for each action you want to allow. A standard Role always sets rules inside one single namespace. A ClusterRole is not tied to one namespace and covers the whole cluster. It can control cluster-wide objects like nodes or rules across all namespaces.

To connect your SSO groups to these rules, you create a binding object. A RoleBinding gives permissions inside one namespace to a user or a group. That RoleBinding can point to a local Role or a shared ClusterRole. If a team needs access everywhere, you use a ClusterRoleBinding instead. A ClusterRoleBinding grants those permissions across the entire cluster at once.

Mapping subresources and daily actions in gke sso

Good role design means looking closely at what developers do every day. Often, an engineer just needs to read app logs or run a quick check inside a pod. Kubernetes treats these actions as subresources under the main pod object. The role system writes a subresource with a slash, like pods and then log or exec. You must add these specific subresource names to your role rules.

Teams often try to lock down rules to specific pod names using resource name lists. Still, Kubernetes has a strict limit on how resource name filters work on create verbs. The resource name filter on create actions applies only to top-level resources, not to subresources. Because of this rule, you have to plan your namespaces with great care. Separating apps into small namespaces makes your role bindings much safer and cleaner.

GKE Workload Identity + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native gke sso solves and what it misses

Linking your identity provider to cluster roles solves the basic sign-in problem. You no longer need to share static client keys or admin files with your team. When someone leaves the company, you disable their main account and cluster access stops. You also get a single place to see which groups map to which namespaces.

Yet this native setup only checks who logs in and which API endpoint they call. Once a role lets an engineer run commands in a pod, the cluster steps back. Native roles do not inspect the shell commands that a user runs inside a container. They also cannot rewrite sensitive fields like emails, phone numbers, or card numbers in log output. If a pod holds database keys, anyone with shell rights can read them and run queries. The role binding opens the door, but it cannot watch or filter what happens next.

Add request guardrails and response masking beside Kubernetes

Cluster roles and service accounts govern who reaches the Kubernetes API. Still, a broad role or agent can delete workloads or print sensitive values from ConfigMaps and logs. In practice, hoop.dev sits inline beside the API server as a sidecar for your Kubernetes API. For every production API call an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review alongside RBAC.

With hoop.dev Kubernetes controls, guardrails allow listing Secret names while refusing reads of Secret data before execution, and data masking redacts matched keys in returned JSON responses and log streams in memory. Furthermore, hoop.dev holds SOC 2 Type II and is MIT licensed on GitHub.

Frequently asked questions

Can I add a deny rule to block one specific action in a Kubernetes role?

No, Kubernetes role permissions are purely additive and do not support deny rules. To block an action, you must remove the rule that grants it and build smaller roles.

Should I use a RoleBinding or a ClusterRoleBinding for developer groups?

Use a RoleBinding for developer groups so their permissions stay inside one specific namespace. You can still point that RoleBinding to a shared ClusterRole to avoid writing the same rules twice.

Why do engineers still see sensitive data after I set up group roles?

Native roles only check if a user can open a log stream or a pod shell. They do not inspect the output stream to mask emails, phone numbers, or national IDs.

The query runs. The emails stay hidden.