aws-actions / vulnerability-scan-github-action-for-amazon-inspector

Scan artifacts with Amazon Inspector from GitHub Actions workflows.
https://docs.aws.amazon.com/inspector/
MIT License
25 stars 6 forks source link

Add CSV output #6

Closed bluesentinelsec closed 7 months ago

bluesentinelsec commented 7 months ago

Before this change, we provided Inspector scan results in JSON only.

After this change, we provide Inspector scan results in CSV.

The CSV output will resemble the following:

"#artifact_name:debian:9","artifact_type:container","artifact_hash:null","build_id:null"
"#critical_vulnerabilities:7","high_vulnerabilities:9","medium_vulnerabilities:7","low_vulnerabilities:2","other_vulnerabilities:0"
"Vulnerability ID","Severity","Published","Modified","Description","Package Installed Version","Package Fixed Version","Package Path","EPSS Score","Exploit Available","Exploit Last Seen","CWEs"
"CVE-2020-1751","high","2020-04-17T19:15:14Z","2023-11-07T03:19:33Z","An out-of-bounds write vulnerability was found in glibc before 2.31 when handling signal trampolines on PowerPC. Specifically, the backtrace function did not properly check the array bounds when storing the frame address, resulting in a denial of service or potential code execution. The highest threat from this vulnerability is to system availability.","pkg:deb/debian/glibc@2.24-11+deb9u4?arch=amd64&distro=stretch&epoch=0","null","null","0.00045","null","null","CWE-787"
image

This change was tested against 18 Inspector scan files found in entrypoint/tests/test_data/scans.

cd entrypoint; python3 -m unittest discover -v -s ./
test_json_to_csv (tests.test_csv.TestCSV.test_json_to_csv) ... ok