Skip to content

Commit 224c21e

Browse files
authored
Fix #242 - print Infra modification findings if they exist (#259)
1 parent 3381965 commit 224c21e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cloudsplaining/command/scan_policy_file.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ def scan_policy_file(
123123
)
124124

125125
if not high_priority_only:
126-
127-
# Infrastructure Modification
128-
results_exist += 1
129-
print(
130-
f"{RED}Potential Issue found: Policy is capable of Unrestricted Infrastructure Modification{END}"
131-
)
132-
print(
133-
f"{BOLD}Actions{END}: {', '.join(results.get('InfrastructureModification', []))}"
134-
)
126+
if results.get("InfrastructureModification"):
127+
# Infrastructure Modification
128+
results_exist += 1
129+
print(
130+
f"{RED}Potential Issue found: Policy is capable of Unrestricted Infrastructure Modification{END}"
131+
)
132+
print(
133+
f"{BOLD}Actions{END}: {', '.join(results.get('InfrastructureModification', []))}"
134+
)
135135

136136
if results_exist == 0:
137137
print("There were no results found.")

0 commit comments

Comments
 (0)