Red Hat Openshift Security

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up red hat openshift security by binding strict role rules to each user. These rules limit who can read pod logs or run commands inside containers. Most teams start by assigning wide cluster roles so developers can fix broken apps fast. When roles stay too broad, any user can run risky commands across every single namespace. How native red hat openshift security roles work The platform uses core Kubernetes role rules to control what users and apps can do. Every rule in this system is

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 red hat openshift security by binding strict role rules to each user. These rules limit who can read pod logs or run commands inside containers. Most teams start by assigning wide cluster roles so developers can fix broken apps fast. When roles stay too broad, any user can run risky commands across every single namespace.

How native red hat openshift security roles work

The platform uses core Kubernetes role rules to control what users and apps can do. Every rule in this system is additive, which means there are no deny rules. Users start with zero rights until an admin binds their account to a specific role. The API server checks these bindings on every single request before it runs an action.

Admins choose between two main role types when they build out their cluster permission model. A standard Role sets permissions inside one single namespace for a specific project team. A ClusterRole sets permissions across the whole cluster, including nodes and all namespaces at once. Teams use RoleBindings to grant rights in one namespace, or ClusterRoleBindings for cluster-wide rights.

Fine-grained control also requires rules for subresources like pod logs and interactive container shells. The API names these subresources with a slash to separate them from the main pod. A developer might have permission to view a pod, yet lack permission for pod logs. Admins must grant explicit rights to the exec subresource before a user can run commands.

What native roles solve and where gaps remain

Native role bindings do a great job of deciding who can enter a cluster namespace. They block unauthorized users from viewing secret objects or starting an exec session in production. Teams can split duties by giving read-only roles to builders and admin roles to operators. This setup keeps basic API calls under control across large multi-tenant clusters.

Still, a severe operational gap appears the moment a user starts an allowed exec session. Native roles only check if the user may open the shell connection to the pod. Once that shell opens, the cluster role does not inspect the commands typed inside it. A user with exec rights can read local files or dump sensitive data from memory.

OpenShift RBAC + AI Red Teaming: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Pod logs create a similar risk when apps write sensitive customer details to standard output. Any engineer with log read permissions will receive raw emails, phone numbers, or card numbers. Native role rules cannot rewrite matched fields in results or pause a dangerous shell command. Closing this gap requires control over the live session itself, not just the initial login.

Steps to tighten namespace permissions

Start by auditing all ClusterRoleBindings to find users who hold broad rights across every namespace. Replace those wide bindings with namespace RoleBindings that point to a shared, limited ClusterRole. This approach lets you maintain one standard rule set while keeping teams inside their namespaces. Remove exec subresource rights from daily developer roles and reserve them for break-glass tasks.

Next, separate log reading permissions from pod creation and deletion rights in your production namespaces. Give support teams a dedicated role that only reads pod status and basic event history. Review your bindings each month to drop stale accounts and keep your permission list clean. These habits shrink the blast radius before you add deeper controls for live command sessions.

Check Kubernetes API requests and responses on the wire

Kubernetes RBAC decides who may call the API server. RBAC does not check response payloads or split listing Secret names from reading Secret values when a role grants get access. With hoop.dev, you run an open-source HTTP proxy, a sidecar for your Kubernetes API. The kubectl client changes only the server address it talks to while RBAC stays in place.

On each call, hoop.dev guardrails read the method, normalized path, and headers to refuse bad deletes or full Secret reads with a 403 error. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs. Every request and verdict is logged without storing bearer tokens. View the project on GitHub.

Frequently asked questions

Can I write a deny rule to block one specific pod command?

No, the native role system is purely additive and does not support any deny rules. You must start with zero permissions and grant only the exact resources a user needs.

What is the difference between a RoleBinding and a ClusterRoleBinding?

A RoleBinding grants permissions inside one single namespace, even if it references a wider ClusterRole. A ClusterRoleBinding grants those permissions across every namespace and cluster resource at the same time.

Why can a user view pods but fail to open a container shell?

Viewing a pod and opening a shell use two different targets in the API server. The user needs explicit permission for the pod exec subresource to start a shell session.

The query runs. The emails stay hidden.