AKS Mainframe
You run an aks mainframe workload by placing core business apps inside managed Kubernetes pods. You then control who can reach those pods using native role rules and bindings. Many teams move legacy mainframe tasks into container clusters to modernize their daily operations. During this shift, admins often grant broad cluster roles so engineers can fix live issues. Broad roles let too many people run shell commands or read sensitive logs across namespaces. How native aks mainframe role rules w
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 run an aks mainframe workload by placing core business apps inside managed Kubernetes pods. You then control who can reach those pods using native role rules and bindings. Many teams move legacy mainframe tasks into container clusters to modernize their daily operations. During this shift, admins often grant broad cluster roles so engineers can fix live issues. Broad roles let too many people run shell commands or read sensitive logs across namespaces.
How native aks mainframe role rules work
Kubernetes controls cluster actions through its built-in role-based permission system on the API server. In this model, a Role or a ClusterRole holds a list of permission rules. All rules in this system are additive, and there are no deny rules at all. A Role sets rules inside one single namespace where a specific mainframe app runs. A ClusterRole has no namespace and covers nodes or resources across all namespaces.
To give these rules to a user or team, admins create a binding. A RoleBinding grants permissions inside one namespace by linking to a Role or a ClusterRole. A ClusterRoleBinding grants permissions across the entire cluster at once. When you run an aks mainframe setup, keeping workloads in separate namespaces helps limit risk. You can bind a team to one namespace so they do not touch other workloads.
Permissions also cover subresources that sit under a main API object, like pod logs. In Kubernetes role rules, admins write a subresource name using a forward slash. This includes the subresource for reading pod logs and the subresource for running pod commands. A role must include these specific subresources before a user can open a pod shell.
What native cluster roles solve and what they miss
Native roles and bindings do a good job of sorting out who can log in. They help admins separate cluster-wide node tasks from single-namespace app tasks. You can give an operations group permission to view pods in one namespace only. You can also block other teams from reaching that namespace at all.
Still, native Kubernetes permissions stop checking once the API server approves the initial request. If a role allows pod shell commands, the user gets an open shell inside the container. Kubernetes does not inspect the individual commands that the engineer types inside that shell. It also does not rewrite sensitive data that prints out to the terminal screen.
AKS Managed Identity: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Mainframe workloads often process sensitive records like card numbers, phone numbers, emails, and national IDs. When an engineer reads pod logs or inspects local files, those records appear in plain text. Because rules are purely additive, you cannot add a deny rule to block risky commands. You also cannot restrict create actions on a subresource to a single named pod. Teams need a way to check commands in flight and mask sensitive fields in results.
Planning safer namespace boundaries for legacy workloads
Start by mapping each legacy job or batch service to its own dedicated namespace. Create narrow Roles in each namespace instead of handing out broad ClusterRoleBindings to engineers. Separate the permission to view pod status from the permission to run pod shell commands. Most daily checks only need read access to basic pod state and events.
Review your bindings often to make sure additive rules have not stacked up over time. When a user belongs to several groups, they get the sum of every bound role. Keep human users out of permanent shell roles whenever you can. Use per-command controls and field masking when an engineer must inspect a live container.
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
Can I write a deny rule in Kubernetes to block pod shell commands?
No, Kubernetes role permissions are purely additive and do not support deny rules. To block pod shell use, you must omit the exec subresource from every bound role.
What is the difference between a RoleBinding and a ClusterRoleBinding for aks mainframe pods?
A RoleBinding applies permissions inside one specific namespace only, even when it references a ClusterRole. A ClusterRoleBinding applies permissions across all namespaces and cluster-scoped resources like nodes.
Why do engineers still see sensitive data when using restricted pod roles?
Native roles only check if a user can call the log or exec subresource. They do not inspect or rewrite emails, card numbers, or national IDs inside the output.
Related guides
In this post