mirror of
https://github.com/anchore/syft.git
synced 2026-11-27 06:04:09 +01:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee70b5d714 | ||
|
|
5ec416cb24 |
@@ -22,7 +22,7 @@ require (
|
||||
github.com/anchore/go-sync v0.1.2
|
||||
github.com/anchore/go-version v1.2.2-0.20200701162849-18adb9c92b9b
|
||||
github.com/anchore/packageurl-go v0.2.0
|
||||
github.com/anchore/stereoscope v0.4.0
|
||||
github.com/anchore/stereoscope v0.4.1-0.20261103134938-3923a1d71f2e
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be
|
||||
github.com/aquasecurity/go-pep440-version v0.0.1
|
||||
github.com/bitnami/go-version v0.0.0-20250131085805-b1f57a8634ef
|
||||
|
||||
@@ -150,8 +150,8 @@ github.com/anchore/go-version v1.2.2-0.20200701162849-18adb9c92b9b h1:e1bmaoJfZV
|
||||
github.com/anchore/go-version v1.2.2-0.20200701162849-18adb9c92b9b/go.mod h1:Bkc+JYWjMCF8OyZ340IMSIi2Ebf3uwByOk6ho4wne1E=
|
||||
github.com/anchore/packageurl-go v0.2.0 h1:CkrM4RMUwrEGAiE1OVlxaZNzWj0TuHRey7o4T/EAErk=
|
||||
github.com/anchore/packageurl-go v0.2.0/go.mod h1:2JCgOQMIsqZ7TmliXG4PnUthPJAKE3mWQbsW2XHjAOE=
|
||||
github.com/anchore/stereoscope v0.4.0 h1:MDL7YFRDaGzhCdjm/s+em1D/X9HwnZMYupfgg+mvqPI=
|
||||
github.com/anchore/stereoscope v0.4.0/go.mod h1:hYJsi3M8a8N1O66u+rMQSgv5TREGM7QIjKBjPPnwiD8=
|
||||
github.com/anchore/stereoscope v0.4.1-0.20261103134938-3923a1d71f2e h1:5I/3QbnhqciUj2NOAMJTfzyyqR/e/JPtdNdhrPu5gEs=
|
||||
github.com/anchore/stereoscope v0.4.1-0.20261103134938-3923a1d71f2e/go.mod h1:hYJsi3M8a8N1O66u+rMQSgv5TREGM7QIjKBjPPnwiD8=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
||||
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
|
||||
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
|
||||
@@ -141,9 +141,16 @@ func FromDictionaryFind(p pkg.Package) ([]cpe.CPE, bool) {
|
||||
// generate the minimal set of representative CPEs, which implies that optional fields should not be included
|
||||
// (such as target SW).
|
||||
func FromPackageAttributes(p pkg.Package) []cpe.CPE {
|
||||
// ML models should not have CPEs as they are not traditional software packages
|
||||
// and don't fit the vulnerability model used for software packages.
|
||||
if p.Type == pkg.ModelPkg {
|
||||
switch p.Type {
|
||||
case pkg.KbPkg:
|
||||
// Microsoft KB packages are patches, not products: the name is an MSRC product ID and the
|
||||
// version a KB number, neither of which maps onto a CPE vendor, product or version. They are
|
||||
// matched against MSRC data by name and version, so a generated CPE is only noise, and one
|
||||
// that NVD-based matching could misread.
|
||||
return nil
|
||||
case pkg.ModelPkg:
|
||||
// ML models should not have CPEs as they are not traditional software packages
|
||||
// and don't fit the vulnerability model used for software packages.
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -892,6 +892,16 @@ func TestGeneratePackageCPEs(t *testing.T) {
|
||||
},
|
||||
expected: []string{},
|
||||
},
|
||||
{
|
||||
name: "Microsoft KB package should generate no CPEs",
|
||||
p: pkg.Package{
|
||||
Name: "12437",
|
||||
Version: "935509",
|
||||
Type: pkg.KbPkg,
|
||||
Metadata: pkg.MicrosoftKbPatch{ProductID: "12437", Kb: "935509"},
|
||||
},
|
||||
expected: []string{},
|
||||
},
|
||||
{
|
||||
name: "rust package",
|
||||
p: pkg.Package{
|
||||
|
||||
Reference in New Issue
Block a user