Skip to content

Commit

Permalink
fix(cyclonedx): set original names for packages (#4306)
Browse files Browse the repository at this point in the history
  • Loading branch information
afdesk authored May 23, 2023
1 parent 0ef0dad commit 3f0721f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sbom/cyclonedx/unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ func toPackage(component cdx.Component) (bool, string, *ftypes.Package, error) {
}

pkg := p.Package()
// Trivy's marshall loses case-sensitivity in PURL used in SBOM for packages (Go, Npm, PyPI),
// so we have to use an original package name
pkg.Name = component.Name
pkg.Ref = component.BOMRef

for _, license := range lo.FromPtr(component.Licenses) {
Expand Down

0 comments on commit 3f0721f

Please sign in to comment.