Google Cloud Platform Kubernetes Engine
Google cloud platform kubernetes engine runs container apps on managed cloud nodes. You control who can touch these workloads by setting up role-based rules. Most teams start by linking cloud user accounts to broad cluster roles. When those roles are too wide, one bad command can break live apps. A wide role also lets a user read secrets across every namespace. How permissions work in google cloud platform kubernetes engine The platform uses native Kubernetes role-based access control to chec
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.
Google cloud platform kubernetes engine runs container apps on managed cloud nodes. You control who can touch these workloads by setting up role-based rules. Most teams start by linking cloud user accounts to broad cluster roles. When those roles are too wide, one bad command can break live apps. A wide role also lets a user read secrets across every namespace.
How permissions work in google cloud platform kubernetes engine
The platform uses native Kubernetes role-based access control to check every API call. Every rule in this system is additive, which means there are no deny rules. You start with zero rights and gain power as an admin binds roles. A standard Role sets rules inside one single namespace for a specific team. A ClusterRole sets rules across the whole cluster, including nodes and all namespaces.
To give those rights to a person, you create a binding object. A RoleBinding links a user or group to a Role inside one namespace. You can also use a RoleBinding with a ClusterRole to limit it locally. A ClusterRoleBinding grants those ClusterRole permissions across every single namespace at once. Teams use this pattern to give developers read rights in staging first. Then they keep production namespaces locked down to a smaller group of operators.
Subresources and container command rules
In the API, some actions use subresources like pod logs or pod exec. You must name these subresources in your role rules to allow them. A rule that grants pod read access does not grant log read access. You must add a rule for the log subresource so users can debug. The same logic applies when an engineer wants to run a shell inside a pod.
Giving a user the exec subresource lets them open a live container shell. Many teams grant this right so developers can check a failing app fast. You can limit some rules to specific resource names in the API. Still, name limits on create actions only work on top-level resources, not subresources. Once a user has exec rights in a namespace, they can enter its pods.
Platform Engineering Security + Kubernetes RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native cluster roles leave open
Native roles do a great job of deciding who can call the API. They stop an unauthorized user from deleting a pod or reading a secret object. Still, native roles stop checking once an interactive shell session starts inside a container. The cluster logs that the user opened an exec session on a pod. It does not check or block the Linux commands typed inside that shell.
Inside a running pod, an engineer runs with the permissions of the container user. From that shell, they might query an internal database or read local files. Those database queries can return raw customer emails, phone numbers, or card numbers. Native cluster roles cannot rewrite matched fields in results during a live shell session. They also cannot require a peer review for one risky command inside a pod. Teams need control over what happens inside the session, not just at login.
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 in Kubernetes RBAC?
No, native Kubernetes role permissions are purely additive and never support deny rules. To remove access, you must delete or narrow the RoleBinding granting that right.
How do I let a developer read pod logs without full pod control?
Create a Role in that namespace that targets the pod log subresource specifically. Bind that Role to the developer with a RoleBinding so they only read logs.
What is the difference between a RoleBinding and a ClusterRoleBinding?
A RoleBinding applies permissions inside one single namespace only. A ClusterRoleBinding applies permissions across the entire cluster and all of its namespaces.
Related guides
In this post