From 3db2d58910e2e5c757166a2d916b20f6d88e3df6 Mon Sep 17 00:00:00 2001 From: y12studio Date: Fri, 10 Mar 2023 15:13:14 +0800 Subject: [PATCH 1/4] add argocd, helm, kustomize and kubectl binary classifiers Signed-off-by: y12studio --- syft/pkg/cataloger/binary/cataloger_test.go | 108 ++++++++++++++++++ .../cataloger/binary/default_classifiers.go | 36 ++++++ .../positive/argocd-2.5.11/README.md | 39 +++++++ .../classifiers/positive/argocd-2.5.11/argocd | 3 + .../classifiers/positive/argocd-2.6.4/argocd | 3 + .../classifiers/positive/helm-2.16.10/helm | 1 + .../classifiers/positive/helm-3.10.3/helm | 1 + .../positive/kubectl-1.24.11/kubectl | 4 + .../positive/kubectl-1.25.7/kubectl | 4 + .../positive/kubectl-1.26.2/kubectl | 4 + .../positive/kustomize-4.5.7/kustomize | 3 + .../positive/kustomize-5.0.0/kustomize | 3 + 12 files changed, 209 insertions(+) create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/README.md create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/argocd create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.6.4/argocd create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-2.16.10/helm create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-3.10.3/helm create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.24.11/kubectl create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.25.7/kubectl create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.26.2/kubectl create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-4.5.7/kustomize create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-5.0.0/kustomize diff --git a/syft/pkg/cataloger/binary/cataloger_test.go b/syft/pkg/cataloger/binary/cataloger_test.go index 3270f5d2f35..9b63f9a5a3c 100644 --- a/syft/pkg/cataloger/binary/cataloger_test.go +++ b/syft/pkg/cataloger/binary/cataloger_test.go @@ -239,6 +239,114 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Metadata: metadata("redis-binary"), }, }, + { + name: "positive-argocd-2.5.11", + fixtureDir: "test-fixtures/classifiers/positive/argocd-2.5.11", + expected: pkg.Package{ + Name: "argocd", + Version: "2.5.11", + Type: "binary", + PURL: "pkg:golang/argocd@2.5.11", + Locations: locations("argocd"), + Metadata: metadata("argocd"), + }, + }, + { + name: "positive-argocd-2.6.4", + fixtureDir: "test-fixtures/classifiers/positive/argocd-2.6.4", + expected: pkg.Package{ + Name: "argocd", + Version: "2.6.4", + Type: "binary", + PURL: "pkg:golang/argocd@2.6.4", + Locations: locations("argocd"), + Metadata: metadata("argocd"), + }, + }, + { + name: "positive-helm-2.16.10", + fixtureDir: "test-fixtures/classifiers/positive/helm-2.16.10", + expected: pkg.Package{ + Name: "helm", + Version: "2.16.10", + Type: "binary", + PURL: "pkg:golang/helm@2.16.10", + Locations: locations("helm"), + Metadata: metadata("helm"), + }, + }, + { + name: "positive-helm-3.10.3", + fixtureDir: "test-fixtures/classifiers/positive/helm-3.10.3", + expected: pkg.Package{ + Name: "helm", + Version: "3.10.3", + Type: "binary", + PURL: "pkg:golang/helm@3.10.3", + Locations: locations("helm"), + Metadata: metadata("helm"), + }, + }, + { + name: "positive-kubectl-1.24.11", + fixtureDir: "test-fixtures/classifiers/positive/kubectl-1.24.11", + expected: pkg.Package{ + Name: "kubectl", + Version: "1.24.11", + Type: "binary", + PURL: "pkg:golang/kubectl@1.24.11", + Locations: locations("kubectl"), + Metadata: metadata("kubectl"), + }, + }, + { + name: "positive-kubectl-1.25.7", + fixtureDir: "test-fixtures/classifiers/positive/kubectl-1.25.7", + expected: pkg.Package{ + Name: "kubectl", + Version: "1.25.7", + Type: "binary", + PURL: "pkg:golang/kubectl@1.25.7", + Locations: locations("kubectl"), + Metadata: metadata("kubectl"), + }, + }, + { + name: "positive-kubectl-1.26.2", + fixtureDir: "test-fixtures/classifiers/positive/kubectl-1.26.2", + expected: pkg.Package{ + Name: "kubectl", + Version: "1.26.2", + Type: "binary", + PURL: "pkg:golang/kubectl@1.26.2", + Locations: locations("kubectl"), + Metadata: metadata("kubectl"), + }, + }, + { + name: "positive-kustomize-4.5.7", + fixtureDir: "test-fixtures/classifiers/positive/kustomize-4.5.7", + expected: pkg.Package{ + Name: "kustomize", + Version: "4.5.7", + Type: "binary", + PURL: "pkg:golang/kustomize@4.5.7", + Locations: locations("kustomize"), + Metadata: metadata("kustomize"), + }, + }, + { + name: "positive-kustomize-5.0.0", + fixtureDir: "test-fixtures/classifiers/positive/kustomize-5.0.0", + expected: pkg.Package{ + Name: "kustomize", + Version: "5.0.0", + Type: "binary", + PURL: "pkg:golang/kustomize@5.0.0", + Locations: locations("kustomize"), + Metadata: metadata("kustomize"), + }, + }, { name: "positive-redis-4.0.11", fixtureDir: "test-fixtures/classifiers/positive/redis-server-4.0.11", diff --git a/syft/pkg/cataloger/binary/default_classifiers.go b/syft/pkg/cataloger/binary/default_classifiers.go index 01c707eeb6f..7d1851ae470 100644 --- a/syft/pkg/cataloger/binary/default_classifiers.go +++ b/syft/pkg/cataloger/binary/default_classifiers.go @@ -46,6 +46,42 @@ var defaultClassifiers = []classifier{ PURL: mustPURL("pkg:generic/go@version"), CPEs: singleCPE("cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*"), }, + { + Class: "argocd", + FileGlob: "**/argocd", + EvidenceMatcher: fileContentsVersionMatcher( + `(?m)common\.version=(?P[0-9]+\.[0-9]+\.[0-9]+)`), + Package: "argocd", + PURL: mustPURL("pkg:golang/argocd@version"), + CPEs: singleCPE("cpe:2.3:a:argoproj:argocd:*:*:*:*:*:*:*"), + }, + { + Class: "helm", + FileGlob: "**/helm", + EvidenceMatcher: fileContentsVersionMatcher( + `(?m)\x00v(?P[0-9]+\.[0-9]+\.[0-9]+)\x00`), + Package: "helm", + PURL: mustPURL("pkg:golang/helm@version"), + CPEs: singleCPE("cpe:2.3:a:helm:helm:*:*:*:*:*:*:*"), + }, + { + Class: "kustomize", + FileGlob: "**/kustomize", + EvidenceMatcher: fileContentsVersionMatcher( + `(?m)version=kustomize/v(?P[0-9]+\.[0-9]+\.[0-9]+)`), + Package: "kustomize", + PURL: mustPURL("pkg:golang/kustomize@version"), + CPEs: singleCPE("cpe:2.3:a:kustomize:kustomize:*:*:*:*:*:*:*"), + }, + { + Class: "kubectl", + FileGlob: "**/kubectl", + EvidenceMatcher: fileContentsVersionMatcher( + `(?m)\x00v(?P[0-9]+\.[0-9]+\.[0-9]+)\x00`), + Package: "kubectl", + PURL: mustPURL("pkg:golang/kubectl@version"), + CPEs: singleCPE("cpe:2.3:a:kubectl:kubectl:*:*:*:*:*:*:*"), + }, { Class: "redis-binary", FileGlob: "**/redis-server", diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/README.md b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/README.md new file mode 100644 index 00000000000..b1843feab18 --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/README.md @@ -0,0 +1,39 @@ +test-fixtures for https://github.com/anchore/syft/issues/1606 + +```sh +DEV_IMG=devalpine:3.17 + +docker build -t ${DEV_IMG} - < /tmp/$1/$3 +} +strings_save argocd-2.5.11 '2\.5\.11' argocd +strings_save argocd-2.6.4 '2\.6\.4' argocd +strings_save helm-2.16.10 '2\.16\.10' helm +strings_save helm-3.10.3 '3\.10\.3' helm +strings_save kustomize-4.5.7 '4\.5\.7' kustomize +strings_save kustomize-5.0.0 '5\.0\.0' kustomize +strings_save kubectl-1.24.11 '1\.24\.11' kubectl +strings_save kubectl-1.25.7 '1\.25\.7' kubectl +strings_save kubectl-1.26.2 '1\.26\.2' kubectl +EOF + +echo tmp dir: $TEMP_DIR +ls -lah $TEMP_DIR +``` \ No newline at end of file diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/argocd b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/argocd new file mode 100644 index 00000000000..afbf80be1e3 --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/argocd @@ -0,0 +1,3 @@ +2.5.11 +build -ldflags="-X github.com/argoproj/argo-cd/v2/common.version=2.5.11 -X github.com/argoproj/argo-cd/v2/common.buildDate=2023-02-16T15:06:40Z -X github.com/argoproj/argo-cd/v2/common.gitCommit=6dd79895e248cc0980bcaf6c6bafdc9afbbf80cb -X github.com/argoproj/argo-cd/v2/common.gitTreeState=clean -X github.com/argoproj/argo-cd/v2/common.kubectlVersion=v0.24.2 -extldflags \"-static\"" +build -ldflags="-X github.com/argoproj/argo-cd/v2/common.version=2.5.11 -X github.com/argoproj/argo-cd/v2/common.buildDate=2023-02-16T15:06:40Z -X github.com/argoproj/argo-cd/v2/common.gitCommit=6dd79895e248cc0980bcaf6c6bafdc9afbbf80cb -X github.com/argoproj/argo-cd/v2/common.gitTreeState=clean -X github.com/argoproj/argo-cd/v2/common.kubectlVersion=v0.24.2 -extldflags \"-static\"" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.6.4/argocd b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.6.4/argocd new file mode 100644 index 00000000000..330dab901a1 --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.6.4/argocd @@ -0,0 +1,3 @@ +2.6.4 +build -ldflags="-X github.com/argoproj/argo-cd/v2/common.version=2.6.4 -X github.com/argoproj/argo-cd/v2/common.buildDate=2023-03-07T22:48:16Z -X github.com/argoproj/argo-cd/v2/common.gitCommit=7be094f38d06859b594b98eb75c7c70d39b80b1e -X github.com/argoproj/argo-cd/v2/common.gitTreeState=clean -X github.com/argoproj/argo-cd/v2/common.kubectlVersion=v0.24.2 -extldflags \"-static\"" +build -ldflags="-X github.com/argoproj/argo-cd/v2/common.version=2.6.4 -X github.com/argoproj/argo-cd/v2/common.buildDate=2023-03-07T22:48:16Z -X github.com/argoproj/argo-cd/v2/common.gitCommit=7be094f38d06859b594b98eb75c7c70d39b80b1e -X github.com/argoproj/argo-cd/v2/common.gitTreeState=clean -X github.com/argoproj/argo-cd/v2/common.kubectlVersion=v0.24.2 -extldflags \"-static\"" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-2.16.10/helm b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-2.16.10/helm new file mode 100644 index 00000000000..18f22918a9d --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-2.16.10/helm @@ -0,0 +1 @@ +v2.16.10 diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-3.10.3/helm b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-3.10.3/helm new file mode 100644 index 00000000000..5515cfcc85f --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-3.10.3/helm @@ -0,0 +1 @@ +v3.10.3 diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.24.11/kubectl b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.24.11/kubectl new file mode 100644 index 00000000000..9a7a10c5015 --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.24.11/kubectl @@ -0,0 +1,4 @@ +v1.24.11 +v1.24.11 +build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/client-go/pkg/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/component-base/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.24.11' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.24.11' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.24.11' -X 'k8s.io/component-base/version.gitVersion=v1.24.11' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=24' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=24' -X 'k8s.io/client-go/pkg/version.gitMinor=24' -X 'k8s.io/component-base/version.gitMinor=24' -s -w" +build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/client-go/pkg/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/component-base/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.24.11' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.24.11' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.24.11' -X 'k8s.io/component-base/version.gitVersion=v1.24.11' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=24' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=24' -X 'k8s.io/client-go/pkg/version.gitMinor=24' -X 'k8s.io/component-base/version.gitMinor=24' -s -w" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.25.7/kubectl b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.25.7/kubectl new file mode 100644 index 00000000000..18e5f65f6d7 --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.25.7/kubectl @@ -0,0 +1,4 @@ +v1.25.7 +v1.25.7 +build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/client-go/pkg/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/component-base/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.25.7' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.25.7' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.25.7' -X 'k8s.io/component-base/version.gitVersion=v1.25.7' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=25' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=25' -X 'k8s.io/client-go/pkg/version.gitMinor=25' -X 'k8s.io/component-base/version.gitMinor=25' -s -w" +build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/client-go/pkg/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/component-base/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.25.7' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.25.7' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.25.7' -X 'k8s.io/component-base/version.gitVersion=v1.25.7' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=25' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=25' -X 'k8s.io/client-go/pkg/version.gitMinor=25' -X 'k8s.io/component-base/version.gitMinor=25' -s -w" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.26.2/kubectl b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.26.2/kubectl new file mode 100644 index 00000000000..269d7f46cfb --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.26.2/kubectl @@ -0,0 +1,4 @@ +v1.26.2 +v1.26.2 +build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/client-go/pkg/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/component-base/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.26.2' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.26.2' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.26.2' -X 'k8s.io/component-base/version.gitVersion=v1.26.2' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=26' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=26' -X 'k8s.io/client-go/pkg/version.gitMinor=26' -X 'k8s.io/component-base/version.gitMinor=26' -s -w" +build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/client-go/pkg/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/component-base/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.26.2' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.26.2' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.26.2' -X 'k8s.io/component-base/version.gitVersion=v1.26.2' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=26' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=26' -X 'k8s.io/client-go/pkg/version.gitMinor=26' -X 'k8s.io/component-base/version.gitMinor=26' -s -w" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-4.5.7/kustomize b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-4.5.7/kustomize new file mode 100644 index 00000000000..018a7f58904 --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-4.5.7/kustomize @@ -0,0 +1,3 @@ +kustomize/v4.5.7 +build -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=kustomize/v4.5.7 -X sigs.k8s.io/kustomize/api/provenance.gitCommit=56d82a8378dfc8dc3b3b1085e5a6e67b82966bd7 -X sigs.k8s.io/kustomize/api/provenance.buildDate=2022-08-02T16:35:54Z " +build -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=kustomize/v4.5.7 -X sigs.k8s.io/kustomize/api/provenance.gitCommit=56d82a8378dfc8dc3b3b1085e5a6e67b82966bd7 -X sigs.k8s.io/kustomize/api/provenance.buildDate=2022-08-02T16:35:54Z " diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-5.0.0/kustomize b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-5.0.0/kustomize new file mode 100644 index 00000000000..ae7237d06a0 --- /dev/null +++ b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-5.0.0/kustomize @@ -0,0 +1,3 @@ +kustomize/v5.0.0 +build -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=kustomize/v5.0.0 -X sigs.k8s.io/kustomize/api/provenance.buildDate=2023-02-02T16:43:10Z " +build -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=kustomize/v5.0.0 -X sigs.k8s.io/kustomize/api/provenance.buildDate=2023-02-02T16:43:10Z " From c15960ff5ec90977eedcc9174bb5c4415bfd09d9 Mon Sep 17 00:00:00 2001 From: y12studio Date: Sat, 11 Mar 2023 09:12:42 +0800 Subject: [PATCH 2/4] update golang PURL Signed-off-by: y12studio --- syft/pkg/cataloger/binary/cataloger_test.go | 18 +++++++++--------- .../cataloger/binary/default_classifiers.go | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/syft/pkg/cataloger/binary/cataloger_test.go b/syft/pkg/cataloger/binary/cataloger_test.go index 18d7a11cb0e..71126a095d2 100644 --- a/syft/pkg/cataloger/binary/cataloger_test.go +++ b/syft/pkg/cataloger/binary/cataloger_test.go @@ -246,7 +246,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "argocd", Version: "2.5.11", Type: "binary", - PURL: "pkg:golang/argocd@2.5.11", + PURL: "pkg:golang/github.com/argoproj/argo-cd/v2@2.5.11", Locations: locations("argocd"), Metadata: metadata("argocd"), }, @@ -258,7 +258,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "argocd", Version: "2.6.4", Type: "binary", - PURL: "pkg:golang/argocd@2.6.4", + PURL: "pkg:golang/github.com/argoproj/argo-cd/v2@2.6.4", Locations: locations("argocd"), Metadata: metadata("argocd"), }, @@ -270,7 +270,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "helm", Version: "2.16.10", Type: "binary", - PURL: "pkg:golang/helm@2.16.10", + PURL: "pkg:golang/helm.sh/helm@2.16.10", Locations: locations("helm"), Metadata: metadata("helm"), }, @@ -282,7 +282,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "helm", Version: "3.10.3", Type: "binary", - PURL: "pkg:golang/helm@3.10.3", + PURL: "pkg:golang/helm.sh/helm/v3@3.10.3", Locations: locations("helm"), Metadata: metadata("helm"), }, @@ -294,7 +294,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "kubectl", Version: "1.24.11", Type: "binary", - PURL: "pkg:golang/kubectl@1.24.11", + PURL: "pkg:golang/k8s.io/kubectl@1.24.11", Locations: locations("kubectl"), Metadata: metadata("kubectl"), }, @@ -306,7 +306,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "kubectl", Version: "1.25.7", Type: "binary", - PURL: "pkg:golang/kubectl@1.25.7", + PURL: "pkg:golang/k8s.io/kubectl@1.25.7", Locations: locations("kubectl"), Metadata: metadata("kubectl"), }, @@ -318,7 +318,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "kubectl", Version: "1.26.2", Type: "binary", - PURL: "pkg:golang/kubectl@1.26.2", + PURL: "pkg:golang/k8s.io/kubectl@1.26.2", Locations: locations("kubectl"), Metadata: metadata("kubectl"), }, @@ -330,7 +330,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "kustomize", Version: "4.5.7", Type: "binary", - PURL: "pkg:golang/kustomize@4.5.7", + PURL: "pkg:golang/sigs.k8s.io/kustomize@4.5.7", Locations: locations("kustomize"), Metadata: metadata("kustomize"), }, @@ -342,7 +342,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "kustomize", Version: "5.0.0", Type: "binary", - PURL: "pkg:golang/kustomize@5.0.0", + PURL: "pkg:golang/sigs.k8s.io/kustomize@5.0.0", Locations: locations("kustomize"), Metadata: metadata("kustomize"), }, diff --git a/syft/pkg/cataloger/binary/default_classifiers.go b/syft/pkg/cataloger/binary/default_classifiers.go index 1249959c5e2..4eaa0bf2581 100644 --- a/syft/pkg/cataloger/binary/default_classifiers.go +++ b/syft/pkg/cataloger/binary/default_classifiers.go @@ -52,7 +52,7 @@ var defaultClassifiers = []classifier{ EvidenceMatcher: fileContentsVersionMatcher( `(?m)common\.version=(?P[0-9]+\.[0-9]+\.[0-9]+)`), Package: "argocd", - PURL: mustPURL("pkg:golang/argocd@version"), + PURL: mustPURL("pkg:golang/github.com/argoproj/argo-cd/v2@version"), CPEs: singleCPE("cpe:2.3:a:argoproj:argocd:*:*:*:*:*:*:*"), }, { @@ -61,7 +61,7 @@ var defaultClassifiers = []classifier{ EvidenceMatcher: fileContentsVersionMatcher( `(?m)\x00v(?P[0-9]+\.[0-9]+\.[0-9]+)\x00`), Package: "helm", - PURL: mustPURL("pkg:golang/helm@version"), + PURL: mustPURL("pkg:golang/helm.sh/helm/v3@version"), CPEs: singleCPE("cpe:2.3:a:helm:helm:*:*:*:*:*:*:*"), }, { @@ -70,7 +70,7 @@ var defaultClassifiers = []classifier{ EvidenceMatcher: fileContentsVersionMatcher( `(?m)version=kustomize/v(?P[0-9]+\.[0-9]+\.[0-9]+)`), Package: "kustomize", - PURL: mustPURL("pkg:golang/kustomize@version"), + PURL: mustPURL("pkg:golang/sigs.k8s.io/kustomize@version"), CPEs: singleCPE("cpe:2.3:a:kustomize:kustomize:*:*:*:*:*:*:*"), }, { @@ -79,7 +79,7 @@ var defaultClassifiers = []classifier{ EvidenceMatcher: fileContentsVersionMatcher( `(?m)\x00v(?P[0-9]+\.[0-9]+\.[0-9]+)\x00`), Package: "kubectl", - PURL: mustPURL("pkg:golang/kubectl@version"), + PURL: mustPURL("pkg:golang/k8s.io/kubectl@version"), CPEs: singleCPE("cpe:2.3:a:kubectl:kubectl:*:*:*:*:*:*:*"), }, { From 0a25a0b41c1df422e03dadd3b944145a0862183d Mon Sep 17 00:00:00 2001 From: y12studio Date: Sat, 11 Mar 2023 17:18:32 +0800 Subject: [PATCH 3/4] address PR faceback about binary/test-fixtures/Makefile Signed-off-by: y12studio --- syft/pkg/cataloger/binary/cataloger_test.go | 24 +++---- .../cataloger/binary/test-fixtures/Makefile | 66 ++++++++++++++++++- .../positive/argocd-2.5.11/README.md | 39 ----------- .../classifiers/positive/argocd-2.5.11/argocd | 3 - .../classifiers/positive/argocd-2.6.4/argocd | 3 - .../classifiers/positive/helm-2.16.10/helm | 1 - .../classifiers/positive/helm-3.10.3/helm | 1 - .../positive/kubectl-1.24.11/kubectl | 4 -- .../positive/kubectl-1.25.7/kubectl | 4 -- .../positive/kubectl-1.26.2/kubectl | 4 -- .../positive/kustomize-4.5.7/kustomize | 3 - .../positive/kustomize-5.0.0/kustomize | 3 - 12 files changed, 77 insertions(+), 78 deletions(-) delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/README.md delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/argocd delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.6.4/argocd delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-2.16.10/helm delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-3.10.3/helm delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.24.11/kubectl delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.25.7/kubectl delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.26.2/kubectl delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-4.5.7/kustomize delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-5.0.0/kustomize diff --git a/syft/pkg/cataloger/binary/cataloger_test.go b/syft/pkg/cataloger/binary/cataloger_test.go index 71126a095d2..8fcb8acae9e 100644 --- a/syft/pkg/cataloger/binary/cataloger_test.go +++ b/syft/pkg/cataloger/binary/cataloger_test.go @@ -241,7 +241,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-argocd-2.5.11", - fixtureDir: "test-fixtures/classifiers/positive/argocd-2.5.11", + fixtureDir: "test-fixtures/classifiers/dynamic/argocd-2.5.11", expected: pkg.Package{ Name: "argocd", Version: "2.5.11", @@ -253,7 +253,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-argocd-2.6.4", - fixtureDir: "test-fixtures/classifiers/positive/argocd-2.6.4", + fixtureDir: "test-fixtures/classifiers/dynamic/argocd-2.6.4", expected: pkg.Package{ Name: "argocd", Version: "2.6.4", @@ -264,20 +264,20 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, }, { - name: "positive-helm-2.16.10", - fixtureDir: "test-fixtures/classifiers/positive/helm-2.16.10", + name: "positive-helm-3.11.1", + fixtureDir: "test-fixtures/classifiers/dynamic/helm-3.11.1", expected: pkg.Package{ Name: "helm", - Version: "2.16.10", + Version: "3.11.1", Type: "binary", - PURL: "pkg:golang/helm.sh/helm@2.16.10", + PURL: "pkg:golang/helm.sh/helm/v3@3.11.1", Locations: locations("helm"), Metadata: metadata("helm"), }, }, { name: "positive-helm-3.10.3", - fixtureDir: "test-fixtures/classifiers/positive/helm-3.10.3", + fixtureDir: "test-fixtures/classifiers/dynamic/helm-3.10.3", expected: pkg.Package{ Name: "helm", Version: "3.10.3", @@ -289,7 +289,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-kubectl-1.24.11", - fixtureDir: "test-fixtures/classifiers/positive/kubectl-1.24.11", + fixtureDir: "test-fixtures/classifiers/dynamic/kubectl-1.24.11", expected: pkg.Package{ Name: "kubectl", Version: "1.24.11", @@ -301,7 +301,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-kubectl-1.25.7", - fixtureDir: "test-fixtures/classifiers/positive/kubectl-1.25.7", + fixtureDir: "test-fixtures/classifiers/dynamic/kubectl-1.25.7", expected: pkg.Package{ Name: "kubectl", Version: "1.25.7", @@ -313,7 +313,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-kubectl-1.26.2", - fixtureDir: "test-fixtures/classifiers/positive/kubectl-1.26.2", + fixtureDir: "test-fixtures/classifiers/dynamic/kubectl-1.26.2", expected: pkg.Package{ Name: "kubectl", Version: "1.26.2", @@ -325,7 +325,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-kustomize-4.5.7", - fixtureDir: "test-fixtures/classifiers/positive/kustomize-4.5.7", + fixtureDir: "test-fixtures/classifiers/dynamic/kustomize-4.5.7", expected: pkg.Package{ Name: "kustomize", Version: "4.5.7", @@ -337,7 +337,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-kustomize-5.0.0", - fixtureDir: "test-fixtures/classifiers/positive/kustomize-5.0.0", + fixtureDir: "test-fixtures/classifiers/dynamic/kustomize-5.0.0", expected: pkg.Package{ Name: "kustomize", Version: "5.0.0", diff --git a/syft/pkg/cataloger/binary/test-fixtures/Makefile b/syft/pkg/cataloger/binary/test-fixtures/Makefile index 7cbbac3978a..267713b5ae4 100644 --- a/syft/pkg/cataloger/binary/test-fixtures/Makefile +++ b/syft/pkg/cataloger/binary/test-fixtures/Makefile @@ -4,7 +4,17 @@ all: \ classifiers/dynamic/python-binary-shared-lib-redhat-3.9 \ classifiers/dynamic/python-binary-with-version-3.9 \ classifiers/dynamic/ruby-library-3.2.1 \ - classifiers/dynamic/ruby-library-2.7.7 + classifiers/dynamic/ruby-library-2.7.7 \ + classifiers/dynamic/argocd-2.5.11 \ + classifiers/dynamic/argocd-2.6.4 \ + classifiers/dynamic/helm-3.11.1 \ + classifiers/dynamic/helm-3.10.3 \ + classifiers/dynamic/kubectl-1.24.11 \ + classifiers/dynamic/kubectl-1.25.7 \ + classifiers/dynamic/kubectl-1.26.2 \ + classifiers/dynamic/kustomize-4.5.7 \ + classifiers/dynamic/kustomize-5.0.0 + classifiers/dynamic/python-binary-shared-lib-3.11: $(eval $@_image := "python:3.11-slim@sha256:0b106e1d2bf485c2a41474bc9cd5103e9eea4e179f40f10741b53b127059221e") @@ -54,6 +64,60 @@ classifiers/dynamic/ruby-library-2.7.7: /usr/local/lib/libruby.so.2.7 \ $@/libruby.so.2.7 +classifiers/dynamic/argocd-2.5.11: + $(eval $@_image := "argoproj/argocd:v2.5.11@sha256:d1062935b3256ec69422843ebcb50debb54fd389436961586000c8ce6ee7f249") + ./get-image-file.sh $($@_image) \ + /usr/local/bin/argocd \ + $@/argocd + +classifiers/dynamic/argocd-2.6.4: + $(eval $@_image := "argoproj/argocd:v2.6.4@sha256:61fcbba187ff53c00696cb580edf70cada59c45cf399d8477631acf43cf522ee") + ./get-image-file.sh $($@_image) \ + /usr/local/bin/argocd \ + $@/argocd + +classifiers/dynamic/helm-3.11.1: + $(eval $@_image := "alpine/helm:3.11.1@sha256:8628e3695fb743a8b9de89626f1b7a221280c2152c0e288c2504e59b68233e8b") + ./get-image-file.sh $($@_image) \ + /usr/bin/helm \ + $@/helm + +classifiers/dynamic/helm-3.10.3: + $(eval $@_image := "argoproj/argocd:v2.6.4@sha256:61fcbba187ff53c00696cb580edf70cada59c45cf399d8477631acf43cf522ee") + ./get-image-file.sh $($@_image) \ + /usr/local/bin/helm \ + $@/helm + +classifiers/dynamic/kubectl-1.24.11: + $(eval $@_image := "bitnami/kubectl:1.24.11@sha256:79d60c5ac8a1dc84e2c39f56d8e8cc0053159b5ed88f283bdf8fbda1ee86c8bc") + ./get-image-file.sh $($@_image) \ + /opt/bitnami/kubectl/bin/kubectl \ + $@/kubectl + +classifiers/dynamic/kubectl-1.25.7: + $(eval $@_image := "bitnami/kubectl:1.25.7@sha256:d7b00dbfdc6d8890aefe40edfb6c1d4c90cbb6c978794bb51a21744edc34ba7a") + ./get-image-file.sh $($@_image) \ + /opt/bitnami/kubectl/bin/kubectl \ + $@/kubectl + +classifiers/dynamic/kubectl-1.26.2: + $(eval $@_image := "line/kubectl-kustomize:1.26.2-5.0.0@sha256:9ee3b4a9a21f0777fc1d8c64208290f818a2e68c5e9e892e931621bda089bf06") + ./get-image-file.sh $($@_image) \ + /usr/local/bin/kubectl \ + $@/kubectl + +classifiers/dynamic/kustomize-4.5.7: + $(eval $@_image := "argoproj/argocd:v2.6.4@sha256:61fcbba187ff53c00696cb580edf70cada59c45cf399d8477631acf43cf522ee") + ./get-image-file.sh $($@_image) \ + /usr/local/bin/kustomize \ + $@/kustomize + +classifiers/dynamic/kustomize-5.0.0: + $(eval $@_image := "line/kubectl-kustomize:1.26.2-5.0.0@sha256:9ee3b4a9a21f0777fc1d8c64208290f818a2e68c5e9e892e931621bda089bf06") + ./get-image-file.sh $($@_image) \ + /usr/local/bin/kustomize \ + $@/kustomize + .PHONY: clean clean: rm -rf classifiers/dynamic diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/README.md b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/README.md deleted file mode 100644 index b1843feab18..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/README.md +++ /dev/null @@ -1,39 +0,0 @@ -test-fixtures for https://github.com/anchore/syft/issues/1606 - -```sh -DEV_IMG=devalpine:3.17 - -docker build -t ${DEV_IMG} - < /tmp/$1/$3 -} -strings_save argocd-2.5.11 '2\.5\.11' argocd -strings_save argocd-2.6.4 '2\.6\.4' argocd -strings_save helm-2.16.10 '2\.16\.10' helm -strings_save helm-3.10.3 '3\.10\.3' helm -strings_save kustomize-4.5.7 '4\.5\.7' kustomize -strings_save kustomize-5.0.0 '5\.0\.0' kustomize -strings_save kubectl-1.24.11 '1\.24\.11' kubectl -strings_save kubectl-1.25.7 '1\.25\.7' kubectl -strings_save kubectl-1.26.2 '1\.26\.2' kubectl -EOF - -echo tmp dir: $TEMP_DIR -ls -lah $TEMP_DIR -``` \ No newline at end of file diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/argocd b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/argocd deleted file mode 100644 index afbf80be1e3..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.5.11/argocd +++ /dev/null @@ -1,3 +0,0 @@ -2.5.11 -build -ldflags="-X github.com/argoproj/argo-cd/v2/common.version=2.5.11 -X github.com/argoproj/argo-cd/v2/common.buildDate=2023-02-16T15:06:40Z -X github.com/argoproj/argo-cd/v2/common.gitCommit=6dd79895e248cc0980bcaf6c6bafdc9afbbf80cb -X github.com/argoproj/argo-cd/v2/common.gitTreeState=clean -X github.com/argoproj/argo-cd/v2/common.kubectlVersion=v0.24.2 -extldflags \"-static\"" -build -ldflags="-X github.com/argoproj/argo-cd/v2/common.version=2.5.11 -X github.com/argoproj/argo-cd/v2/common.buildDate=2023-02-16T15:06:40Z -X github.com/argoproj/argo-cd/v2/common.gitCommit=6dd79895e248cc0980bcaf6c6bafdc9afbbf80cb -X github.com/argoproj/argo-cd/v2/common.gitTreeState=clean -X github.com/argoproj/argo-cd/v2/common.kubectlVersion=v0.24.2 -extldflags \"-static\"" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.6.4/argocd b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.6.4/argocd deleted file mode 100644 index 330dab901a1..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/argocd-2.6.4/argocd +++ /dev/null @@ -1,3 +0,0 @@ -2.6.4 -build -ldflags="-X github.com/argoproj/argo-cd/v2/common.version=2.6.4 -X github.com/argoproj/argo-cd/v2/common.buildDate=2023-03-07T22:48:16Z -X github.com/argoproj/argo-cd/v2/common.gitCommit=7be094f38d06859b594b98eb75c7c70d39b80b1e -X github.com/argoproj/argo-cd/v2/common.gitTreeState=clean -X github.com/argoproj/argo-cd/v2/common.kubectlVersion=v0.24.2 -extldflags \"-static\"" -build -ldflags="-X github.com/argoproj/argo-cd/v2/common.version=2.6.4 -X github.com/argoproj/argo-cd/v2/common.buildDate=2023-03-07T22:48:16Z -X github.com/argoproj/argo-cd/v2/common.gitCommit=7be094f38d06859b594b98eb75c7c70d39b80b1e -X github.com/argoproj/argo-cd/v2/common.gitTreeState=clean -X github.com/argoproj/argo-cd/v2/common.kubectlVersion=v0.24.2 -extldflags \"-static\"" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-2.16.10/helm b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-2.16.10/helm deleted file mode 100644 index 18f22918a9d..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-2.16.10/helm +++ /dev/null @@ -1 +0,0 @@ -v2.16.10 diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-3.10.3/helm b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-3.10.3/helm deleted file mode 100644 index 5515cfcc85f..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/helm-3.10.3/helm +++ /dev/null @@ -1 +0,0 @@ -v3.10.3 diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.24.11/kubectl b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.24.11/kubectl deleted file mode 100644 index 9a7a10c5015..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.24.11/kubectl +++ /dev/null @@ -1,4 +0,0 @@ -v1.24.11 -v1.24.11 -build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/client-go/pkg/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/component-base/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.24.11' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.24.11' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.24.11' -X 'k8s.io/component-base/version.gitVersion=v1.24.11' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=24' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=24' -X 'k8s.io/client-go/pkg/version.gitMinor=24' -X 'k8s.io/component-base/version.gitMinor=24' -s -w" -build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T13:39:33Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/client-go/pkg/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/component-base/version.gitCommit=0f75679e3346160939924550fd3591462a4afec6' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.24.11' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.24.11' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.24.11' -X 'k8s.io/component-base/version.gitVersion=v1.24.11' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=24' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=24' -X 'k8s.io/client-go/pkg/version.gitMinor=24' -X 'k8s.io/component-base/version.gitMinor=24' -s -w" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.25.7/kubectl b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.25.7/kubectl deleted file mode 100644 index 18e5f65f6d7..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.25.7/kubectl +++ /dev/null @@ -1,4 +0,0 @@ -v1.25.7 -v1.25.7 -build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/client-go/pkg/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/component-base/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.25.7' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.25.7' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.25.7' -X 'k8s.io/component-base/version.gitVersion=v1.25.7' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=25' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=25' -X 'k8s.io/client-go/pkg/version.gitMinor=25' -X 'k8s.io/component-base/version.gitMinor=25' -s -w" -build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T14:05:25Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/client-go/pkg/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/component-base/version.gitCommit=723bcdb232300aaf5e147ff19b4df7ec8a20278d' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.25.7' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.25.7' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.25.7' -X 'k8s.io/component-base/version.gitVersion=v1.25.7' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=25' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=25' -X 'k8s.io/client-go/pkg/version.gitMinor=25' -X 'k8s.io/component-base/version.gitMinor=25' -s -w" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.26.2/kubectl b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.26.2/kubectl deleted file mode 100644 index 269d7f46cfb..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kubectl-1.26.2/kubectl +++ /dev/null @@ -1,4 +0,0 @@ -v1.26.2 -v1.26.2 -build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/client-go/pkg/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/component-base/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.26.2' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.26.2' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.26.2' -X 'k8s.io/component-base/version.gitVersion=v1.26.2' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=26' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=26' -X 'k8s.io/client-go/pkg/version.gitMinor=26' -X 'k8s.io/component-base/version.gitMinor=26' -s -w" -build -ldflags="all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/component-base/version.buildDate=2023-02-22T13:39:03Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/client-go/pkg/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/component-base/version.gitCommit=fc04e732bb3e7198d2fa44efa5457c7c6f8c0f5b' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.26.2' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.26.2' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.26.2' -X 'k8s.io/component-base/version.gitVersion=v1.26.2' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=26' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=26' -X 'k8s.io/client-go/pkg/version.gitMinor=26' -X 'k8s.io/component-base/version.gitMinor=26' -s -w" diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-4.5.7/kustomize b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-4.5.7/kustomize deleted file mode 100644 index 018a7f58904..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-4.5.7/kustomize +++ /dev/null @@ -1,3 +0,0 @@ -kustomize/v4.5.7 -build -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=kustomize/v4.5.7 -X sigs.k8s.io/kustomize/api/provenance.gitCommit=56d82a8378dfc8dc3b3b1085e5a6e67b82966bd7 -X sigs.k8s.io/kustomize/api/provenance.buildDate=2022-08-02T16:35:54Z " -build -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=kustomize/v4.5.7 -X sigs.k8s.io/kustomize/api/provenance.gitCommit=56d82a8378dfc8dc3b3b1085e5a6e67b82966bd7 -X sigs.k8s.io/kustomize/api/provenance.buildDate=2022-08-02T16:35:54Z " diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-5.0.0/kustomize b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-5.0.0/kustomize deleted file mode 100644 index ae7237d06a0..00000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/kustomize-5.0.0/kustomize +++ /dev/null @@ -1,3 +0,0 @@ -kustomize/v5.0.0 -build -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=kustomize/v5.0.0 -X sigs.k8s.io/kustomize/api/provenance.buildDate=2023-02-02T16:43:10Z " -build -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=kustomize/v5.0.0 -X sigs.k8s.io/kustomize/api/provenance.buildDate=2023-02-02T16:43:10Z " From e11b069fdedb619bb8c38d4695bcc9dfbc4a50ec Mon Sep 17 00:00:00 2001 From: y12studio Date: Sat, 11 Mar 2023 17:35:39 +0800 Subject: [PATCH 4/4] remove the /v[n] suffix from the PURL in both argocd and helm Signed-off-by: y12studio --- syft/pkg/cataloger/binary/cataloger_test.go | 8 ++++---- syft/pkg/cataloger/binary/default_classifiers.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/syft/pkg/cataloger/binary/cataloger_test.go b/syft/pkg/cataloger/binary/cataloger_test.go index 8fcb8acae9e..1acc32e6c3a 100644 --- a/syft/pkg/cataloger/binary/cataloger_test.go +++ b/syft/pkg/cataloger/binary/cataloger_test.go @@ -246,7 +246,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "argocd", Version: "2.5.11", Type: "binary", - PURL: "pkg:golang/github.com/argoproj/argo-cd/v2@2.5.11", + PURL: "pkg:golang/github.com/argoproj/argo-cd@2.5.11", Locations: locations("argocd"), Metadata: metadata("argocd"), }, @@ -258,7 +258,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "argocd", Version: "2.6.4", Type: "binary", - PURL: "pkg:golang/github.com/argoproj/argo-cd/v2@2.6.4", + PURL: "pkg:golang/github.com/argoproj/argo-cd@2.6.4", Locations: locations("argocd"), Metadata: metadata("argocd"), }, @@ -270,7 +270,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "helm", Version: "3.11.1", Type: "binary", - PURL: "pkg:golang/helm.sh/helm/v3@3.11.1", + PURL: "pkg:golang/helm.sh/helm@3.11.1", Locations: locations("helm"), Metadata: metadata("helm"), }, @@ -282,7 +282,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Name: "helm", Version: "3.10.3", Type: "binary", - PURL: "pkg:golang/helm.sh/helm/v3@3.10.3", + PURL: "pkg:golang/helm.sh/helm@3.10.3", Locations: locations("helm"), Metadata: metadata("helm"), }, diff --git a/syft/pkg/cataloger/binary/default_classifiers.go b/syft/pkg/cataloger/binary/default_classifiers.go index 4eaa0bf2581..3ac6f0c7b34 100644 --- a/syft/pkg/cataloger/binary/default_classifiers.go +++ b/syft/pkg/cataloger/binary/default_classifiers.go @@ -52,7 +52,7 @@ var defaultClassifiers = []classifier{ EvidenceMatcher: fileContentsVersionMatcher( `(?m)common\.version=(?P[0-9]+\.[0-9]+\.[0-9]+)`), Package: "argocd", - PURL: mustPURL("pkg:golang/github.com/argoproj/argo-cd/v2@version"), + PURL: mustPURL("pkg:golang/github.com/argoproj/argo-cd@version"), CPEs: singleCPE("cpe:2.3:a:argoproj:argocd:*:*:*:*:*:*:*"), }, { @@ -61,7 +61,7 @@ var defaultClassifiers = []classifier{ EvidenceMatcher: fileContentsVersionMatcher( `(?m)\x00v(?P[0-9]+\.[0-9]+\.[0-9]+)\x00`), Package: "helm", - PURL: mustPURL("pkg:golang/helm.sh/helm/v3@version"), + PURL: mustPURL("pkg:golang/helm.sh/helm@version"), CPEs: singleCPE("cpe:2.3:a:helm:helm:*:*:*:*:*:*:*"), }, {