-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(vuln): GitLab report template #2578
fix(vuln): GitLab report template #2578
Conversation
contrib/gitlab.tpl
Outdated
"vulnerabilities": [ | ||
{{- $t_first := true }} | ||
{{- range . }} | ||
{{- $target := .Target }} | ||
{{ $image := $target | regexFind "^[^:\\s]+" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the OS from the image.
While version 14.0.6
of the schema doesn't enforce the format, version 14.1.x
and later versions do. So I opted for using the string up to a space; e.g. webgoat/webgoat-8.0:latest (debian 9.6)
becomes webgoat/webgoat-8.0:latest
.
See also #332.
5739bcd
to
f822298
Compare
contrib/gitlab.tpl
Outdated
"vulnerabilities": [ | ||
{{- $t_first := true }} | ||
{{- range . }} | ||
{{- $target := .Target }} | ||
{{ $image := $target | regexFind "[^\\s]+" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly a valid docker image string either, but 14.0.6
doesn't validate the pattern, so we can be less strict here.
f822298
to
b5abd31
Compare
@knqyf263, there's an integration test failing. Unfortunately it doesn't show me a diff of what it's expecting, and I'm not sure this can be run locally. Do you have a suggestion?
|
The failing test shows the following diff.
Looks like there is a new line, but I didn't see such a change. @DmitriyLewen Could you help us? |
- Upgrade to schema 14.0.6 (https://gitlab.com/gitlab-org/security-products/security-report-schemas/-/blob/v14.0.6/dist/container-scanning-report-format.json). - Drop unsupported `confidence` property. Currently optional and will be removed by GitLab in schema 15-0-0.
b5abd31
to
cd754ca
Compare
Thanks for the help, @knqyf263 and @DmitriyLewen. Checks are passing. Ready for another round of review 🏓 |
Thanks a lot! |
Description
confidence
property. Currently optional and will be removed by GitLab in schema 15-0-0.I've generated a test report using:
And I've validated locally:
The errors above are because:
url
"https://gitlab.freedesktop.org/dbus/dbus/-/commit/2b7948ef907669e844b52c4fa2268d6e3162a70c (dbus-1.13.18)"
.These invalid entries display as errors in the GitLab pipeline security tab, and are ignored when ingesting the data for vulnerability reports.
Finally, I was going to add a
scan
section, since this will be required soon. Unfortunately my Golang is lacking, and I can't seem to find an existing variable that I can use in the template to output the Trivy version. E.g.:Related issues
Related PRs
Checklist