From 18cd88e7a5c7bc2a61a568f158b4ee6d757742ef Mon Sep 17 00:00:00 2001 From: lachlanjholmes <1935116+lachlanjholmes@users.noreply.github.com> Date: Mon, 13 Mar 2023 13:27:00 +1100 Subject: [PATCH] Update PolicyAnalyzer.py As mentioned in #166 this PR fixes the recommend_groups command. --- airiam/find_unused/PolicyAnalyzer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airiam/find_unused/PolicyAnalyzer.py b/airiam/find_unused/PolicyAnalyzer.py index 577642e..0176876 100644 --- a/airiam/find_unused/PolicyAnalyzer.py +++ b/airiam/find_unused/PolicyAnalyzer.py @@ -59,7 +59,7 @@ def policy_is_write_access(policy_document): try: action_regex = action_name.replace('*', '.*') action_objs = [] - for priv, priv_obj in action_map.get(action_service, {}).get('privileges', []).items(): + for priv, priv_obj in action_map.get(action_service, {}).get('privileges', {}).items(): if re.match(action_regex, priv): action_objs.append(priv_obj) except StopIteration: