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
Log
Search for
CloudTrail, STS in your account
Role 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 Lake
Every 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 Analyzer
Every resource the partner can reach: aws accessanalyzer list-findings-v2 --analyzer-arn <arn> --filter '{"status":{"eq":["ACTIVE"]},"principal.AWS":{"eq":["<partner-account>"]}}'
IAM role
The 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 RAM
New shares and accepted invitations: CreateResourceShare, AssociateResourceShare, AcceptResourceShareInvitation. List current shares: aws ram get-resource-shares --resource-owner SELF
CloudTrail, resource policies
Policies that add the partner account: PutBucketPolicy, PutKeyPolicy, CreateGrant, Secrets Manager PutResourcePolicy
GuardDuty
Findings on the partner role's sessions: Discovery:IAMUser/AnomalousBehavior, Exfiltration:IAMUser/AnomalousBehavior, UnauthorizedAccess:IAMUser/TorIPCaller
Contain
#
Item
1
Save the role and its trust policy, as in Evidence: aws iam get-role --role-name <role> > <case>-<role>.json
2
Block 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
3
Revoke 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
4
Cut 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
5
Remove the partner from RAM shares: aws ram disassociate-resource-share --resource-share-arn <arn> --principals <partner-account>
6
Tell the partner's security contact, ask for their CloudTrail records for the sharedEventID values, and log the contact. See Templates
7
Remove the partner from bucket, key and secret policies destructive to the integration, after saving each policy
Eradicate and recover
#
Item
1
Reverse every change the partner role made in the window, working from the CloudTrail Lake query above
Rebuild 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
4
Add aws:PrincipalOrgID to cross-account trusts between your own accounts, and aws:SourceArn or aws:SourceAccount to grants for AWS service principals
5
Cut the role's permissions to what the integration uses before you restore access
6
Lift 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.