feat(PackageURL):add package URL for library scan result (#1862)

* add: package url in model.Library

* feat(trivy-to-vuls): add purl for library scan result

* feat(scanner/library): add purl for lockfile scan result

* fix: model.Library test

* fix: trivy-to-vuls test data

* fix: panic case to generate purl

* fix: add blank line

* fix: trivy-to-vuls for using Trivy version 0.49.0 or earlier

* fix: remove comment

* fix: remove print

* fix: testcase for Package.Identifier does not exist version

* fix: add blank line

* fix: expected libs

* fix: PackageURL -> PURL

* fix: blank line
This commit is contained in:
tk007
2024-03-06 23:21:15 -08:00
committed by GitHub
parent bf14b5f61f
commit be7b9114cc
5 changed files with 67 additions and 4 deletions

View File

@@ -42,6 +42,7 @@ type LibraryScanner struct {
type Library struct {
Name string
Version string
PURL string
// The Path to the library in the container image. Empty string when Lockfile scan.
// This field is used to convert the result JSON of a `trivy image` using trivy-to-vuls.