Service Proxy for Kubernetes SaaS
You set up a service proxy for kubernetes saas by routing traffic through the API server. You then bind user identities to specific cluster roles. Teams often start by giving engineers broad cluster roles to fix broken pods fast. When roles are too broad, one person can run any command inside live containers. That level of control puts tenant data and cluster state at risk. How native controls work in a service proxy for kubernetes saas Kubernetes uses Role-Based Access Control on the API ser
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 a service proxy for kubernetes saas by routing traffic through the API server. You then bind user identities to specific cluster roles. Teams often start by giving engineers broad cluster roles to fix broken pods fast. When roles are too broad, one person can run any command inside live containers. That level of control puts tenant data and cluster state at risk.
How native controls work in a service proxy for kubernetes saas
Kubernetes uses Role-Based Access Control on the API server to check every request. This system uses a dedicated authorization API group to manage rules. In this model, permissions are purely additive. There are no deny rules in standard Kubernetes RBAC. You start with zero access and add rules to grant actions.
Admins use four main objects to build these rules. A Role sets permissions inside one single namespace. A ClusterRole is not namespaced at all. It can cover cluster-wide resources like nodes or apply across all namespaces. It can also cover endpoints that are not tied to a resource.
Once you write the rules, you bind them to users or groups. A RoleBinding grants permissions inside one namespace. It can point to a Role in that same namespace or a shared ClusterRole. A ClusterRoleBinding grants permissions across the entire cluster at once. For SaaS teams, using a RoleBinding with a shared ClusterRole keeps tenant namespaces separate.
Kubernetes RBAC also handles subresources by matching the exact API URL path. Actions like reading pod logs or running commands in a pod use subresources. You write these in rules with a slash between the resource and the subresource. A rule must include the exec subresource before a user can open a shell.
What native RBAC solves and what it leaves open
Native Kubernetes RBAC solves the problem of who can talk to the API server. It stops unauthorized users from reading secrets, deleting pods, or viewing other namespaces. When you map each SaaS tenant to a namespace, RoleBindings isolate those spaces well. An engineer assigned to one namespace cannot touch pods in another namespace.
Still, native RBAC only checks the request at the door. It decides who can start a pod exec session or read a log stream. It does not inspect what happens inside that session once it starts. If a role allows pod exec, the user can run any binary inside the container.
Database Proxy (ProxySQL, PgBouncer) + Kubernetes RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Native rules also have limits when you restrict actions by resource name. On create requests, resource name filters apply only to top-level resources, not subresources. More importantly, RBAC cannot filter out sensitive text from a pod log stream. If an app prints emails, phone numbers, card numbers, or national IDs, logs show them. Anyone with log read permissions can see those raw fields in their terminal.
Why SaaS teams need deeper command and data controls
In a multi-tenant SaaS cluster, pods often hold shared keys and customer records. Giving an engineer full exec permissions to debug a live issue is risky. A single bad command inside a container can alter state or dump memory. Native RBAC cannot approve one safe command while blocking a destructive one inside a shell.
Audit logs on the API server record that an exec call happened. They do not record the actual shell commands or the output returned to the user. Teams need a way to check individual commands in flight and mask sensitive output fields.
Add request guardrails and response masking beside Kubernetes
Cluster roles and service accounts govern who reaches the Kubernetes API. Still, a broad role or agent can delete workloads or print sensitive values from ConfigMaps and logs. In practice, hoop.dev sits inline beside the API server as a sidecar for your Kubernetes API. For every production API call an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review alongside RBAC.
With hoop.dev Kubernetes controls, guardrails allow listing Secret names while refusing reads of Secret data before execution, and data masking redacts matched keys in returned JSON responses and log streams in memory. Furthermore, hoop.dev holds SOC 2 Type II and is MIT licensed on GitHub.
Frequently asked questions
Can Kubernetes RBAC block specific shell commands inside a pod?
No, Kubernetes RBAC only checks if a user can call the pod exec subresource. Once the API server allows the session, RBAC cannot read or block commands inside the container.
How do you limit an engineer to a single SaaS tenant namespace?
You create a Role or reuse a ClusterRole with the needed rules. Then you apply a RoleBinding inside that specific tenant namespace instead of using a ClusterRoleBinding.
Does Kubernetes RBAC support explicit deny rules for sensitive pods?
No, permissions in Kubernetes RBAC are purely additive and have no deny rules. To block access to a pod, you must omit it from the allowed rules in the role.
Related guides
In this post