mirror of
https://github.com/anchore/syft.git
synced 2026-11-04 08:26:38 +01:00
Longer CPEs for golang modules to avoid false positives (#1006)
* golang module CPE with full path Signed-off-by: Jonas Xavier <jonasx@anchore.com> * add note on longer Golang CPEs Signed-off-by: Jonas Xavier <jonasx@anchore.com>
This commit is contained in:
@@ -28,7 +28,9 @@ func candidateProductForGo(name string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
return pathElements[1]
|
||||
// returning the rest of the path here means longer CPEs, it helps avoiding false-positives
|
||||
// ref: https://github.com/anchore/grype/issues/676
|
||||
return strings.Join(pathElements[1:], "/")
|
||||
}
|
||||
|
||||
// candidateVendorForGo attempts to find a single vendor name in a best-effort attempt. This implementation prefers
|
||||
|
||||
Reference in New Issue
Block a user