Skip to content

Commit

Permalink
another fix to ecr_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Amelchenko committed Jul 26, 2024
1 parent b8c63ee commit a54247a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions checkov/cloudformation/checks/resource/aws/ECRPolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ def scan_resource_conf(self, conf: dict[str, Any]) -> CheckResult:
principal_block = principal_block['AWS']
for principal_index, principal in enumerate(principal_block):
if principal == "*" and not self.check_for_constrained_condition(statement):
self.evaluated_keys = [
f"Properties/RepositoryPolicyText/Statement/[{statement_index}]/Principal/[{principal_index}]"
]
if isinstance(principal_block, list):
self.evaluated_keys = [
f"Properties/RepositoryPolicyText/Statement/[{statement_index}]/Principal/[{principal_index}]"
]
else:
self.evaluated_keys = [
f"Properties/RepositoryPolicyText/Statement/[{statement_index}]/Principal"
]
return CheckResult.FAILED
return CheckResult.PASSED

Expand Down

0 comments on commit a54247a

Please sign in to comment.