AWS gives you two ways to let another account touch your resources, a role it assumes or a resource-based policy that names it directly, and the choice changes who holds the credentials, who sees the logs and which organisation guardrails apply. Teams usually pick whichever the tutorial used, then discover months later that a bucket policy bypassed a service control policy or that a vendor role trail stops at an account ID. This guide compares the two patterns on trust boundaries, confused deputy exposure, audit trails, interaction with service control policies (SCPs) and resource control policies (RCPs), blast radius and non-human identity sprawl, with a worked scenario and decision criteria. It is written for cloud security architects, platform engineers and the people who approve third-party access to AWS estates.
This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of November 2026. It is not sponsored or reviewed by AWS. Product features change, so confirm settings against AWS's current documentation.
Key takeaways
- A role swaps permissions, a resource policy adds them. AWS states that a principal assuming a role gives up its original permissions, while a principal granted access through a resource-based policy "still works in the trusted account" and keeps its own access, which is why copying data between accounts usually uses the resource policy.
- Both sides must allow, and either side can deny. Cross-account requests are evaluated in the trusting and the trusted account, and are allowed only when both return Allow; an explicit deny in either account ends the request.
- SCPs govern your principals, RCPs govern your resources. SCPs do not affect principals outside your organisation and do not affect resource-based policies directly; RCPs restrict what any principal, including external ones, can do to resources in member accounts.
- The audit trail lives in different places. AssumeRole is logged in both accounts but the target account sees only the caller's account ID; for S3 object access through a bucket policy, CloudTrail delivers data events to the requester and to the bucket owner, but only if data events are enabled.
- Roles concentrate, resource policies scatter. One role per partner is one identity to review; resource policies spread trust across every bucket, key, queue and secret, which is harder to inventory but narrower per grant.
The short answer
Use a cross-account role when a principal in another account needs to act inside your account across several resources or services, when a third party needs access (so you can require an external ID), or when the resource takes no resource-based policy. Use a resource-based policy when another account needs a narrow action on one resource, especially when it must keep its own permissions at the same time, such as writing logs into a central bucket, reading a shared KMS key, or sending to a queue. In both cases, put organisation-wide limits in RCPs and SCPs rather than trusting each policy author to get conditions right.
For the general model across clouds see the Cross-Account and Cross-Tenant Access Guide, and for a step-by-step trust policy review see How to review AWS cross-account trust policies for confused deputy. This page is about choosing between the two patterns.
How each pattern works
Cross-account role
- Trust policy: AWS defines it as "a required resource-based policy that is attached to a role in IAM" naming the principals trusted to assume the role. The trusted account must also give its principal an identity policy allowing
sts:AssumeRoleon the role ARN. - Credentials: the caller receives temporary security credentials for a role session. The role "does not have standard long-term credentials such as a password or access keys".
- Permissions: the session uses only the role's permissions policies, not the caller's. The caller must switch back to reach its own resources.
- Session length:
DurationSecondscan be up to 43,200 seconds (12 hours) depending on the role's maximum session duration, but role chaining limits a session "to a maximum of one hour".
Resource-based policy
- Policy on the resource: a bucket policy, key policy, queue or topic policy, secret policy or Lambda function policy names the external account, role, user or service principal and the actions allowed.
- Credentials: the caller uses its own credentials; nothing new is issued.
- Permissions: the caller keeps its own permissions and gains the granted actions on that one resource. AWS notes the trusted account "cannot delegate more access than the account itself has been granted".
- Service coverage: only services listed with resource-based policy support in the AWS "services that work with IAM" table. For anything else AWS says to "use a role as a proxy".
Some services add their own rules. For AWS KMS, "Neither the key policy nor the IAM policy alone is sufficient", and cross-account permission is effective only for cryptographic operations, CreateGrant, DescribeKey, GetKeyRotationStatus, GetPublicKey, ListGrants, RetireGrant and RevokeGrant. Callers must use the key ARN or alias ARN, because a bare key ID or alias is assumed to be in the caller's own account. See the AWS KMS Security Guide.
Side-by-side comparison
| Dimension | Cross-account role | Resource-based policy |
|---|---|---|
| Where trust is written | Role trust policy in the resource owner's account | Policy on each shared resource |
| Caller's own permissions during access | Given up for the session | Kept |
| Credentials | New temporary session credentials from STS | Caller's existing credentials |
| Scope of one grant | Everything the role's permission policies allow in the account | Named actions on one resource (and its objects for S3) |
| Third-party confused deputy control | sts:ExternalId condition in the trust policy | Source conditions such as aws:SourceArn and aws:SourceAccount when a service principal is granted |
| Identity attribution in the owner's logs | AssumeRole shows caller account ID only; later calls show the role session, traceable through session name and source identity | Requester's principal appears in the event; S3 object events delivered to both requester and bucket owner |
| Organisation guardrails that apply | Owner's SCPs apply to the role session (it is your principal); owner's RCPs apply to resources it touches | Owner's SCPs do not apply to the external caller; owner's RCPs do |
| Inventory point | IAM roles with external principals | Every resource policy in every supported service |
| Typical uses | Vendor integrations, CI/CD deployment, central security tooling, admin access | Central log buckets, shared KMS keys, cross-account queues and topics, Lambda invocation |
Trust boundaries and the confused deputy
AWS describes the confused deputy problem as "an entity that doesn't have permission to perform an action can coerce a more-privileged entity to perform the action", and distinguishes two cases.
- Cross-account (roles): a vendor with roles in many customer accounts is tricked into assuming yours on another customer's behalf. The fix is an
sts:ExternalIdcondition. AWS says the value "must be unique among Example Corp's customers and controlled by Example Corp, not its customers". Trusting an account ARN trusts every principal that account's administrators allow to call AssumeRole. - Cross-service (resource policies): an AWS service principal such as CloudTrail or SNS is granted access to your bucket or key, and another customer's resource causes the service to act against it. AWS recommends
aws:SourceArn,aws:SourceAccount,aws:SourceOrgIDoraws:SourceOrgPaths"wherever an AWS service principal is granted permission to access one of your resources". - Agents and automation: the same pattern applies to AI agents and automation acting with delegated access. See the Confused Deputy in AI Agents Guide.
Threat model for each pattern
| Threat | Cross-account role | Resource-based policy | ATT&CK |
|---|---|---|---|
| Compromised partner account | Attacker assumes the role and inherits everything it grants | Attacker uses the partner's own credentials on each shared resource | T1199 Trusted Relationship, T1078.004 Cloud Accounts |
| Wildcard or over-broad principal | "*" or a whole account in the trust policy | "*" principal on a bucket or queue makes it public or cross-tenant | T1530 Data from Cloud Storage |
| Data exfiltration to attacker account | Role session copies data out to an external bucket | Caller keeps its own permissions, so it can read your object and write to its bucket in one flow | T1537 Transfer Data to Cloud Account |
| Privilege escalation through chaining | Role trusts another role, which trusts another | Policy grants actions like iam:PassRole or key grants that widen access | T1548.005 Temporary Elevated Cloud Access |
| Persistence | Attacker edits a trust policy to add their account | Attacker adds their account to a bucket or key policy | T1098 Account Manipulation |
Resource policies need the same review discipline as identities. In the Twilio TaskRouter SDK compromise, an S3 bucket policy allowing any AWS principal to read and write a library path, added while troubleshooting, let an outsider replace the published SDK.
How SCPs and RCPs interact with each pattern
This is the dimension most often misunderstood. AWS states that "SCPs don't affect resource-based policies directly" and that they "don't affect users or roles from accounts outside the organization". Its example: a bucket in account A grants access to users in account B outside the organisation; account A's SCP "doesn't apply to those outside users".
- Role pattern: once an external caller assumes your role, it acts as a principal in your member account, so your SCPs limit the session. A deny on leaving approved Regions or disabling CloudTrail applies to the vendor's session.
- Resource policy pattern: the external caller remains a principal of its own account, so only its own organisation's SCPs apply to it. Your control is the resource policy itself and your RCPs.
- RCPs fill that gap: AWS says to "Use an RCP when you need to restrict IAM principals that are external to your organization accounts making requests to access resources within your organization's member accounts", and that RCPs apply "regardless of whether the principals belong to the same organizations or not", including root users.
- Effective permissions: "the logical intersection between what is allowed by the RCPs and service control policies (SCPs) and what is allowed by the identity-based and resource-based policies." Neither grants anything on its own.
- Documented exclusions: SCPs and RCPs do not apply in the management account or to service-linked roles, and RCPs do not apply to AWS managed KMS keys. Keep workloads and shared resources out of the management account.
- Service coverage: RCPs apply to the services AWS lists, including Amazon S3, AWS STS, AWS KMS, Amazon SQS and AWS Secrets Manager. Because STS is covered, an RCP can also constrain who may assume roles in member accounts.
AWS's data perimeter examples frame this as three objectives: only trusted identities access your resources (enforced with RCPs), your identities access only trusted resources (enforced with SCPs), and access comes only from expected networks (SCPs, RCPs and VPC endpoint policies). See the AWS Resource Control Policies and Data Perimeter Guide and the AWS Organizations and SCPs Guide.
Audit trails and attribution
- AssumeRole events: AWS logs the operation "in the calling account and the account where the AWS STS operation is performed". In your account,
userIdentityshows typeAWSAccountwith the caller's account ID, not the user name. - Later role calls: actions with the session credentials show the role identity only. To trace them, correlate on role session name and source identity from the AssumeRole event. Require them with
sts:SourceIdentityandsts:RoleSessionNameconditions in the trust policy; source identity persists through role chaining. See AWS Role Chaining Detection. - Denied assumption attempts: AWS states that CloudTrail "does not log denied AWS STS requests in the target account for cross-account role assumptions", so failed probing of your roles is visible only to the caller's account.
- Resource policy access to S3: CloudTrail "always delivers object-level API logs to the requester" and also to the bucket owner, but "By default, CloudTrail doesn't log data events", and some access denied entries are redacted or omitted. Without S3 data events on shared buckets you have no record of external reads.
- Reachability, not use: IAM Access Analyzer external access analysis covers 15 resource types, including S3 buckets, IAM roles, KMS keys, Lambda, SQS, SNS, Secrets Manager, ECR, EFS, RDS and EBS snapshots and DynamoDB, and reports grants to entities outside your zone of trust. See the IAM Access Analyzer Guide.
Blast radius and NHI sprawl
Both patterns create non-human identity relationships that outlive the project that created them, but they sprawl differently.
- Roles concentrate risk: one vendor role with
ReadOnlyAccessis one identity to review, but compromise exposes the whole account's readable data. Per-purpose roles with narrow policies and permissions boundaries keep blast radius down at the cost of more roles. See the AWS IAM Permissions Boundaries Guide. - Resource policies scatter risk: each grant is narrow, but there is no single list of who outside the organisation can reach what. A partner named in 40 bucket policies is 40 places to remove it at offboarding.
- Wildcards grow silently: AWS warns that wildcard grants cover "resources you add or gain access to after creating the user's policy", so a role allowed
s3:*on*gains every new bucket. - Machine callers dominate: most cross-account callers are pipelines, collectors and integrations, not people. Give each its own role or principal so access can be attributed and revoked independently. See How to find unused AWS IAM roles and access keys.
Worked scenario: central logging plus a monitoring vendor
An organisation with 60 member accounts wants every account to deliver logs to a central security bucket encrypted with a central KMS key, and a third-party monitoring vendor to read configuration across all accounts.
- Log delivery uses resource policies. The central bucket policy and key policy allow the organisation's accounts and the delivering service principals, with
aws:SourceOrgIDon the service principal statements. Writers keep their own permissions and need no extra identity. - The vendor uses one role per member account. Each trust policy names the vendor's published account, requires the vendor-issued
sts:ExternalId, and attaches a narrow read-only policy rather than a broad managed policy. Because the vendor session is a principal in the member account, the organisation's SCPs (for example, denying changes to CloudTrail) apply to it. - RCPs set the outer wall. An identity perimeter RCP denies access to S3, KMS, SQS, Secrets Manager and STS for principals outside the organisation, with a named exception for the vendor's account ID. Before attaching at the root, it runs on a test OU while the team reviews CloudTrail for Access Denied errors, as AWS recommends.
- Logging is turned on where it matters. S3 data events are enabled on the central bucket; AssumeRole events for the vendor role are alerted on when the source account is not the vendor's.
- Offboarding is one change. Removing the vendor's account ID from the RCP exception cuts every role in one step, even before each trust policy is deleted.
A small organisation with two or three accounts can skip RCPs at first and rely on careful resource policies and Access Analyzer, but should still keep the management account free of shared resources because organisation policies do not protect it.
Decision criteria
| If the requirement is | Prefer | Why |
|---|---|---|
| Third party needs access across services | Role with external ID | Confused deputy control, one identity to revoke, your SCPs apply |
| Caller must keep its own permissions while accessing yours (copy, replicate, deliver) | Resource-based policy | No permission swap; one flow reads from one account and writes to another |
| Resource type has no resource-based policy | Role | AWS directs a role as proxy |
| Single action on a single resource, such as invoking a function or decrypting with one key | Resource-based policy | Narrowest grant, no extra identity to manage |
| Your organisation's guardrails must bind the caller | Role, plus RCPs | SCPs apply to role sessions in member accounts; RCPs apply to external callers either way |
| Strong per-person attribution is required | Role with required source identity | Session name and source identity link actions back to the caller |
| AWS service needs to write to your resource | Resource-based policy with source conditions | Service principals are granted on the resource with aws:SourceArn or aws:SourceAccount |
Trade-offs to plan for: roles add an identity per relationship and require the caller to switch context; resource policies multiply review points. Large estates usually use both and govern them centrally with RCPs, SCPs and Access Analyzer.
Implementation and rollback
- Inventory both patterns. List roles with external principals and every resource policy that names an account outside the organisation, using Access Analyzer findings as the starting set.
- Classify each grant. Partner, internal cross-account, AWS service principal or public; record owner, purpose and contract.
- Fix conditions first. Add
sts:ExternalIdto third-party roles and source conditions to service principal grants; these rarely break legitimate use when coordinated with the vendor. - Narrow principals and actions. Replace account root principals with specific role ARNs where the partner can commit to them; replace wildcards with named actions.
- Add RCPs in stages. Attach to a test account, then an OU, reviewing Access Denied events before moving up.
- Roll back cleanly. Keep the previous policy version in source control; detaching an RCP or restoring a previous trust policy restores access quickly, so change windows can be short.
Detection and measurement
| Metric | What good looks like |
|---|---|
| Active Access Analyzer external access findings without an owner | Zero; every finding archived with a reason or removed |
Third-party roles without sts:ExternalId | Zero |
| Service principal grants without source conditions | Zero, tracked per resource type |
| Shared buckets with S3 data events enabled | 100% of buckets reachable from outside the organisation |
| Cross-account grants unused for 90 days | Trending down; removed at each review |
| Member accounts covered by an identity perimeter RCP | Rising to all production OUs |
Framework mapping
| Framework | Reference | How it applies |
|---|---|---|
| NIST SP 800-53 Rev 5 | AC-3, AC-6, AC-20, AC-21 | Enforcing and minimising cross-account grants; controlling use of external systems and information sharing |
| NIST SP 800-53 Rev 5 | AU-12, SA-9 | Generating audit records for shared resources; governing external system services such as vendors |
| NIST CSF 2.0 | PR.AA-05, GV.SC-07, DE.CM-03 | Defined and reviewed permissions; supplier risk; monitoring of activity |
| MITRE ATT&CK | T1199, T1078.004, T1530, T1537 | Trusted relationship abuse, cloud account misuse, data access and transfer to external accounts |
Common failure patterns
- Assuming SCPs protect shared buckets. A bucket policy grants an external account access and the team believes an organisation-wide SCP limits it. It does not; only the resource policy and RCPs do.
- Trusting an account root for a vendor without an external ID. Any principal the vendor's administrators allow can assume the role, and the vendor can be steered into doing it for another customer.
- Service principal grants without source conditions. A bucket or key open to a service principal can be reached on behalf of other customers' resources.
- No data events on shared resources. The owner has no record of what an external account read through a bucket policy.
- Shared resources in the management account. SCPs and RCPs do not apply there, so the only control is the resource policy.
- Offboarding one place only. The vendor role is deleted but its account ID remains in key and bucket policies.
Practitioner checklist
- Choose roles for third-party and multi-service access, resource policies for narrow single-resource sharing.
- Require
sts:ExternalIdon every third-party trust policy and source conditions on every service principal grant. - Require
sts:SourceIdentityorsts:RoleSessionNameon roles used by people or shared automation. - Name specific role ARNs, not account roots or wildcards, wherever the partner can support it.
- Deploy an identity perimeter RCP with explicit partner exceptions, tested OU by OU.
- Enable S3 data events on every bucket reachable from outside the organisation.
- Keep shared resources and workloads out of the management account.
- Review Access Analyzer external access findings on a schedule and at every vendor offboarding.
Standards and references
- AWS: Cross account resource access in IAM
- AWS: Cross-account policy evaluation logic
- AWS: The confused deputy problem
- AWS: Resource control policies (RCPs)
- AWS: Service control policies (SCPs)
- AWS: Logging IAM and AWS STS API calls with AWS CloudTrail
- AWS: Allowing users in other accounts to use a KMS key
- AWS Samples: Data perimeter policy examples
Related NHI Mgmt Group resources: Cross-Account and Cross-Tenant Access Guide · How to review AWS cross-account trust policies for confused deputy · AWS IAM Policies and Roles Guide · AWS Resource Control Policies and Data Perimeter Guide