Skip to content

Commit b170501

Browse files
committed
feat(pkg/sbom/cpe.go): Add exception for gitlab-operator to avoid matching as gitlab-* package and gitlab product
Not all gitlab-* packages should be treated as GitLab, but most of them are - as seen in ``` if strings.HasPrefix(name, "gitlab-") { attr.Vendor = "gitlab" attr.Product = "gitlab" attr.SWEdition = "community" return &attr } ``` Added in 1c050aa One notable exception is gitlab-operator, which is a Kubernetes operator for managing GitLab installations, and not part of GitLab itself with source @ https://gitlab.com/gitlab-org/cloud-native/gitlab-operator Adding an explicit exception for this package to not match on `gitlab-*` The reason for this change is because new gitlab-operator package was being matched with all older gitlab CVEs which is incorrect. Signed-off-by: philroche <[email protected]>
1 parent cb5fcdc commit b170501

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/sbom/cpe.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ func generateWfnAttributesForAPK(p pkgInfo) *wfn.Attributes {
5454
return &attr
5555
}
5656

57-
if strings.HasPrefix(name, "gitlab-") {
57+
// Not all gitlab-* packages should be treated as GitLab, but most of them are.
58+
// One notable exception is gitlab-operator, which is a Kubernetes operator
59+
// for managing GitLab installations, and not part of GitLab itself.
60+
// Source @ https://gitlab.com/gitlab-org/cloud-native/gitlab-operator
61+
// Adding an explicit exception for this package here.
62+
// If more exceptions are found, we might need a more robust way to handle them.
63+
if strings.HasPrefix(name, "gitlab-") && name != "gitlab-operator" {
5864
attr.Vendor = "gitlab"
5965
attr.Product = "gitlab"
6066
attr.SWEdition = "community"

0 commit comments

Comments
 (0)