Openshift Identity Provider

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an openshift identity provider by linking your central directory to the cluster OAuth service. After a user logs in, role bindings map that identity to specific cluster rules. Many teams start by linking whole corporate groups to broad admin roles to save time. This shortcut gives too many people the power to run commands across live pods. How an openshift identity provider works with cluster roles The login flow starts when an engineer tries to reach the cluster API server. The cl

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 an openshift identity provider by linking your central directory to the cluster OAuth service. After a user logs in, role bindings map that identity to specific cluster rules. Many teams start by linking whole corporate groups to broad admin roles to save time. This shortcut gives too many people the power to run commands across live pods.

How an openshift identity provider works with cluster roles

The login flow starts when an engineer tries to reach the cluster API server. The cluster sends the user to the external directory to check their name and password. Once the directory confirms the user, the cluster creates a local user record and group list. That identity then passes to the Kubernetes RBAC system to check what the user can do.

In Kubernetes RBAC, a Role or ClusterRole holds a list of rules for resources. All rules are additive, which means there are no deny rules in the system. A Role sets permissions inside one namespace, while a ClusterRole can cover the whole cluster. A ClusterRole can also cover cluster-wide items like nodes, or namespaced items across all namespaces.

To give those permissions to a user, you create a RoleBinding or a ClusterRoleBinding. A RoleBinding grants permissions inside one namespace and can point to a Role or ClusterRole. A ClusterRoleBinding grants permissions across the entire cluster at once. When you map directory groups to these bindings, every group member gets those exact rules.

Why login rules leave a gap during live sessions

Linking an identity provider solves the problem of knowing who logs into the cluster. You do not need to manage static keys or local accounts for each engineer. When someone leaves the team, removing them from the directory stops their cluster login right away. Role bindings also stop users from touching namespaces that belong to other product teams.

Still, RBAC only checks if a user can start an action on an API resource. Some API calls use subresources, such as reading pod logs or running commands inside a pod. Once a role grants permission for the pod exec subresource, the user can open a shell. RBAC does not inspect or limit the shell commands that run inside that container.

Identity Provider Integration + OpenShift RBAC: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

The same gap exists when engineers port-forward to a database or inspect live app data. The cluster checks the role at the start of the request, not the payload inside. If a pod log prints customer emails, phone numbers, or card numbers, the user sees them. Native login and role rules decide who enters the cluster, not what happens during the session.

How to tighten role bindings before production

Start by replacing cluster-wide bindings with namespace-scoped bindings for day-to-day engineering work. Keep ClusterRoleBinding rules only for platform admins who must manage nodes or global cluster settings. Next, separate read-only roles that allow reading pod logs from roles that allow pod exec. This split stops most users from opening interactive shells inside live containers by default.

You should also review how group claims from your directory map to local cluster roles. Make sure temporary contractors do not sit in the main engineering group in your directory. Because RBAC has no deny rules, adding a user to two groups combines both permission sets. Clean group design in your directory keeps cluster roles small and easy to check.

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 to block one user from a namespace?

No, Kubernetes RBAC rules are strictly additive and do not support deny rules. You must remove the user from the group or binding that grants the permission.

What is the difference between a RoleBinding and a ClusterRoleBinding?

A RoleBinding applies permissions inside a single namespace for the users listed in it. A ClusterRoleBinding applies permissions across every namespace and cluster-scoped resource at once.

Does an identity provider control which shell commands run in a pod?

No, the identity provider only checks who the user is during the login step. Once RBAC allows the pod exec subresource, the cluster does not filter individual shell commands.

The query runs. The emails stay hidden.