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:
Jonas Xavier
2022-05-23 10:39:34 -07:00
committed by GitHub
parent d41afe05eb
commit c990f425a6
3 changed files with 21 additions and 2 deletions
+3 -1
View File
@@ -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