mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 15:06:36 +01:00
fix:allow golang tip image detection regex pattern (#3757)
* Modify the Regex version matcher for golang in the binary classifiers to make it compatible with golang tip images Signed-off-by: Victor Hu <victorhu493@gmail.com> Signed-off-by: Yuntao Hu <victorhu493@gmail.com> * Preliminary fix the regex matching for golang tip image and add the corresponding unit tests Signed-off-by: Yuntao Hu <victorhu493@gmail.com> * consider VERSION.cache when it comes to golang tip images Signed-off-by: Yuntao Hu <victorhu493@gmail.com> * consider VERSION.cache when it comes to golang tip images Signed-off-by: Yuntao Hu <victorhu493@gmail.com> --------- Signed-off-by: Victor Hu <victorhu493@gmail.com> Signed-off-by: Yuntao Hu <victorhu493@gmail.com>
This commit is contained in:
@@ -171,9 +171,9 @@ func DefaultClassifiers() []Classifier {
|
||||
},
|
||||
{
|
||||
Class: "go-binary-hint",
|
||||
FileGlob: "**/VERSION",
|
||||
FileGlob: "**/VERSION*",
|
||||
EvidenceMatcher: FileContentsVersionMatcher(
|
||||
`(?m)go(?P<version>[0-9]+\.[0-9]+(\.[0-9]+|beta[0-9]+|alpha[0-9]+|rc[0-9]+)?)`),
|
||||
`(?m)go(?P<version>[0-9]+\.[0-9]+(\.[0-9]+|beta[0-9]+|alpha[0-9]+|rc[0-9]+)?(-[0-9a-f]{7})?)`),
|
||||
Package: "go",
|
||||
PURL: mustPURL("pkg:generic/go@version"),
|
||||
CPEs: singleCPE("cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
|
||||
|
||||
Reference in New Issue
Block a user