A large enterprise has 200 AWS accounts organized under AWS Organizations. The central security team needs to audit all IAM role trust policies across accounts to ensure no cross-account roles allow external principals. Which approach is most efficient and scalable?
Config aggregator allows querying across all accounts.
Why this answer
AWS Config aggregator with advanced queries allows you to query the resource configuration of IAM roles across all accounts in AWS Organizations from a single management account. This approach is serverless, scalable, and provides a centralized view without needing to script cross-account access or manage multiple findings. The query can filter on the 'assumeRolePolicyDocument' field to detect trust policies that allow external principals (e.g., 'Effect: Allow' with 'AWS': '*' or a non-account ARN).
Exam trap
The trap here is that candidates confuse IAM Access Analyzer's scope (resource-based policies) with IAM role trust policies, or they assume a custom script is more flexible when AWS Config provides a native, scalable solution for cross-account resource auditing.
How to eliminate wrong answers
Option B is wrong because AWS Trusted Advisor checks for overly permissive security groups and S3 bucket policies, not IAM role trust policies; it does not inspect IAM role trust documents. Option C is wrong because writing a custom SDK script requires managing cross-account IAM roles, handling pagination, and scaling to 200 accounts, which is less efficient and more error-prone than a native AWS Config query. Option D is wrong because IAM Access Analyzer generates findings for resource-based policies (e.g., S3 buckets, KMS keys) but does not analyze IAM role trust policies; its scope is limited to policies that grant access to external entities from the resource itself, not the trust relationship of a role.