Skip to content

Commit

Permalink
Did fix on type errors
Browse files Browse the repository at this point in the history
Signed-off-by: hansinikarunarathne <[email protected]>
  • Loading branch information
hansinikarunarathne committed Jun 26, 2024
1 parent 6ce9e1e commit bc7a2e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ jobs:
run: |
pip install prettytable
# Run the python script (trivy_scan.py)
- name: Run image extracting and security scanning script
run: |
cd hack
python3 trivy_scan.py
- name: Upload trivy scanned_results
uses: actions/upload-artifact@v4
with:
name: trivy_scanned_results
path: image_lists/


10 changes: 5 additions & 5 deletions hack/trivy_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ def extract_images(version):

image_name_scan = image_name.split('/')[-1]

scan_output_file = os.path.join(file_reports_dir, f"{image_name_scan}_scan.json")

if image_tag:
image_name_scan = f"{image_name_scan}:{image_tag}"
image_name_scan = f"{image_name_scan}_{image_tag}"

scan_output_file = os.path.join(file_reports_dir, f"{image_name_scan}_scan.json")

log(f"Scanning ",line, flush=True)

Expand Down Expand Up @@ -190,7 +190,7 @@ def extract_images(version):
severity_counts["MEDIUM"],
severity_counts["LOW"]
])
log(image_table , flush=True)
log(f"{image_table}\n")

severity_report_file = os.path.join(severity_count, f"{image_name_scan}_severity_report.json")
with open(severity_report_file, 'w') as report_file:
Expand Down Expand Up @@ -331,5 +331,5 @@ def extract_images(version):
f.write(str(table))

log("Output saved to:", output_file, flush=True)
log("Severirty counts with images respect to WGs are saved in the" ,ALL_SEVERITY_COUNTS, flush=True)
log("Severity counts with images respect to WGs are saved in the",ALL_SEVERITY_COUNTS, flush=True)
log("Scanned Json reports on images are saved in" ,SCAN_REPORTS_DIR, flush=True)

0 comments on commit bc7a2e6

Please sign in to comment.