Immutable Kubernetes Os

Published
Length
3 min read

Luis Felipe Dias

All posts

An immutable kubernetes os runs containers on read-only host nodes that forbid direct shell logins. Teams update and manage every node through declarative API calls instead of manual changes. Most platform teams pair these read-only nodes with native role-based rules to lock down hosts. Still, broad cluster roles still let users run commands inside pods and read sensitive data. How an immutable kubernetes os works with native roles In a standard Linux setup, admins log into hosts over SSH to

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.

An immutable kubernetes os runs containers on read-only host nodes that forbid direct shell logins. Teams update and manage every node through declarative API calls instead of manual changes. Most platform teams pair these read-only nodes with native role-based rules to lock down hosts. Still, broad cluster roles still let users run commands inside pods and read sensitive data.

How an immutable kubernetes os works with native roles

In a standard Linux setup, admins log into hosts over SSH to change files. An immutable kubernetes os removes the shell, the package manager, and write permissions on system disks. Every host change happens through the cluster API server instead of local terminal sessions. Because the API controls the host, native role-based rules become your main security boundary.

In Kubernetes, a Role or ClusterRole holds a list of rules that define permissions. These permissions are purely additive, which means the system has no deny rules at all. A Role sets permissions inside one single namespace for your team and apps. A ClusterRole is not tied to one namespace and covers cluster-wide resources like nodes.

To give 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 whole cluster at once, across every namespace. The API server checks these bindings before it allows any node or pod change.

What read-only nodes solve and what native roles miss

Running an immutable kubernetes os stops attackers and admins from changing host files by hand. It prevents config drift across your fleet because every node boots from the same image. If a node fails or shows bad behavior, you replace the whole machine right away. No one can install rogue tools on the host disk when the disk is read-only.

Yet locking the host OS does not lock down the workloads running inside your pods. Engineers still need to debug live apps, check logs, and inspect running containers during incidents. In Kubernetes RBAC, APIs like pod logs or pod command execution are called subresources. You grant permissions to these subresources by adding a slash, such as pods/log or pods/exec.

Kubernetes RBAC + Immutable Backups: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Native RBAC decides who can start a pod session, not what commands run inside it. Once a user has permission for the exec subresource, they can run any shell command. They can read local app secrets, query internal databases, or view customer emails and phone numbers. Native roles also lack a built-in step to approve single commands before they run.

Why teams need fine-grained controls for pod sessions

Many teams try to fix this gap by giving out broad ClusterRoleBindings during an outage. Because permissions are additive, extra bindings stack up over time and stay active too long. Even on a locked-down node OS, an over-privileged user can still change live app state. They can also pull card numbers or national IDs from connected data stores through a pod.

To stay safe, teams must control the API requests and subresource calls in real time. You need a way to check each command, require peer reviews, and mask sensitive output. Rewriting matched fields like emails or card numbers in results keeps production data safe during debugging.

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

Does an immutable kubernetes os replace cluster RBAC?

No, a read-only node OS only protects the host disk and removes local SSH shells. You still need Kubernetes RBAC to control who can manage nodes, pods, and subresources.

Can I write a deny rule in Kubernetes RBAC to block pod exec?

No, Kubernetes RBAC permissions are purely additive and do not support deny rules. To block pod command execution, you must remove the pods/exec subresource from the user's role.

What is the difference between a RoleBinding and a ClusterRoleBinding?

A RoleBinding grants permissions inside one specific namespace, even if it references a ClusterRole. A ClusterRoleBinding grants permissions across the entire cluster, including all namespaces and cluster-scoped nodes.

The query runs. The emails stay hidden.