Gitlab unable to parse json report (gitlab template) when url is an empty string #6347
Closed
2 tasks done
Labels
kind/bug
Categorizes issue or PR as related to a bug.
Discussed in #6345
Originally posted by behemoth-il March 19, 2024
Description
I've originally opened a report to Gitlab (suggested fix?), but they've passed the ball to Trivy maintainers, to handle avoiding empty strings as url value.
So if the report has an empty string at
.vulnerabilities[].identifiers[].url
, Gitlab's validation process will fail the parsing, and a report won't be shown in Gitlab's security dashboard.Faulty sections in the templated json:
Gitlab Security Dashboard:
JSONs:
gl-container-scanning-report.json
generic-result.json
Desired Behavior
Gitlab's json template should not have urls with empty strings in them.
Actual Behavior
When the original report (generic json) doesn't have Referances, the output from the template will have empty sting in the url value of
.vulnerabilities[].identifiers[].url
, cause Gitlab parse to fail and not show a report.Reproduction Steps
Operating System
Linux Debian 12
Version
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: