Openshift Security Guide

Published
Length
3 min read

Luis Felipe Dias

All posts

To secure your cluster, restrict user roles and limit container shell permissions. This openshift security guide walks through native role rules and runtime controls. Engineering teams often start by granting broad cluster roles to speed up debugging. Overly broad permissions let a single mistake wipe out live workloads or expose secret keys. Core role rules in this openshift security guide Under the hood, the platform uses the standard Kubernetes role system to control users. Every Role or C

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 secure your cluster, restrict user roles and limit container shell permissions. This openshift security guide walks through native role rules and runtime controls. Engineering teams often start by granting broad cluster roles to speed up debugging. Overly broad permissions let a single mistake wipe out live workloads or expose secret keys.

Core role rules in this openshift security guide

Under the hood, the platform uses the standard Kubernetes role system to control users. Every Role or ClusterRole holds a list of rules that grant specific permissions. These rules are purely additive, which means the system has no deny rules. If you do not want a user to act, you omit that permission.

A standard Role always sets permissions inside a single namespace. A ClusterRole is not tied to one namespace and covers cluster-wide objects like nodes. It can also cover non-resource endpoints or namespaced objects across the whole cluster. Admins link these roles to users or groups through bindings.

A RoleBinding grants permissions inside one namespace by referencing a Role or a ClusterRole. A ClusterRoleBinding grants those permissions across the entire cluster at once. You must keep ClusterRoleBindings to a bare minimum for daily work. Most developers only need a RoleBinding inside their own project namespace.

Managing pod logs and shell subresources

Role rules refer to objects by the exact name used in the API URL. Some API calls target a subresource, such as reading logs from a running pod. In a role rule, you write this subresource with a slash between the names. Granting log read rules lets engineers debug apps without changing live containers.

The pod exec subresource is much more dangerous than the log subresource. It lets a user open a live shell session inside a running container. Once inside, the user can run arbitrary commands or read local files. You should split log permissions from shell permissions in every production role.

OpenShift RBAC: 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 role bindings do a good job of deciding who can enter a namespace. They stop unauthorized users from deleting pods, reading secret objects, or opening container shells. This setup keeps basic boundaries clear between different product teams on shared clusters. Still, native roles stop checking once the API server approves the initial request.

When an engineer opens a pod shell, the cluster role cannot see inside that session. The native system only knows that the user started an exec call on a pod. It does not inspect individual commands or stop a risky script in flight. It also cannot mask sensitive fields like emails, phone numbers, or card numbers in output.

Teams also struggle with standing permissions that stay active all day and night. If an engineer needs shell permissions for one incident, that binding often remains forever. Reviewing and removing old role bindings by hand takes time that busy teams lack. Closing this gap requires control over individual commands and data during the live session.

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

How do I block a specific action in cluster roles?

You cannot write a deny rule because role permissions are purely additive. To block an action, remove the rule that grants it and rebuild the user binding.

Should developers get ClusterRoleBindings for daily debugging?

No, because a ClusterRoleBinding gives permissions across every namespace in the cluster. Use a RoleBinding in a single namespace, referencing a ClusterRole if you want reusable rules.

Why is the pod exec subresource risky in production?

The exec subresource opens an interactive shell inside a live container. Native roles check who starts the shell, but they do not control the commands run inside.

The query runs. The emails stay hidden.