feat: support envoy bin classifier

Signed-off-by: Rez Moss <hi@rezmoss.com>
This commit is contained in:
Rez Moss 2026-06-22 13:16:33 -04:00 committed by GitHub
parent 52a4c3b594
commit 1f4f9332c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 213 additions and 0 deletions

View File

@ -2778,6 +2778,127 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
},
},
},
{
logicalFixture: "envoy/1.22.10/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.22.10",
Type: "binary",
PURL: "pkg:generic/envoy@1.22.10",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.24.5/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.24.5",
Type: "binary",
PURL: "pkg:generic/envoy@1.24.5",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.30.2/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.30.2",
Type: "binary",
PURL: "pkg:generic/envoy@1.30.2",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.31.2/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.31.2",
Type: "binary",
PURL: "pkg:generic/envoy@1.31.2",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.34.12/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.34.12",
Type: "binary",
PURL: "pkg:generic/envoy@1.34.12",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.35.4/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.35.4",
Type: "binary",
PURL: "pkg:generic/envoy@1.35.4",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.23.7/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.23.7",
Type: "binary",
PURL: "pkg:generic/envoy@1.23.7",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.24.9/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.24.9",
Type: "binary",
PURL: "pkg:generic/envoy@1.24.9",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.30.1/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.30.1",
Type: "binary",
PURL: "pkg:generic/envoy@1.30.1",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.30.6/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.30.6",
Type: "binary",
PURL: "pkg:generic/envoy@1.30.6",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
{
logicalFixture: "envoy/1.36.1/linux-amd64",
expected: pkg.Package{
Name: "envoy",
Version: "1.36.1",
Type: "binary",
PURL: "pkg:generic/envoy@1.36.1",
Locations: locations("envoy"),
Metadata: metadata("envoy-binary"),
},
},
}
for _, test := range tests {

View File

@ -1076,6 +1076,20 @@ func DefaultClassifiers() []binutils.Classifier {
m.FileContentsVersionMatcher(`(?s)\[source/.{0,200}\x00(?P<version>1\.1[0-9]\.[0-9]+(-dev)?)\x00`),
// 1.x [NUL]1.6.0[NUL]RELEASE
m.FileContentsVersionMatcher(`(?s)\x00(?P<version>1\.[0-9]\.[0-9]+(-dev)?)\x00.{0,20}RELEASE`),
// contrib 1.3x [NUL]1.34.12[NUL]envoy_quiche... or [NUL]1.30.2[NUL]envoy/extensions... or [NUL]1.30.8[NUL]envoy://
m.FileContentsVersionMatcher(`(?s)\x00(?P<version>1\.3[0-9]\.[0-9]+(-dev)?)\x00envoy[/._:]`),
// contrib 1.3x [NUL]1.30.7[NUL]...envoy.service or [NUL]1.30.6[NUL]...envoy.data
m.FileContentsVersionMatcher(`(?s)\x00(?P<version>1\.3[0-9]\.[0-9]+(-dev)?)\x00.{0,200}envoy[./]`),
// contrib1.3x [NUL]1.31.2[NUL]...envoy_quic or [NUL]1.36.x[NUL]...envoy_quic
m.FileContentsVersionMatcher(`(?s)\x00(?P<version>1\.3[0-9]\.[0-9]+(-dev)?)\x00.{0,1000}envoy_quic`),
// contrib 1.3x [NUL]1.30.1[NUL]TLS client
m.FileContentsVersionMatcher(`(?s)\x00(?P<version>1\.3[0-9]\.[0-9]+(-dev)?)\x00TLS `),
// contrib 1.2x [NUL]1.24.9[NUL]envoy/extensions...
m.FileContentsVersionMatcher(`(?s)\x00(?P<version>1\.2[0-9]\.[0-9]+(-dev)?)\x00envoy[/._]`),
// contrib 1.2x [NUL]1.22.10[NUL]...envoy. or [NUL]1.24.5[NUL]...envoy.
m.FileContentsVersionMatcher(`(?s)\x00(?P<version>1\.2[0-9]\.[0-9]+(-dev)?)\x00.{0,500}envoy\.`),
// contrib 1.2x [NUL]1.23.7[NUL]...envoy_internal
m.FileContentsVersionMatcher(`(?s)\x00(?P<version>1\.2[0-9]\.[0-9]+(-dev)?)\x00.{0,300}envoy_`),
),
Package: "envoy",
PURL: mustPURL("pkg:generic/envoy@version"),

View File

@ -1737,3 +1737,81 @@ from-images:
platform: linux/amd64
paths:
- /usr/share/elastic-agent/data/elastic-agent-1c21b0/elastic-agent
# contrib builds
- version: 1.22.10
images:
- ref: envoyproxy/envoy:contrib-v1.22.10@sha256:2c479dd69aaaf555ab48ab9142b5970b74ee472e50f08d2b85caa1460c19f689
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.24.5
images:
- ref: envoyproxy/envoy:contrib-v1.24.5@sha256:9a32eaff6798dd62a7d6662a02226d47df694406d1698f000ad25dd1a3355952
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.30.2
images:
- ref: envoyproxy/envoy:contrib-v1.30.2@sha256:8878516ce3c8f099300243fadacb2e3d869d447dfd276ac2661c6c06c92bcd45
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.31.2
images:
- ref: envoyproxy/envoy:contrib-v1.31.2@sha256:ebdf98ff3b26d5fa70276fb43f0dbca168f49aa5aa1fe5f18382d391f482aa3e
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.34.12
images:
- ref: envoyproxy/envoy:contrib-v1.34.12@sha256:50da8a5221c9afc84df79f384aa9ee9c7000f8509d3f2562a58d84cb2fd39645
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.23.7
images:
- ref: envoyproxy/envoy:contrib-v1.23.7@sha256:4589b08900e41de763d19ac3c854c280796a575f58c218c5e8b2f2a6e4765dda
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.24.9
images:
- ref: envoyproxy/envoy:contrib-v1.24.9@sha256:e6cdba2e747f2c024821cec58d2e2833cd0e6512c61d1dbe7200f8046235a026
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.30.1
images:
- ref: envoyproxy/envoy:contrib-v1.30.1@sha256:92d50d25c28d68979a20607736e401e4c05c717109fc0d07d688aaa3db35bd94
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.30.6
images:
- ref: envoyproxy/envoy:contrib-v1.30.6@sha256:58bd1cb68eea4ffd5b4d41112bc31299057f17e72c6cacaf7431fd0ee6b5222b
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.35.4
images:
- ref: envoyproxy/envoy:contrib-v1.35.4@sha256:07378820f9669a3c7eac5d0a88fda78ccb8dfdd4100388db1110b2038f8d5d21
platform: linux/amd64
paths:
- /usr/local/bin/envoy
- version: 1.36.1
images:
- ref: envoyproxy/envoy:contrib-v1.36.1@sha256:f2001f6f72abc22e7ac9cebe940e48570ee5970703ada61bca6919c687b2accf
platform: linux/amd64
paths:
- /usr/local/bin/envoy