Skip to content

Commit

Permalink
fix: use official CPE for linux kernel
Browse files Browse the repository at this point in the history
Signed-off-by: Weston Steimel <commits@weston.slmail.me>
  • Loading branch information
westonsteimel committed Oct 17, 2024
1 parent 80c8bc1 commit 833bc94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions syft/pkg/cataloger/kernel/cataloger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/anchore/syft/syft/artifact"
"github.com/anchore/syft/syft/cpe"
"github.com/anchore/syft/syft/file"
"github.com/anchore/syft/syft/pkg"
"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
Expand All @@ -22,6 +23,7 @@ func Test_KernelCataloger(t *testing.T) {
),
Type: pkg.LinuxKernelPkg,
PURL: "pkg:generic/linux-kernel@6.0.7-301.fc37.x86_64",
CPEs: []cpe.CPE{cpe.Must("cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource)},
Metadata: pkg.LinuxKernel{
Name: "",
Architecture: "x86",
Expand Down
2 changes: 2 additions & 0 deletions syft/pkg/cataloger/kernel/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"strings"

"github.com/anchore/packageurl-go"
"github.com/anchore/syft/syft/cpe"
"github.com/anchore/syft/syft/file"
"github.com/anchore/syft/syft/pkg"
)
Expand All @@ -18,6 +19,7 @@ func newLinuxKernelPackage(metadata pkg.LinuxKernel, archiveLocation file.Locati
PURL: packageURL(linuxKernelPackageName, metadata.Version),
Type: pkg.LinuxKernelPkg,
Metadata: metadata,
CPEs: []cpe.CPE{cpe.Must("cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource)},
}

p.SetID()
Expand Down

0 comments on commit 833bc94

Please sign in to comment.