Least privilege for third-party identities in AWS means narrow cross-account roles with an external ID
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Third-party identities in AWS are the cross-account roles that vendors, partners and your own other accounts assume. AWS's IAM documentation, read 16 Nov 2026, describes the trust policy, the external ID and confused deputy conditions. This guide lists the tools, steps, policies to avoid and measures.
Open the calculator ยท All guides
Third parties reach an AWS account by assuming a role you create
AWS's documentation on third-party access says you can delegate access by creating a role that the third party assumes, so no AWS security credentials are shared. The third party supplies its AWS account ID, which you name as the principal in the trust policy.
The role has two parts. The trust policy says who may assume it. The permissions policy says what the assumed role can do. AWS states that a third party can access any resource you specify in the policy, and that their use of your resources is billed to you, so the policy is where you limit them.
A second case is your own accounts. AWS documents granting IAM users permission to switch to roles in other accounts you own, for example a production account where administrators assume a role only when they must terminate an instance. The same cross-account structure applies, with you on both sides.
A third case is AWS services acting across accounts, for example CloudTrail writing to a bucket in another account. AWS calls the risk in both the vendor case and the service case the confused deputy problem.
The external ID and source conditions are AWS's documented controls for third-party roles
AWS says the external ID is an identifier known only to you and the third party, that you set it in the trust policy through the sts:ExternalId condition, and that its primary function is to prevent the confused deputy problem. AWS tells you not to use something guessable, such as the third party's name or phone number. It also states that AWS does not treat an external ID as a secret and anyone who can view the role can see it.
The confused deputy documentation describes how, without an external ID, another customer of the same vendor could supply your role ARN, which is not a secret, and have the vendor act in your account.
For service-to-service access, AWS recommends the aws:SourceArn, aws:SourceAccount, aws:SourceOrgID and aws:SourceOrgPaths condition keys in resource policies.
For finding what third parties can actually reach, IAM Access Analyzer external access analyzers identify resources and roles shared with an external entity, and AWS says external access findings are free. The unused access analyzer then shows whether a vendor role is idle or holds permissions its caller never uses; AWS states unused access findings are charged. Neither tool replaces knowing who the vendor is, which the method page treats as an inventory problem before a tooling problem.
Steps to bring third-party and cross-account roles to least privilege
- Run an external access analyzer for the organization and list every role that principals outside your zone of trust can assume.
- For each role, record the vendor, the business owner, the purpose and the date access was last needed.
- Confirm every vendor role has an sts:ExternalId condition, and replace guessable values with unique ones per customer relationship.
- Replace AdministratorAccess or other broad managed policies with a policy that lists the vendor's required actions on named resources. Ask the vendor for its required permission list; AWS says the third party must tell you the permissions it needs.
- Generate a policy from CloudTrail activity for the role (up to 90 days) and compare it with what the vendor documented.
- Add conditions where the vendor can meet them. AWS's best practices page gives requiring TLS as one example of a policy condition.
- Delete roles that the unused access analyzer reports as unused, after notifying the owner.
- Set a review date per vendor and revoke the role when the contract ends.
Policies and trust settings to avoid on third-party roles
| Policy or setting | Documented reason (AWS, read 16 Nov 2026) | Use instead |
|---|---|---|
| A vendor role without an external ID | AWS says the external ID prevents the confused deputy problem when a vendor serves many customers. | A unique external ID in the trust policy condition. |
| A guessable external ID | AWS says not to use something that can be guessed, such as a company name or phone number. | An identifier known only to you and the vendor. |
| AdministratorAccess on a vendor role | AWS describes it as all actions on all resources, and says third parties can reach any resource the policy names. | A policy of named actions on named resources. |
| Vendor roles nobody uses | AWS says the unused access analyzer reports roles with no access activity in the usage window. | Delete the role after notifying the owner. |
| Service principal access without source conditions | AWS says a bucket trusting a service principal with no conditions can receive data from an unauthorized actor's account. | aws:SourceArn or aws:SourceAccount conditions. |
Measure vendor roles, their age and the share of their permissions used
Count the roles assumable from outside your organization, the share with an external ID, and the share that have an assigned owner. Then compare, per vendor role, the actions granted with the actions seen in CloudTrail.
A large gap between actions granted and actions seen is the clearest signal. Roles with no activity at all are the next signal, because they are access nobody is using and nobody is watching. Privilege creep describes how such roles accumulate, and the glossary defines the terms used above.
Related guides: Azure third-party identities and Google Cloud third-party identities.
Related pages
Sources
- AWS IAM User Guide: Access to AWS accounts owned by third parties, read 16 Nov 2026
- AWS IAM User Guide: The confused deputy problem, read 16 Nov 2026
- AWS IAM User Guide: Access for an IAM user in another AWS account that you own, read 16 Nov 2026
- AWS IAM User Guide: Using IAM Access Analyzer, read 16 Nov 2026
- AWS IAM User Guide: IAM Access Analyzer findings, read 16 Nov 2026
- AWS IAM User Guide: IAM Access Analyzer policy generation, read 16 Nov 2026
- AWS IAM User Guide: AWS managed policies for job functions, read 16 Nov 2026
Last reviewed 16 Nov 2026.