Skip to content

Commit

Permalink
flatten cloudsplaining result
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Amelchenko committed Jul 26, 2024
1 parent 88b0438 commit 99fe90c
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ def __init__(self):
super().__init__(name=name, id=id)

def cloudsplaining_analysis(self, policy):
escalation = policy.allows_privilege_escalation
return escalation
escalations = policy.allows_privilege_escalation
flattened_escalations: list[str] = []
if escalations:
for escalation in escalations:
if isinstance(escalation, dict):
flattened_escalations.extend(escalation.get('actions'))
else:
flattened_escalations.append(escalation)
return flattened_escalations


check = cloudsplainingPrivilegeEscalation()

0 comments on commit 99fe90c

Please sign in to comment.