mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
Support detection of Chrome binaries (#3136)
* test: add test cases Signed-off-by: Stijn Taelemans <taelemansst@gmail.com> * feat: add classifier for chrome Signed-off-by: Stijn Taelemans <taelemansst@gmail.com> --------- Signed-off-by: Stijn Taelemans <taelemansst@gmail.com>
This commit is contained in:
parent
ab570497b0
commit
df11561929
@ -1342,6 +1342,28 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
|
|||||||
Metadata: metadata("jq-binary"),
|
Metadata: metadata("jq-binary"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
logicalFixture: "chrome/126.0.6478.182/linux-amd64",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "chrome",
|
||||||
|
Version: "126.0.6478.182",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/chrome@126.0.6478.182",
|
||||||
|
Locations: locations("chrome"),
|
||||||
|
Metadata: metadata("chrome-binary"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
logicalFixture: "chrome/127.0.6533.119/linux-amd64",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "chrome",
|
||||||
|
Version: "127.0.6533.119",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/chrome@127.0.6533.119",
|
||||||
|
Locations: locations("chrome"),
|
||||||
|
Metadata: metadata("chrome-binary"),
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
@ -670,6 +670,17 @@ func DefaultClassifiers() []Classifier {
|
|||||||
PURL: mustPURL("pkg:generic/jq@version"),
|
PURL: mustPURL("pkg:generic/jq@version"),
|
||||||
CPEs: singleCPE("cpe:2.3:a:jqlang:jq:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
|
CPEs: singleCPE("cpe:2.3:a:jqlang:jq:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Class: "chrome-binary",
|
||||||
|
FileGlob: "**/chrome",
|
||||||
|
EvidenceMatcher: FileContentsVersionMatcher(
|
||||||
|
// [NUL]127.0.6533.119[NUL]Default
|
||||||
|
`\x00(?P<version>[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\x00Default`,
|
||||||
|
),
|
||||||
|
Package: "chrome",
|
||||||
|
PURL: mustPURL("pkg:generic/chrome@version"),
|
||||||
|
CPEs: singleCPE("cpe:2.3:a:google:chrome:*:*:*:*:*:*:*:*"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user