Getting scan results in JSON or HTML format
When using Kaspersky Container Security to scan images in CI/CD, you can generate and save an artifact with the scan results within your CI/CD platform. This can be done using a configuration file of the external repository system that is integrated with the solution. For example, you can use a .gitlab-ci.yml configuration file in GitLab.
You can generate an artifact containing scan results in the following scenarios:
- When the scanner conducts a complete CI/CD scan - scanning results file can be generated in the .HTML format or the .JSON format.
- When the scanner operates with SBOM creation - file containing scanning results can be generated in the .SPDX format or the .JSON format.
To generate a scan results file in .HTML format:
Enter the following command in the .gitlab-ci.yml configuration file:
- /bin/sh /entrypoint.sh $SCAN_TARGET --html --stdout > example.html
where:
<--html>
indicates that an artifact is generated in .HTML format.
<--stdout > example.html>
indicates data output to a file in .HTML format.
To generate a scan results file in .JSON format when performing a complete CI/CD scan:
Enter the following command in the .gitlab-ci.yml configuration file:
- /bin/sh /entrypoint.sh $SCAN_TARGET --stdout > example.json
where:
<--stdout > example.json>
indicates data output to a file in .JSON format.
The resulting file (for example, example.json) is specified as an artifact: artifacts: paths: