diff --git a/syft/pkg/cataloger/binary/classifier_cataloger_test.go b/syft/pkg/cataloger/binary/classifier_cataloger_test.go index dcb84d898..2c847837a 100644 --- a/syft/pkg/cataloger/binary/classifier_cataloger_test.go +++ b/syft/pkg/cataloger/binary/classifier_cataloger_test.go @@ -1589,6 +1589,39 @@ func Test_Cataloger_PositiveCases(t *testing.T) { }, }, }, + { + logicalFixture: "istio_pilot-discovery/1.29.0-alpha.0/linux-amd64", + expected: pkg.Package{ + Name: "pilot-discovery", + Version: "1.29.0-alpha.0", + Type: "binary", + PURL: "pkg:generic/istio@1.29.0-alpha.0", + Locations: locations("pilot-discovery"), + Metadata: metadata("istio-binary"), + }, + }, + { + logicalFixture: "istio_pilot-discovery/1.29.0-beta.0/linux-amd64", + expected: pkg.Package{ + Name: "pilot-discovery", + Version: "1.29.0-beta.0", + Type: "binary", + PURL: "pkg:generic/istio@1.29.0-beta.0", + Locations: locations("pilot-discovery"), + Metadata: metadata("istio-binary"), + }, + }, + { + logicalFixture: "istio_pilot-discovery/1.29.0-rc.3/linux-amd64", + expected: pkg.Package{ + Name: "pilot-discovery", + Version: "1.29.0-rc.3", + Type: "binary", + PURL: "pkg:generic/istio@1.29.0-rc.3", + Locations: locations("pilot-discovery"), + Metadata: metadata("istio-binary"), + }, + }, { logicalFixture: "istio_pilot-discovery/1.26.8/linux-amd64", expected: pkg.Package{ @@ -1600,6 +1633,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) { Metadata: metadata("istio-binary"), }, }, + { + logicalFixture: "istio_pilot-discovery/1.10-dev/linux-amd64", + expected: pkg.Package{ + Name: "pilot-discovery", + Version: "1.10-dev", + Type: "binary", + PURL: "pkg:generic/istio@1.10-dev", + Locations: locations("pilot-discovery"), + Metadata: metadata("istio-binary"), + }, + }, { logicalFixture: "istio_pilot-discovery/1.8.0/linux-amd64", expected: pkg.Package{ @@ -1633,6 +1677,39 @@ func Test_Cataloger_PositiveCases(t *testing.T) { Metadata: metadata("istio-binary"), }, }, + { + logicalFixture: "istio_pilot-agent/1.29.0-alpha.0/linux-amd64", + expected: pkg.Package{ + Name: "pilot-agent", + Version: "1.29.0-alpha.0", + Type: "binary", + PURL: "pkg:generic/istio@1.29.0-alpha.0", + Locations: locations("pilot-agent"), + Metadata: metadata("istio-binary"), + }, + }, + { + logicalFixture: "istio_pilot-agent/1.29.0-beta.0/linux-amd64", + expected: pkg.Package{ + Name: "pilot-agent", + Version: "1.29.0-beta.0", + Type: "binary", + PURL: "pkg:generic/istio@1.29.0-beta.0", + Locations: locations("pilot-agent"), + Metadata: metadata("istio-binary"), + }, + }, + { + logicalFixture: "istio_pilot-agent/1.29.0-rc.3/linux-amd64", + expected: pkg.Package{ + Name: "pilot-agent", + Version: "1.29.0-rc.3", + Type: "binary", + PURL: "pkg:generic/istio@1.29.0-rc.3", + Locations: locations("pilot-agent"), + Metadata: metadata("istio-binary"), + }, + }, { logicalFixture: "istio_pilot-agent/1.26.8/linux-amd64", expected: pkg.Package{ @@ -1644,6 +1721,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) { Metadata: metadata("istio-binary"), }, }, + { + logicalFixture: "istio_pilot-agent/1.10-dev/linux-amd64", + expected: pkg.Package{ + Name: "pilot-agent", + Version: "1.10-dev", + Type: "binary", + PURL: "pkg:generic/istio@1.10-dev", + Locations: locations("pilot-agent"), + Metadata: metadata("istio-binary"), + }, + }, { logicalFixture: "istio_pilot-agent/1.8.0/linux-amd64", expected: pkg.Package{ diff --git a/syft/pkg/cataloger/binary/classifiers.go b/syft/pkg/cataloger/binary/classifiers.go index bd115b5e8..e9692b3cb 100644 --- a/syft/pkg/cataloger/binary/classifiers.go +++ b/syft/pkg/cataloger/binary/classifiers.go @@ -718,11 +718,13 @@ func DefaultClassifiers() []binutils.Classifier { EvidenceMatcher: binutils.MatchAny( // [NUL]1.26.8[NUL][NUL]1.26.8[NUL] // [NUL]1.3.7[NUL][NUL][NUL]1.3.8[NUL] - m.FileContentsVersionMatcher(`[0-9]+\.[0-9]+\.[0-9]+\x00+(?P[0-9]+\.[0-9]+\.[0-9]+)\x00+`), + m.FileContentsVersionMatcher(`[0-9]+\.[0-9]+\.[0-9]+\x00+(?P[0-9]+\.[0-9]+\.[0-9]+(-alpha\.[0-9]+|-beta\.[0-9]+|-rc\.[0-9]+|-dev)?)\x00+`), // Clean[NUL][NUL][NUL]1.8.0[NUL] - m.FileContentsVersionMatcher(`Clean\x00+(?P[0-9]+\.[0-9]+\.[0-9]+)\x00+`), + m.FileContentsVersionMatcher(`Clean\x00+(?P[0-9]+\.[0-9]+\.[0-9]+(-alpha\.[0-9]+|-beta\.[0-9]+|-rc\.[0-9]+|-dev)?)\x00+`), + // Modified[NUL][NUL][NUL][NUL][NUL][NUL][NUL][NUL]1.10-dev[NUL][NUL][NUL] + m.FileContentsVersionMatcher(`Modified\x00+(?P[0-9]+\.[0-9]+-dev)\x00+`), // 1.1.17[NUL]...S=v[0-9]+\.[0-9]+\.[0-9]+)\x00+.{1,100}S?=v[0-9]+\.[0-9]+\.[0-9]+(-alpha\.[0-9]+|-beta\.[0-9]+|-rc\.[0-9]+|-dev)?)\x00+.{1,100}S?=v[0-9]+\.[0-9]+\.[0-9]+)\x00+`), + m.FileContentsVersionMatcher(`[0-9]+\.[0-9]+\.[0-9]+\x00+(?P[0-9]+\.[0-9]+\.[0-9]+(-alpha\.[0-9]+|-beta\.[0-9]+|-rc\.[0-9]+|-dev)?)\x00+`), // Clean[NUL][NUL][NUL]1.8.0[NUL] - m.FileContentsVersionMatcher(`Clean\x00+(?P[0-9]+\.[0-9]+\.[0-9]+)\x00+`), + m.FileContentsVersionMatcher(`Clean\x00+(?P[0-9]+\.[0-9]+\.[0-9]+(-alpha\.[0-9]+|-beta\.[0-9]+|-rc\.[0-9]+|-dev)?)\x00+`), + // Modified[NUL][NUL][NUL][NUL][NUL][NUL][NUL][NUL]1.10-dev[NUL][NUL][NUL] + m.FileContentsVersionMatcher(`Modified\x00+(?P[0-9]+\.[0-9]+-dev)\x00+`), // 1.1.17[NUL]...S=v[0-9]+\.[0-9]+\.[0-9]+)\x00+.{1,100}S?=v[0-9]+\.[0-9]+\.[0-9]+(-alpha\.[0-9]+|-beta\.[0-9]+|-rc\.[0-9]+|-dev)?)\x00+.{1,100}S?=v