From bf39456fbcf9105895cfabcc445f8c313e9aa01b Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Thu, 4 Jan 2024 14:51:56 -0500 Subject: [PATCH] fix: add missing purl for busybox (#2457) Signed-off-by: Laurent Goderre --- syft/pkg/cataloger/binary/cataloger_test.go | 2 ++ syft/pkg/cataloger/binary/default_classifiers.go | 1 + 2 files changed, 3 insertions(+) diff --git a/syft/pkg/cataloger/binary/cataloger_test.go b/syft/pkg/cataloger/binary/cataloger_test.go index d03b18191..a953f9e22 100644 --- a/syft/pkg/cataloger/binary/cataloger_test.go +++ b/syft/pkg/cataloger/binary/cataloger_test.go @@ -540,6 +540,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { expected: pkg.Package{ Name: "busybox", Version: "3.33.3", + PURL: "pkg:generic/busybox@3.33.3", Locations: locations("["), // note: busybox is a link to [ Metadata: metadata("busybox-binary", "[", "busybox"), }, @@ -809,6 +810,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases_Image(t *testing.T) { expected: pkg.Package{ Name: "busybox", Version: "1.35.0", + PURL: "pkg:generic/busybox@1.35.0", Locations: locations("/bin/["), Metadata: metadata("busybox-binary", "/bin/[", "/bin/busybox"), }, diff --git a/syft/pkg/cataloger/binary/default_classifiers.go b/syft/pkg/cataloger/binary/default_classifiers.go index 95376052f..d23444dce 100644 --- a/syft/pkg/cataloger/binary/default_classifiers.go +++ b/syft/pkg/cataloger/binary/default_classifiers.go @@ -131,6 +131,7 @@ var defaultClassifiers = []classifier{ EvidenceMatcher: fileContentsVersionMatcher( `(?m)BusyBox\s+v(?P[0-9]+\.[0-9]+\.[0-9]+)`), Package: "busybox", + PURL: mustPURL("pkg:generic/busybox@version"), CPEs: singleCPE("cpe:2.3:a:busybox:busybox:*:*:*:*:*:*:*:*"), }, {