How to Configure OpenShift Pod Security
You set up openshift pod security by defining roles and bindings for your cluster. These rules decide which users can run pods or open shell sessions inside containers. Many teams start by giving developers broad cluster roles to speed up daily work. Broad roles let anyone enter any pod and read sensitive keys or app data. If an attacker steals one user key, they gain control over the whole cluster. How openshift pod security works with native roles The platform uses native role-based rules t
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 openshift pod security by defining roles and bindings for your cluster. These rules decide which users can run pods or open shell sessions inside containers. Many teams start by giving developers broad cluster roles to speed up daily work. Broad roles let anyone enter any pod and read sensitive keys or app data. If an attacker steals one user key, they gain control over the whole cluster.
How openshift pod security works with native roles
The platform uses native role-based rules to control who can touch cluster objects. Every rule in this system is additive, which means there are no deny rules. You start with zero access and add specific permissions for each user or team. A standard role sets permissions inside one single namespace for a specific project team. A cluster role works across all namespaces and also covers cluster-wide objects like nodes.
Once you write a role, you link it to users with a binding. A role binding grants permissions inside one namespace by referencing a role or cluster role. A cluster role binding grants access across the entire cluster at once. Teams use a role binding with a common cluster role to keep rules simple. This lets an admin manage one set of rules for many separate app namespaces.
Pod rules also cover subresources like pod logs and remote shell execution. In the API, the platform writes a subresource with a slash after the resource name. A rule for reading logs uses the pods and log subresource path. A rule for running shell commands uses the pods and exec subresource path. You must grant these subresources on their own if engineers need to debug live apps.
Where native pod roles fall short in daily work
Native roles and bindings do a great job of blocking unknown users at the door. You can stop a front-end developer from opening a shell in a billing namespace. You can also give read-only log access to support teams without granting shell access. This setup handles basic access control at the API level before a session starts.
Still, native role checks stop working the moment the API approves the request. When an engineer gets pod exec access, they open an interactive shell inside the container. The cluster API knows the user opened a shell, but it cannot see inside. It does not check which shell commands the engineer runs during that active session. An engineer can read local files, dump memory, or query internal services from that pod.
K8s Pod Security Standards + OpenShift RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Also, static role bindings stay active all day and night until someone removes them. Teams often grant pod exec rights during an outage and forget to revoke them later. Over time, dozens of engineers keep standing shell rights across production namespaces. If a user runs a command that prints customer emails or card numbers, nothing rewrites it. The native setup decides who logs in, not what individual commands do in flight.
Steps to tighten pod permissions across namespaces
Start by auditing your cluster role bindings to find users with wide admin rights. Move those users down to namespace role bindings so they only touch their own apps. Split your roles so that everyday read rules stay separate from pod exec rules. Most developers only need to check pod status and read logs during normal work.
Keep pod exec permissions in a separate role that stays unbound during normal hours. Check your subresource rules to make sure log readers cannot run shell commands by mistake. Review your bindings each month to clear out old team members and unused service accounts. When someone must run commands in a pod, pair native roles with deeper command checks.
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 pod exec in one namespace?
No, native role permissions are purely additive and do not support deny rules. To block pod exec, you must remove the exec subresource rule from the user's bound roles.
How do I let a team read pod logs without giving them shell access?
Create a role that grants access to the pod log subresource by itself. Leave the pod exec subresource out of the role so users cannot open a shell.
What is the difference between a role binding and a cluster role binding?
A role binding grants permissions inside one specific namespace for a team. A cluster role binding grants permissions across every namespace in the entire cluster at once.
Related guides
In this post