The Simplest Way to Make Kustomize and Onelogin Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using kustomize and onelogin together links your team groups to Kubernetes cluster roles. Kustomize builds role manifests for each stage, while OneLogin checks who logs in. This workflow keeps user management out of your code files. You manage people in OneLogin and set cluster rules in Kustomize. Both tools do what they do best without extra scripts. Platform teams can update access rules across ten clusters in minutes. How kustomize and onelogin share identity and rules OneLogin acts as th

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 onelogin together links your team groups to Kubernetes cluster roles. Kustomize builds role manifests for each stage, while OneLogin checks who logs in.

This workflow keeps user management out of your code files. You manage people in OneLogin and set cluster rules in Kustomize. Both tools do what they do best without extra scripts. Platform teams can update access rules across ten clusters in minutes.

How kustomize and onelogin share identity and rules

OneLogin acts as the main source of truth for user identity. It holds user profiles, team groups, and login rules. When an engineer logs in, OneLogin sends an identity token to the cluster. This token lists the groups that the engineer belongs to.

Kustomize manages the Kubernetes files that read those group names. You write a base role binding file once for your whole team. Then you use Kustomize overlays to change group names for each cluster. The test overlay points to your test group in OneLogin. The prod overlay points to a smaller prod group in OneLogin.

Data flows in one clear direction during a login check. The user gets a signed token from OneLogin first. Next, the user sends a command to the Kubernetes API server. The server checks the token signature against OneLogin public keys. Last, the server checks the Kustomize role files to allow or block the action.

Common failure modes and how to scope roles

Many teams fail by putting static keys inside Kustomize secret generators. Those keys sit in Git repos or build logs where anyone can read them. Other teams map a wide OneLogin group to the cluster admin role. One bad login then gives an attacker full control over every app.

Shared service accounts cause big audit gaps too. When five engineers share one token, the cluster log shows one name. You cannot tell who deleted a pod or read a secret. Unlogged commands also make security reviews hard for your ops team.

OneLogin + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Fix this by scoping OneLogin groups to narrow Kustomize roles. Create distinct groups for dev, staging, and prod work. Map each group to a namespace role instead of a cluster-wide role. Give read-only rules by default in your base Kustomize files. Only grant write rules in specific overlays that need them.

Keeping cluster manifests clean across stages

Group drift happens when teams edit cluster roles by hand during an outage. An engineer runs a quick command to grant access and forgets to remove it. Next week, no one knows why that rule exists in prod. Manual edits break the link between your Git repo and the live cluster.

Kustomize patches prevent this drift when paired with a strict sync loop. You store the OneLogin group IDs inside a patch file for each stage. When a team needs a new rule, they open a pull request. Reviewers see which OneLogin group gets the new role before it goes live.

Keep network paths between your cluster and identity tools tight as well. The Kubernetes API server must reach OneLogin to check token keys. Block direct traffic to the API server from public networks. Make sure every command goes through a central point that logs the user name. If an app outputs PII like emails, phone numbers, or card numbers, mask it. Masking rewrites matched fields in results before they hit engineer screens.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Should I store OneLogin client secrets in Kustomize files?

No, never put plain text secrets in Git repos or Kustomize bases. Load secrets at deploy time from an external store or inject them at runtime.

How do I map OneLogin groups to Kubernetes namespaces?

Put a standard RoleBinding in your Kustomize base folder. Then use a Kustomize patch in each overlay to swap in the right OneLogin group name.

What happens when you remove a user from OneLogin?

OneLogin stops issuing new tokens to that user right away. You should also keep token lifetimes short so active sessions end within minutes.

The query runs. The emails stay hidden.