Kubernetes Namespaces Are Not a Security Boundary Documentation
You isolate workloads by combining network policies, node separation, and strict RBAC rules. A review of kubernetes namespaces are not a security boundary documentation shows namespaces only group API objects. Many teams start by placing different apps or teams into separate namespaces. They assume this logical split stops cross-namespace traffic or hides shared cluster data. When roles or permissions are too broad, users can still reach other workloads. A single bad binding can expose pods, sec
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 isolate workloads by combining network policies, node separation, and strict RBAC rules. A review of kubernetes namespaces are not a security boundary documentation shows namespaces only group API objects. Many teams start by placing different apps or teams into separate namespaces. They assume this logical split stops cross-namespace traffic or hides shared cluster data. When roles or permissions are too broad, users can still reach other workloads. A single bad binding can expose pods, secrets, and nodes across the whole cluster.
How kubernetes namespaces are not a security boundary documentation explains RBAC
In Kubernetes, a namespace is just a logical folder for API resources. It does not block network traffic between pods on its own. It also does not isolate the underlying Linux kernel on shared worker nodes. Pods from two different namespaces often run side by side on one machine. To restrict who can view or change objects, admins enable RBAC on the API server.
RBAC uses four main objects to manage permissions across the cluster. A Role sets permissions inside one specific namespace. A ClusterRole sets permissions across all namespaces or for cluster-wide objects like nodes. A RoleBinding grants permissions to a user or group inside one namespace. A RoleBinding can link to a local Role or a global ClusterRole. In contrast, a ClusterRoleBinding grants permissions across the entire cluster at once.
All RBAC rules in Kubernetes are purely additive. There are no deny rules in this permission model. You start with zero access and add rules for each action and resource. If a user gets a broad ClusterRoleBinding by mistake, namespace boundaries will not stop them. You cannot write a local namespace rule to take away that global permission.
What native namespace controls solve and what they leave open
Native RBAC and namespaces help teams organize resources and limit API clutter. By linking a ClusterRole to a local RoleBinding, admins can reuse standard rule sets. This setup keeps a developer inside their assigned namespace for basic API calls. It stops them from listing pods or reading secrets in another team's namespace. It also helps admins set basic resource quotas for CPU and memory use.
Still, native RBAC only checks if a user can start an API request. It does not inspect what happens inside a session after it starts. For example, RBAC treats pod logs and pod exec sessions as subresources. An admin might grant a user permission to open an interactive shell on pods. Once that shell opens, native RBAC has no control over the commands run inside.
Kubernetes Operator for Security + Model Cards & Documentation: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Also, name filters in RBAC have limits on creation requests for subresources. When an engineer runs commands inside a container, the API server only sees the start. It does not check individual shell commands or database queries run from that pod. It also cannot mask sensitive fields like emails, phone numbers, or card numbers in output. Native setup decides who logs into the API, not what commands do in flight.
Steps to tighten workload isolation across shared clusters
First, audit every ClusterRoleBinding in your cluster on a regular schedule. Replace broad cluster-wide bindings with local RoleBindings inside each specific namespace. This step makes sure permissions stay inside the intended logical group. Second, restrict access to sensitive subresources like pod exec and pod logs. Only grant these permissions when an engineer has an active task to fix an issue.
Third, add controls outside of RBAC to handle network and node isolation. Set up network policies to block default pod-to-pod traffic between different namespaces. Use node labels and taints to put sensitive workloads on their own dedicated machines. Combining these layers gets you closer to true isolation than namespaces alone can offer.
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
Do Kubernetes namespaces block network traffic between pods by default?
No, namespaces do not block network traffic on their own. By default, any pod can talk to any other pod across all namespaces. You must add network policies to restrict traffic between different namespaces.
Can I write a deny rule in Kubernetes RBAC to block a user?
No, Kubernetes RBAC permissions are purely additive and have no deny rules. To remove access, you must delete or edit the RoleBinding or ClusterRoleBinding that grants it.
What is the difference between a RoleBinding and a ClusterRoleBinding?
A RoleBinding grants permissions only within one specific namespace. A ClusterRoleBinding grants permissions across the entire cluster and all of its namespaces.
Related guides
In this post