DET-125 · human · confidence High
Role Trust Policy Changes
Flag edits to role trust policies that add principals outside the organization.
Who can assume a role is set by its trust policy. CloudTrail logs UpdateAssumeRolePolicy and CreateRole with the full policy document. Parsing out account IDs and federated providers, and checking them against known accounts and partners, catches backdoor trust. IAM Access Analyzer external access findings give the same answer as a managed feed.
Store the before and after policy for each change. In an investigation, the added principal often points straight at a personal or side-business account, and the timing shows whether it was planted ahead of a departure.
- Data sources
- AWS CloudTrailIAM Access AnalyzerAzure Activity LogGCP Cloud Audit Logs
- Platforms
- AWSAzureGCP
Logic
CloudTrail eventName IN ("UpdateAssumeRolePolicy", "CreateRole")
| extract all 12-digit account IDs from requestParameters.policyDocument
| where any account_id not in org_accounts and not in approved_partners
| alert with userIdentity.arn, roleName, added principals
Azure: Microsoft.Authorization/roleAssignments/write where principal is a guest; GCP: SetIamPolicy adding member with domain not in corp domainsFalse positives
Onboarding a new vendor or SaaS integration that needs cross-account access.