PIVTR-D
RAWS playbook · Identity and access

Cross-account role or partner access abused

The attacker uses access you granted to another AWS account: a vendor role, a partner's cross-account role, a resource policy or an AWS Resource Access Manager (RAM) share. A typical run starts inside the partner's environment, assumes your role with the partner's credentials, and reads data or changes IAM with the role's permissions. Block the partner role first and keep its trust policy as evidence.

Look here

LogSearch for
CloudTrail, STS in your accountRole sessions started from the partner account: AssumeRole with userIdentity.type, AWSAccount and the partner's userIdentity.accountId. The partner's copy of the event has the same sharedEventID and names the partner-side identity
CloudTrail LakeEvery call made by the partner role. Compare source IPs with the ranges the partner gave you: SELECT eventTime, eventName, awsRegion, sourceIPAddress, userAgent FROM <event-data-store-id> WHERE userIdentity.arn LIKE 'arn:aws:sts::<account>:assumed-role/<partner-role>/%' ORDER BY eventTime
IAM Access AnalyzerEvery resource the partner can reach: aws accessanalyzer list-findings-v2 --analyzer-arn <arn> --filter '{"status":{"eq":["ACTIVE"]},"principal.AWS":{"eq":["<partner-account>"]}}'
IAM roleThe trust policy and the last use of the role, from aws iam get-role --role-name <role>: sts:ExternalId and aws:PrincipalOrgID conditions, a whole-account principal such as arn:aws:iam::<partner-account>:root, and RoleLastUsed
CloudTrail, AWS RAMNew shares and accepted invitations: CreateResourceShare, AssociateResourceShare, AcceptResourceShareInvitation. List current shares: aws ram get-resource-shares --resource-owner SELF
CloudTrail, resource policiesPolicies that add the partner account: PutBucketPolicy, PutKeyPolicy, CreateGrant, Secrets Manager PutResourcePolicy
GuardDutyFindings on the partner role's sessions: Discovery:IAMUser/AnomalousBehavior, Exfiltration:IAMUser/AnomalousBehavior, UnauthorizedAccess:IAMUser/TorIPCaller

Contain

#Item
1Save the role and its trust policy, as in Evidence: aws iam get-role --role-name <role> > <case>-<role>.json
2Block the partner role with an inline deny-all policy. It stops live and new sessions and keeps the trust policy as evidence: aws iam put-role-policy --role-name <role> --policy-name ir-deny-all --policy-document file://deny-all.json
3Revoke sessions issued before now, so the block survives removal of the deny-all: aws iam put-role-policy --role-name <role> --policy-name AWSRevokeOlderSessions --policy-document file://revoke.json
4Cut the partner from every member account at once with a resource control policy (RCP) that denies sts:AssumeRole when aws:PrincipalAccount is the partner account. Turn on the policy type first: aws organizations enable-policy-type --root-id <r-id> --policy-type RESOURCE_CONTROL_POLICY
5Remove the partner from RAM shares: aws ram disassociate-resource-share --resource-share-arn <arn> --principals <partner-account>
6Tell the partner's security contact, ask for their CloudTrail records for the sharedEventID values, and log the contact. See Templates
7Remove the partner from bucket, key and secret policies destructive to the integration, after saving each policy

Eradicate and recover

#Item
1Reverse every change the partner role made in the window, working from the CloudTrail Lake query above
2Rotate secrets and keys the role could read. See Secrets Manager and Parameter Store secrets stolen
3Rebuild the trust with the partner's specific role Amazon Resource Name (ARN) as principal and an sts:ExternalId condition. The partner generates the external ID, unique to your account
4Add aws:PrincipalOrgID to cross-account trusts between your own accounts, and aws:SourceArn or aws:SourceAccount to grants for AWS service principals
5Cut the role's permissions to what the integration uses before you restore access
6Lift the deny and the RCP after the partner confirms its own containment in writing
Watch out
  • AWS does not treat the external ID as a secret. Anyone who can read the role sees it. It prevents the confused deputy problem and gives no protection when the partner itself is compromised.
  • CloudTrail does not log denied cross-account AssumeRole calls in your account. Ask the partner for its failed attempts.
  • RCPs have no effect on resources in the management account. Contain partner roles there with the inline deny.

AWS documentation: IAM third-party access and external ID; cross-service confused deputy prevention; global condition context keys; IAM CloudTrail integration; CloudTrail userIdentity element; IAM Access Analyzer filter keys; Organizations resource control policies; Organizations enable-policy-type; AWS RAM API actions; GuardDuty IAM finding types. Checked September 2026.

Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.