How to Configure OpenShift Temporary Access

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up openshift temporary access, bind a user to a narrow role for a short time. Remove the binding as soon as the engineer finishes the task. Many teams start by giving out broad cluster roles during an outage. Those wide permissions often stay active long after the fix is done. Standing privileges create major security risks across your clusters. If an attacker steals an active token, they can read secrets or change workloads. How openshift temporary access works with native roles OpenS

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.

To set up openshift temporary access, bind a user to a narrow role for a short time. Remove the binding as soon as the engineer finishes the task. Many teams start by giving out broad cluster roles during an outage. Those wide permissions often stay active long after the fix is done. Standing privileges create major security risks across your clusters. If an attacker steals an active token, they can read secrets or change workloads.

How openshift temporary access works with native roles

OpenShift builds its permission model on standard Kubernetes role-based rules. These rules are purely additive, which means there are no deny rules. You start with zero permissions and add rules for each needed action. A Role sets permissions inside one specific namespace. A ClusterRole sets permissions across the whole cluster or for cluster-scoped items like nodes.

To grant permissions, you link a user or group to a role. A RoleBinding grants those permissions inside a single namespace. A RoleBinding can point to a Role in that same namespace. It can also point to a global ClusterRole to limit it to one namespace. A ClusterRoleBinding grants permissions across every namespace in the entire cluster. For temporary tasks, teams create a RoleBinding and delete it when time expires.

You can also control subresources like pod logs or pod exec sessions. In the permission rules, subresources use a slash to join the main resource and action. Granting pod exec permissions lets an engineer open a shell inside a running container. Teams often automate binding creation and deletion through ticket workflows or scripts.

Managing subresources and time limits in clusters

During an incident, engineers often need to read pod logs or run a command. If you give them a broad role, they might get access to every pod. You can limit a role to specific resource names for most read and update actions. Still, Kubernetes rules have a known limit on create requests for subresources. The resource name filter does not restrict create actions on subresources.

Because of this limit, granting pod exec permissions applies to all pods in that namespace. You cannot use a native role rule to allow exec on just one named pod. Teams must place sensitive apps in separate namespaces to isolate them during support sessions. After the engineer fixes the issue, an automated job must remove the RoleBinding right away. If the cleanup script fails, the temporary permission turns into a standing risk.

Customer Support Access to Production + Temporary Project-Based Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native roles solve and what they miss

Native roles and bindings do a good job of deciding who can enter a namespace. They let you limit a user to viewing pods or reading logs for an hour. When paired with an external timer, bindings stop permissions from lasting forever. This approach cuts down the number of permanent cluster admins on your team.

Still, native role bindings stop working once the session starts. They check permissions at the API level, not inside the running container shell. Once an engineer runs an exec command, the cluster role cannot filter individual shell commands. It also cannot mask sensitive data like emails, phone numbers, card numbers, or national IDs in output. Teams need command-level controls and data masking to keep live debugging sessions safe.

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 write a deny rule to block one specific pod?

No, the native role model is purely additive and does not support deny rules. You must grant only the exact permissions needed within a separate namespace.

What is the difference between a RoleBinding and a ClusterRoleBinding?

A RoleBinding applies permissions inside one specific namespace only. A ClusterRoleBinding applies permissions across all namespaces and cluster-scoped resources like nodes.

Why do temporary bindings still leave a security gap during pod exec?

A role binding only checks if the user can start the exec session. It does not inspect shell commands or rewrite sensitive fields in the terminal output.

The query runs. The emails stay hidden.