Scope the role's trust to the specific agent, service account or workload
Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.
Check 4 of 30: Scope the role's trust to the specific agent, service account or workload. A role that any workload in an account or cluster can assume is a role every compromised workload can use. Tying trust to one agent keeps a break-in elsewhere from reaching it.
The whole checklist ยท The map
Why it matters
A role that any workload in an account or cluster can assume is a role every compromised workload can use. Tying trust to one agent keeps a break-in elsewhere from reaching it.
How, in each cloud
- AWS
- Use trust policy conditions (for Pod Identity, session tags for service account, namespace and cluster; for services, aws:SourceArn and aws:SourceAccount).
- Google Cloud
- In IAM policies, grant access to the principal that corresponds to one Kubernetes workload, not to the whole cluster or project.
- Azure
- Configure workload identity federation so one managed identity trusts one Kubernetes workload.
What the documentation says
- "You can use these tags in the condition keys in the trust policy to restrict which service accounts, namespaces, and clusters can use this role." (source)
- "We recommend using aws:SourceArn , aws:SourceAccount , aws:SourceOrgID , or aws:SourceOrgPaths in your resource policies wherever" (source)
- "In your IAM policy, you refer to a Kubernetes resource by using" (source)
- "Establish a trust relationship between your user-assigned managed identity or app in Microsoft Entra ID and a Kubernetes workload" (source)
- Previous: Limit who can pass, attach or impersonate the agent's role
- Next: Do not run the agent as a default or pre-granted account
Related pages
- Do not run the agent as a default or pre-granted account: the check, and how in AWS, Google Cloud and Azure
- Write the agent's permission policy from what its tools actually call: the check, and how in AWS, Google Cloud and Azure
- Set an organization-level ceiling the agent's role cannot exceed: the check, and how in AWS, Google Cloud and Azure
Sources
- docs.aws.amazon.com/eks/latest/userguide/pod-id-role.html, read 10 Nov 2026
- docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html, read 10 Nov 2026
- cloud.google.com/kubernetes-engine/docs/concepts/workload-identity, read 10 Nov 2026
- learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation, read 10 Nov 2026
Last reviewed 16 Nov 2026.