diff --git a/syft/pkg/cataloger/binary/classifier_cataloger_test.go b/syft/pkg/cataloger/binary/classifier_cataloger_test.go index ba87b50d977..7ec368b851f 100644 --- a/syft/pkg/cataloger/binary/classifier_cataloger_test.go +++ b/syft/pkg/cataloger/binary/classifier_cataloger_test.go @@ -952,6 +952,28 @@ func Test_Cataloger_PositiveCases(t *testing.T) { Metadata: metadata("gcc-binary"), }, }, + { + logicalFixture: "fluent-bit/3.0.2/linux-amd64", + expected: pkg.Package{ + Name: "fluent-bit", + Version: "3.0.2", + Type: "binary", + PURL: "pkg:github/fluent/fluent-bit@3.0.2", + Locations: locations("fluent-bit"), + Metadata: metadata("fluent-bit-binary"), + }, + }, + { + logicalFixture: "fluent-bit/2.2.1/linux-arm64", + expected: pkg.Package{ + Name: "fluent-bit", + Version: "2.2.1", + Type: "binary", + PURL: "pkg:github/fluent/fluent-bit@2.2.1", + Locations: locations("fluent-bit"), + Metadata: metadata("fluent-bit-binary"), + }, + }, { logicalFixture: "wp/2.9.0/linux-amd64", expected: pkg.Package{ diff --git a/syft/pkg/cataloger/binary/classifiers.go b/syft/pkg/cataloger/binary/classifiers.go index e8952fbd1f3..c7ebafa9794 100644 --- a/syft/pkg/cataloger/binary/classifiers.go +++ b/syft/pkg/cataloger/binary/classifiers.go @@ -464,6 +464,19 @@ func DefaultClassifiers() []Classifier { PURL: mustPURL("pkg:generic/gcc@version"), CPEs: singleCPE("cpe:2.3:a:gnu:gcc:*:*:*:*:*:*:*:*"), }, + { + Class: "fluent-bit-binary", + FileGlob: "**/fluent-bit", + EvidenceMatcher: FileContentsVersionMatcher( + // [NUL]3.0.2[NUL]%sFluent Bit + // [NUL]2.2.3[NUL]Fluent Bit + // [NUL]2.2.1[NUL][NUL][NUL]Fluent Bit + `\x00(?P[0-9]+\.[0-9]+\.[0-9]+)\x00[^\d]*Fluent`, + ), + Package: "fluent-bit", + PURL: mustPURL("pkg:github/fluent/fluent-bit@version"), + CPEs: singleCPE("cpe:2.3:a:treasuredata:fluent_bit:*:*:*:*:*:*:*:*"), + }, { Class: "wordpress-cli-binary", FileGlob: "**/wp", diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/fluent-bit/2.2.1/linux-arm64/fluent-bit b/syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/fluent-bit/2.2.1/linux-arm64/fluent-bit new file mode 100644 index 00000000000..e892daa1e51 Binary files /dev/null and b/syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/fluent-bit/2.2.1/linux-arm64/fluent-bit differ diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/fluent-bit/3.0.2/linux-amd64/fluent-bit b/syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/fluent-bit/3.0.2/linux-amd64/fluent-bit new file mode 100644 index 00000000000..3727f1e9c73 Binary files /dev/null and b/syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/fluent-bit/3.0.2/linux-amd64/fluent-bit differ diff --git a/syft/pkg/cataloger/binary/test-fixtures/config.yaml b/syft/pkg/cataloger/binary/test-fixtures/config.yaml index 255843a5e43..9e4ad6325ef 100644 --- a/syft/pkg/cataloger/binary/test-fixtures/config.yaml +++ b/syft/pkg/cataloger/binary/test-fixtures/config.yaml @@ -513,6 +513,20 @@ from-images: paths: - /bin/consul + - version: 3.0.2 + images: + - ref: fluent/fluent-bit:3.0.2-amd64@sha256:7e6fe8efd51dda0739e355f58bf5e3b1623cbf2d4a23c06c7a365d9553e2d242 + platform: linux/amd64 + paths: + - /fluent-bit/bin/fluent-bit + + - version: 2.2.1 + images: + - ref: fluent/fluent-bit:2.2.1-arm64@sha256:28eb03950eb0dac0ca6faead7fdd7261291d669a2b2f010113dab2c25b52b6bf + platform: linux/arm64 + paths: + - /fluent-bit/bin/fluent-bit + - name: openssl version: 1.1.1w images: