fix(aws): check statement Effect instead of policy Statement in SCP a… (#11727)

Co-authored-by: Daniel Barranquero <danielbo2001@gmail.com>
This commit is contained in:
Narahari RaghavaandDaniel Barranquero authored and GitHub committed 2026-07-09 11:19:33 +02:00
1 parent 18b3c49234
commit 13bd6fc0bf
3 files changed
+140 -1

No files matched your search

@@ -0,0 +1 @@
`organizations_scp_check_deny_regions` no longer reports false `FAIL` for AWS Organizations that restrict regions with Allow-based SCPs; the Allow path now checks the statement `Effect` instead of an always-false comparison that made it unreachable
@@ -67,7 +67,7 @@ class organizations_scp_check_deny_regions(Check):
# Allow if Condition = {"StringEquals": {"aws:RequestedRegion": [region1, region2]}}
if (
policy.content.get("Statement") == "Allow"
statement.get("Effect") == "Allow"
and "Condition" in statement
and "StringEquals" in statement["Condition"]
and "aws:RequestedRegion"