diff --git a/syft/pkg/cataloger/binary/classifier_cataloger_test.go b/syft/pkg/cataloger/binary/classifier_cataloger_test.go index 48744a612d7..6e5c8dd81e1 100644 --- a/syft/pkg/cataloger/binary/classifier_cataloger_test.go +++ b/syft/pkg/cataloger/binary/classifier_cataloger_test.go @@ -485,6 +485,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) { Metadata: metadata("redis-binary"), }, }, + { + logicalFixture: "redis-server/7.2.5/linux-386", + expected: pkg.Package{ + Name: "redis", + Version: "7.2.5", + Type: "binary", + PURL: "pkg:generic/redis@7.2.5", + Locations: locations("redis-server"), + Metadata: metadata("redis-binary"), + }, + }, { logicalFixture: "python-shared-lib/3.7.4/linux-amd64", expected: pkg.Package{ diff --git a/syft/pkg/cataloger/binary/classifiers.go b/syft/pkg/cataloger/binary/classifiers.go index 52dc1549a8b..3d7ec8d7f1a 100644 --- a/syft/pkg/cataloger/binary/classifiers.go +++ b/syft/pkg/cataloger/binary/classifiers.go @@ -78,7 +78,7 @@ func DefaultClassifiers() []Classifier { FileGlob: "**/redis-server", EvidenceMatcher: evidenceMatchers( FileContentsVersionMatcher(`(?s)payload %5.*?(?P\d.\d\.\d\d*)[a-z0-9]{12,15}-[0-9]{19}`), - FileContentsVersionMatcher(`(?s)\x00(?P\d.\d\.\d\d*)[a-z0-9]{12}-[0-9]{19}\x00.*?payload %5`), + FileContentsVersionMatcher(`(?s)\x00(?P\d.\d\.\d\d*)[a-z0-9]{12,15}-[0-9]{19}\x00.*?payload %5`), ), Package: "redis", PURL: mustPURL("pkg:generic/redis@version"), diff --git a/syft/pkg/cataloger/binary/test-fixtures/config.yaml b/syft/pkg/cataloger/binary/test-fixtures/config.yaml index f32705f2a38..434a93d1b7c 100644 --- a/syft/pkg/cataloger/binary/test-fixtures/config.yaml +++ b/syft/pkg/cataloger/binary/test-fixtures/config.yaml @@ -440,6 +440,13 @@ from-images: paths: - /usr/local/bin/redis-server + - version: 7.2.5 + images: + - ref: redis:7.2.5@sha256:3b44455ef048b5f0a3a26d874c00c0f4ffe6a71a40834f2b038f816c6ad5ca4f + platform: linux/386 + paths: + - /usr/local/bin/redis-server + - version: 2.9.0 images: - ref: wordpress:cli-2.9.0-php8.3@sha256:3a008aafccc6a8d2d7ec2b069722cb43b3569b61cd833f9f2f13d74a9284746e