Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IaC Scan Runner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PIACERE
public
The Platform
IaC Scan Runner
Commits
cae28a55
Commit
cae28a55
authored
2 years ago
by
penenadpi
Committed by
Mati(ja)c Cankar
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed output for scenario when there is no list of desired scans
parent
10f556c4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/iac_scan_runner/results_summary.py
+11
-1
11 additions, 1 deletion
src/iac_scan_runner/results_summary.py
src/iac_scan_runner/scan_runner.py
+17
-7
17 additions, 7 deletions
src/iac_scan_runner/scan_runner.py
with
28 additions
and
8 deletions
src/iac_scan_runner/results_summary.py
+
11
−
1
View file @
cae28a55
...
...
@@ -119,10 +119,20 @@ class ResultsSummary:
self
.
outcomes
[
check
][
"
status
"
]
=
"
Problems
"
return
"
Problems
"
if
check
==
"
terrascan
"
:
if
outcome
==
""
:
self
.
outcomes
[
check
][
"
status
"
]
=
"
Passed
"
return
"
Passed
"
else
:
self
.
outcomes
[
check
][
"
status
"
]
=
"
Problems
"
return
"
Problems
"
if
check
==
"
other
"
:
self
.
outcomes
[
check
][
"
status
"
]
=
"
No scan performed
"
return
"
No scan
"
else
:
self
.
outcomes
[
check
][
"
status
"
]
=
"
Not fully supported yet
"
return
"
Not fully supported yet
"
def
summarize_no_files
(
self
,
check
:
str
):
"""
...
...
This diff is collapsed.
Click to expand it.
src/iac_scan_runner/scan_runner.py
+
17
−
7
View file @
cae28a55
...
...
@@ -142,6 +142,7 @@ class ScanRunner:
os
.
mkdir
(
dir_name
)
compatible_checks
=
self
.
compatibility_matrix
.
get_all_compatible_checks
(
self
.
iac_dir
)
print
(
compatible_checks
)
non_compatible_checks
=
[]
scan_output
=
{}
...
...
@@ -162,15 +163,24 @@ class ScanRunner:
self
.
results_summary
.
dump_outcomes
(
random_uuid
)
self
.
results_summary
.
generate_html_prioritized
(
random_uuid
)
else
:
print
(
"
Else
"
)
for
iac_check
in
self
.
iac_checks
.
values
():
if
iac_check
.
enabled
:
if
iac_check
.
name
in
compatible_checks
:
print
(
"
run
"
)
print
(
iac_check
.
name
)
check_output
=
iac_check
.
run
(
self
.
iac_dir
)
scan_output
[
iac_check
.
name
]
=
check_output
.
to_dict
()
# TODO: Discuss the format of this output
write_string_to_file
(
iac_check
.
name
,
dir_name
,
scan_output
[
iac_check
.
name
][
"
output
"
]
)
write_string_to_file
(
iac_check
.
name
,
dir_name
,
scan_output
[
iac_check
.
name
][
"
output
"
])
self
.
results_summary
.
summarize_outcome
(
iac_check
.
name
,
scan_output
[
iac_check
.
name
][
"
output
"
],
self
.
compatibility_matrix
.
scanned_files
,
Compatibility
.
compatibility_matrix
)
else
:
non_compatible_checks
.
append
(
iac_check
.
name
)
write_string_to_file
(
iac_check
.
name
,
dir_name
,
"
No files to scan
"
)
self
.
results_summary
.
summarize_no_files
(
iac_check
.
name
)
self
.
results_summary
.
dump_outcomes
(
random_uuid
)
self
.
results_summary
.
generate_html_prioritized
(
random_uuid
)
# TODO: Discuss the format of this output
if
scan_response_type
==
ScanResponseType
.
json
:
scan_output
=
json
.
loads
(
file_to_string
(
f
"
../outputs/json_dumps/
{
random_uuid
}
.json
"
))
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment