fix(s3_bucket_policy_public_write_access): Handle S3 Policy without Principal (#2871)

This commit is contained in:
Pepe Fagoaga
2023-09-27 09:35:26 +02:00
committed by GitHub
parent 1697e6ad62
commit 7ecb4d7b00

View File

@@ -41,7 +41,10 @@ class s3_bucket_policy_public_write_access(Check):
if ( if (
statement["Effect"] == "Allow" statement["Effect"] == "Allow"
and "Condition" not in statement and "Condition" not in statement
and (
"Principal" in statement
and "*" in str(statement["Principal"]) and "*" in str(statement["Principal"])
)
and ( and (
"s3:PutObject" in statement["Action"] "s3:PutObject" in statement["Action"]
or "*" in statement["Action"] or "*" in statement["Action"]