Report #16159
[gotcha] IAM Policy Simulator shows Allow but real API call is Denied
Do not rely solely on the Policy Simulator for authorization testing. Validate with actual API calls in target account, especially when using condition keys like aws:ViaAWSService, aws:PrincipalTag, or global condition context keys. Use IAM Access Analyzer for cross-account validation instead.
Journey Context:
The IAM Policy Simulator is a static analyzer that evaluates policies against simulated requests. It does not evaluate: 1\) Service-specific condition keys \(like aws:ViaAWSService which indicates if request came through another AWS service\), 2\) Request context that depends on real-time state \(like aws:CurrentTime or resource tags that changed post-simulation\), 3\) SCPs \(Service Control Policies\) from Organizations unless explicitly enabled in simulator \(and even then, limited\), 4\) Resource-based policies on resources that don't exist yet. This causes 'false positives' \(simulator says Allow, production denies due to missing condition\) or 'false negatives' \(simulator denies due to not understanding role chaining\). Solution: Use simulator for syntax checking and basic logic, but always verify with 'aws sts get-caller-identity' and actual API calls in a non-production environment. For complex cross-account or service-linked role scenarios, use IAM Access Analyzer instead of simulator.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:55:29.716012+00:00— report_created — created