mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
fix(vpc): solve AWS principal key error (#3903)
This commit is contained in:
+7
-3
@@ -55,10 +55,14 @@ class vpc_endpoint_connections_trust_boundaries(Check):
|
||||
break
|
||||
|
||||
else:
|
||||
if isinstance(statement["Principal"]["AWS"], str):
|
||||
principals = [statement["Principal"]["AWS"]]
|
||||
if "AWS" in statement["Principal"]:
|
||||
if isinstance(statement["Principal"]["AWS"], str):
|
||||
principals = [statement["Principal"]["AWS"]]
|
||||
else:
|
||||
principals = statement["Principal"]["AWS"]
|
||||
else:
|
||||
principals = statement["Principal"]["AWS"]
|
||||
# If the principal is not an AWS principal, we don't need to check it since it could be a service or a federated principal
|
||||
principals = []
|
||||
for principal_arn in principals:
|
||||
report = Check_Report_AWS(self.metadata())
|
||||
report.region = endpoint.region
|
||||
|
||||
Reference in New Issue
Block a user