How do you test whether an IAM role is allowed an action before deploying?
AdvancedProductionRapid-Fire Tool Questions
Answer
aws iam simulate-principal-policy \
--policy-source-arn arn:aws:iam::111122223333:role/payments-api \
--action-names s3:GetObject kms:Decrypt \
--resource-arns arn:aws:s3:::prod-payments/invoices/1.pdf
The simulator evaluates identity policies and permission boundaries; SCPs, RCPs and resource policies may still deny in reality, so confirm critical paths in a test account.
More on Rapid-Fire Tool Questions
Gitleaks command to scan only staged changes before a commit?BeginnerTrivy command to fail a build only on fixable critical vulnerabilities?BeginnerGenerate a CycloneDX SBOM for an image with Syft and scan it with Grype?BeginnerCosign keyless verify command that pins the GitHub Actions workflow identity?IntermediateRun Checkov against a Terraform plan instead of raw HCL?BeginnerSemgrep command to scan with OWASP rules and fail on findings?Beginner