
Scenario: an isolated test pod reads a production document store
Hypothetical scenario. A platform team deploys a document-analysis agent into a test namespace. The pod has no host mounts and runs as a non-root user. The container image passes review. During a test, however, the agent retrieves a production document. Investigators find that the pod received a workload identity through a cloud federation association, and that identity can read a shared production bucket. The container did not escape. It used a credential and permission that were available from inside its intended boundary.
This scenario does not mean that containers are ineffective or that every test agent has production access. It illustrates two different questions that are often combined: what can a process see or affect because of its execution environment, and what resources can the identity used by that process access? A container can help isolate processes and constrain kernel-level capabilities. Resource authorization is decided elsewhere, through identity, credentials, network reachability, and policy.
For a workload to access a protected resource, three conditions usually have to meet: a usable route to the resource, credentials accepted by its authentication system, and effective permission for the requested operation. This is a practical model, not a universal protocol law; some controls combine or obscure these conditions. It is still a useful way to investigate why a contained workload can reach beyond the environment where it was deployed.
Isolation and authorization answer different questions
A container packages a process with a filesystem view and resource controls. Linux namespaces and control groups help isolate process, network, mount, and resource views. The container runtime and kernel configuration determine the strength of that boundary. Docker’s security documentation also notes that configuration, capabilities, mounts, and kernel risks affect the level of isolation; containers are not virtual machines and do not make every host-level risk disappear. Docker Engine security
IAM answers a different question: which principal may perform which action on which resource? A process can be fully contained yet hold a credential with broad permissions. Conversely, a workload may have a powerful identity that is unreachable from a particular process due to network or credential controls. Isolation and authorization are complementary controls because each constrains a different path to impact.
The useful assessment boundary is therefore the complete route from agent process to business effect:
Agent process → reachable endpoint → credential source → authenticated principal → policy decision → resource action
Reviewing only the container manifest leaves out cloud roles, secret mounts, environment variables, node identities, metadata endpoints, service meshes, egress routes, and application-level authorization. Reviewing only IAM leaves out whether an attacker or a misdirected agent can reach the credential provider or destination in the first place.
Kubernetes identity is not automatically cloud identity
Kubernetes ServiceAccounts identify workloads to the Kubernetes API or to systems configured to trust their tokens. A ServiceAccount is a namespaced non-human identity. Its token may be audience-bound and time-limited, and the API server verifies token claims when the token is used. That does not mean Kubernetes has automatically granted access to an external cloud account. The external system must accept the token through a configured trust relationship or another explicit credential flow. Kubernetes Service Accounts
Cloud workload identity mechanisms make that relationship explicit. For example, Amazon EKS supports associations between a Kubernetes ServiceAccount and an IAM role through mechanisms such as IAM Roles for Service Accounts or EKS Pod Identity. The role then needs an IAM policy that permits the intended AWS actions. AWS documents the role association as a prerequisite for a pod to access AWS services. A Kubernetes ServiceAccount name on its own is not an IAM grant. Amazon EKS: Grant workloads access using Kubernetes ServiceAccounts, Amazon EKS: Configure pods to access AWS services
Other clouds use their own federation and identity systems. The common principle is to inspect both sides: which Kubernetes or runtime identity is presented, and which cloud principal the provider maps it to. A broad trust condition, shared role, incorrect namespace binding, or accidental use of a node identity can give a test workload authority beyond its intended environment. Do not infer those relationships from a pod spec alone; inspect the actual cluster and provider configuration.
Where production credentials can appear
A process can obtain credentials through several paths:
- A Kubernetes projected token mounted in the pod, used directly against the Kubernetes API or exchanged through a configured federation.
- A mounted Secret containing a static key, password, or certificate.
- Environment variables injected by deployment configuration or a secret manager.
- A cloud metadata service available from the node or workload network.
- A workload identity agent or sidecar that exchanges a token for short-lived credentials.
- A shared runtime service that acts under its own broader identity on behalf of the agent.
Each path has different exposure and revocation behavior. A short-lived token reduces the duration of credential exposure, but it does not narrow the permissions attached to the principal or guarantee that the token cannot be refreshed. A static secret can be scoped narrowly, yet remain available to every process that can read its mount. A metadata endpoint can be protected from ordinary pod access and still be reachable through misconfigured routing or a proxy. The correct question is not only where a credential was configured, but whether the running process can retrieve it, refresh it, or ask another component to use it.
Google Cloud’s service-account guidance recommends limiting privileges and avoiding long-lived keys where possible; short-lived credentials can reduce the risks associated with key material. These controls help, but least privilege still depends on the roles and resource policies assigned to the principal. Google Cloud IAM: Service account best practices, Google Cloud IAM: Service account credentials
Separate environments by identity and resource policy
Development, staging, and production should have distinct workload identities with access to the resources required for their own tasks. A naming convention or namespace label does not create an authorization boundary by itself. Ensure each environment has an identity mapping and IAM policy that independently deny cross-environment access unless a documented workflow requires it.
Shared runtime identities are especially difficult to reason about. If a controller, agent, and unrelated background job use the same service account, the effective permissions become the union of their needs. Compromise or prompt manipulation of the least trusted process can then expose every resource reachable by that shared identity. Dedicated identities per workload or narrowly defined task make ownership and audit trails more meaningful. Google similarly cautions that one service account with access to many resources conflicts with least privilege as applications grow.
Prefer short-lived, audience-restricted credentials and task-scoped authorization where the platform supports them. A document-analysis task may need read access to a specific collection for a limited period. It should not inherit write permission to the document platform, broad object-storage access, or production secrets because those capabilities simplify deployment. Short lifetime is not a substitute for resource scope, and a task-specific token still needs a trustworthy issuance policy.
Network controls should make unnecessary paths unreachable. Restrict pod egress to required services, isolate metadata endpoints, and use Kubernetes NetworkPolicies or equivalent controls where supported by the CNI and infrastructure. Kubernetes notes that NetworkPolicy enforcement depends on the network plugin; a policy object without a supporting implementation does not create the intended traffic filter. Network segmentation can reduce exposure and make exfiltration harder, but it cannot authorize a request to a reachable service. Likewise, a resource policy remains necessary when network reachability is intentionally shared.
Application authorization remains necessary
Cloud IAM may authorize a workload to call a document API while the application decides which documents that caller may read. For multi-tenant systems, the application should bind the requester and agent task to a tenant, collection, and data classification. If a shared backend credential authorizes every request as one service principal, the application must preserve and validate the end-user or delegated identity rather than trusting model-supplied tenant parameters.
This is the distinction between infrastructure authorization and business authorization. Infrastructure IAM can say “this service may call the document API.” Business policy may need to say “this request may retrieve only records for customer X, for this case, under this user’s authority.” Both decisions should be enforced in components the agent cannot bypass. An agent’s reasoning or a container label is not an authorization mechanism.
Test the negative path
An access review should include tests that are supposed to fail, performed from the exact test deployment and identity. Attempt to read a known production object by its identifier; expected outcome: an explicit authorization denial, with no object content returned. Attempt to list the production bucket or enumerate its contents; expected outcome: denial independent of whether a specific object name is known. Query the cloud metadata endpoint from the pod; expected outcome: either no route or a documented response that cannot yield a broader node credential. Attempt to exchange the Kubernetes token with the wrong audience or an untrusted identity provider; expected outcome: token rejection. Attempt to reach an unapproved egress destination; expected outcome: network denial. Finally, call the business API with a different tenant ID; expected outcome: application authorization denies it even if the service can reach the API.
Tests need to distinguish denial at different layers. A timeout does not prove access was denied; it may show only that a route failed. Capture the HTTP or API error, identity principal, policy decision, network policy or flow log, and resource audit event. Verify that no data was returned and no downstream side effect occurred. Then run an allowed test-environment request to confirm that the agent still performs its intended task. Security controls that block all useful traffic are not a successful least-privilege design.
| Test | Boundary under examination | Expected evidence |
|---|---|---|
| Test pod requests a production object | Cloud IAM / resource policy | Denied principal and object in provider audit log; no payload returned |
| Pod calls metadata endpoint | Network and credential exposure | Connection denied or non-privileged identity response; no node credential retrieved |
| Token presented with wrong audience | Federation / token validation | Rejected token with audience mismatch evidence |
| Pod contacts unapproved host | Egress control | Network policy or firewall deny record for the workload identity/IP |
| Agent changes tenant parameter | Business authorization | Application-level denial tied to requester, tenant, and resource |
| Allowed test fixture is requested | Intended task functionality | Successful read limited to test tenant and recorded under dedicated identity |
Evidence for the effective boundary
An inventory should connect the workload name and deployment version to the Kubernetes namespace and ServiceAccount, cloud principal or federation mapping, credential source, effective permissions, network routes, reachable APIs, data classes, and business owner. Capture role bindings and IAM policy versions, not just their friendly names. Record which identity actually appeared in the downstream audit log during a test. The configured identity and the observed identity can differ when SDK credential chains fall back to a node role or environment credential.
Repeat negative tests after changes to the pod spec, base image, service mesh, cluster version, identity association, IAM policy, secret manager, network policy, or downstream application. A static manifest review cannot prove the effective permissions of a running workload, particularly when identities are injected by admission controllers or cloud agents.
The same discipline applies to stronger sandboxing. A microVM or dedicated kernel can improve execution isolation for untrusted code, but the workload still needs an explicit identity and restricted egress. Conversely, ordinary containers can be appropriate for many workloads when they are hardened and paired with narrow authority. Match isolation strength to code trust and impact; do not expect one layer to replace another.
Examine deployment and authority together
A deployment boundary describes where an agent process runs and what it can affect locally. An authority boundary describes the data and actions its identity can reach. For production readiness, those boundaries need to be reviewed together: identify credential paths, effective roles, network routes, data scope, and application decisions; then verify allowed and denied behavior from the real workload. This fits ORBYNTIS’s focus on explicit access boundaries, observable behavior, and controls that can be evaluated across deployment. The evidence should show both that the test agent was contained and that its identity could do only what the task required.



