The Simplest Way to Make Kustomize and SAML Work Like They Should
Using kustomize and saml together links your cluster manifest files to your identity provider. This setup lets teams manage role mappings as code and control who can run changes. Kustomize builds cluster manifests for each stage without copying whole files. SAML passes signed user login data and group names from your identity provider. When you pair them, you define cluster role bindings inside your overlays. Your dev, staging, and prod clusters each get the exact group rules they need. How k
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.
Using kustomize and saml together links your cluster manifest files to your identity provider. This setup lets teams manage role mappings as code and control who can run changes.
Kustomize builds cluster manifests for each stage without copying whole files. SAML passes signed user login data and group names from your identity provider. When you pair them, you define cluster role bindings inside your overlays. Your dev, staging, and prod clusters each get the exact group rules they need.
How kustomize and saml share login and role data
SAML handles user logins through a central identity provider. When an engineer logs in, the provider sends a signed XML message. This message holds the user email and group names. Your cluster reads these group names to check what the user can do.
Kustomize manages the YAML files that map those SAML groups to cluster roles. You write a base role binding file once for your whole team. Then you use overlays to swap the SAML group names for each cluster stage. A dev overlay can grant write rules to a broad engineering group. A prod overlay can limit those same rules to a small on-call group.
This flow keeps identity rules inside version control. Every change to a group mapping goes through a pull request. Reviewers can see which SAML group gains new cluster rights before the change runs.
Common failure modes and how to scope roles
Many teams fail by mapping one broad SAML group to cluster admin rights. They put this rule in the base folder instead of an overlay. Soon every cluster stage gives full control to too many people. If one account gets stolen, the attacker can change any workload.
Shared service accounts cause another big problem during deploy runs. When teams run Kustomize from a shared runner, the cluster logs only show the runner name. You lose the link back to the real person who logged in with SAML. Unlogged queries and blind changes make security audits very hard to pass.
SAML 2.0 + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, keep base roles very small and read-only. Grant write rules only inside specific stage overlays. Create distinct SAML groups for each app team and each cluster stage. Bind those groups to single namespaces instead of the whole cluster.
You should also lock down network paths to the cluster API server. Make sure engineers and deploy tools enforces policy on SAML checks with static local keys. Rotate signing keys on schedule and remove unused role bindings from your overlays.
Keeping manifest changes tied to real users
Good security needs clear logs for every single cluster action. When someone applies a Kustomize build, you need to know who did it. Tie every run back to a verified SAML login session. Avoid static admin keys on laptops at all costs.
Check your audit logs often to spot drift between git files and live cluster rules. If a live role does not match your overlay, overwrite it from version control right away. If sensitive fields like emails or card numbers appear in outputs, masking rewrites matched fields in results.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Does Kustomize talk to the SAML identity provider directly?
No, Kustomize only builds the YAML files before you send them to the cluster. The cluster API server and your login add-on check the SAML assertion at login time.
How should we store SAML metadata in Kustomize overlays?
Keep public SAML metadata and group names in plain overlay files inside git. Never store private signing keys in plain text; load them from a secret store at deploy time.
What happens if a SAML group name changes in the identity provider?
Cluster access for that group will stop working right away. You must update the group name in your Kustomize overlay and apply the change to restore access.
Related guides
In this post