diff --git a/syft/pkg/cataloger/binary/classifiers.go b/syft/pkg/cataloger/binary/classifiers.go index 5290b4d984e..6e3f8bd1d02 100644 --- a/syft/pkg/cataloger/binary/classifiers.go +++ b/syft/pkg/cataloger/binary/classifiers.go @@ -574,6 +574,17 @@ func DefaultClassifiers() []Classifier { PURL: mustPURL("pkg:generic/curl@version"), CPEs: singleCPE("cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource), }, + { + Class: "openssh-binary", + FileGlob: "**/ssh", + EvidenceMatcher: FileContentsVersionMatcher( + // NOTE: The portable OpenSSH releases are marked with a 'p' version postfix (e.g. 9.6p1) + `\x00OpenSSH_(?P[0-9]+\.[0-9]+)(p[0-9])?\x00`, + ), + Package: "openssh", + PURL: mustPURL("pkg:generic/openssh@version"), + CPEs: singleCPE("cpe:2.3:a:openbsd:openssh:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource), + }, } } diff --git a/syft/pkg/cataloger/binary/test-fixtures/config.yaml b/syft/pkg/cataloger/binary/test-fixtures/config.yaml index 58408325be8..fd08243ff1d 100644 --- a/syft/pkg/cataloger/binary/test-fixtures/config.yaml +++ b/syft/pkg/cataloger/binary/test-fixtures/config.yaml @@ -610,3 +610,10 @@ from-images: paths: - /usr/bin/curl + - name: openssh + version: 9.3p1 + images: + - ref: finalgene/openssh:9.1@sha256:0272f8e6ef6344eafc71c2dfb53ba8397ff47d7cf2e46c5c46c5f269e41d19e8 + platform: linux/amd64 + paths: + - /usr/bin/ssh