add istio classifier (#4521)

Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
witchcraze 2026-01-08 00:36:39 +09:00 committed by GitHub
parent 7f1d57d06f
commit 6509b7079e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 183 additions and 0 deletions

View File

@ -603,6 +603,26 @@ catalogers:
cpes: cpes:
- cpe:2.3:a:elixir-lang:elixir:*:*:*:*:*:*:*:* - cpe:2.3:a:elixir-lang:elixir:*:*:*:*:*:*:*:*
type: BinaryPkg type: BinaryPkg
- method: glob
criteria:
- '**/pilot-discovery'
packages:
- class: istio-binary
name: pilot-discovery
purl: pkg:generic/istio
cpes:
- cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*
type: BinaryPkg
- method: glob
criteria:
- '**/pilot-agent'
packages:
- class: istio-binary
name: pilot-agent
purl: pkg:generic/istio
cpes:
- cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*
type: BinaryPkg
- method: glob - method: glob
criteria: criteria:
- '**/grafana' - '**/grafana'

View File

@ -1441,6 +1441,83 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
}, },
}, },
}, },
{
logicalFixture: "istio_pilot-discovery/1.26.8/linux-amd64",
expected: pkg.Package{
Name: "pilot-discovery",
Version: "1.26.8",
Type: "binary",
PURL: "pkg:generic/istio@1.26.8",
Locations: locations("pilot-discovery"),
Metadata: metadata("istio-binary"),
},
},
{
logicalFixture: "istio_pilot-discovery/1.8.0/linux-amd64",
expected: pkg.Package{
Name: "pilot-discovery",
Version: "1.8.0",
Type: "binary",
PURL: "pkg:generic/istio@1.8.0",
Locations: locations("pilot-discovery"),
Metadata: metadata("istio-binary"),
},
},
{
logicalFixture: "istio_pilot-discovery/1.3.8/linux-amd64",
expected: pkg.Package{
Name: "pilot-discovery",
Version: "1.3.8",
Type: "binary",
PURL: "pkg:generic/istio@1.3.8",
Locations: locations("pilot-discovery"),
Metadata: metadata("istio-binary"),
},
},
{
logicalFixture: "istio_pilot-discovery/1.1.17/linux-amd64",
expected: pkg.Package{
Name: "pilot-discovery",
Version: "1.1.17",
Type: "binary",
PURL: "pkg:generic/istio@1.1.17",
Locations: locations("pilot-discovery"),
Metadata: metadata("istio-binary"),
},
},
{
logicalFixture: "istio_pilot-agent/1.26.8/linux-amd64",
expected: pkg.Package{
Name: "pilot-agent",
Version: "1.26.8",
Type: "binary",
PURL: "pkg:generic/istio@1.26.8",
Locations: locations("pilot-agent"),
Metadata: metadata("istio-binary"),
},
},
{
logicalFixture: "istio_pilot-agent/1.8.0/linux-amd64",
expected: pkg.Package{
Name: "pilot-agent",
Version: "1.8.0",
Type: "binary",
PURL: "pkg:generic/istio@1.8.0",
Locations: locations("pilot-agent"),
Metadata: metadata("istio-binary"),
},
},
{
logicalFixture: "istio_pilot-agent/1.1.17/linux-amd64",
expected: pkg.Package{
Name: "pilot-agent",
Version: "1.1.17",
Type: "binary",
PURL: "pkg:generic/istio@1.1.17",
Locations: locations("pilot-agent"),
Metadata: metadata("istio-binary"),
},
},
{ {
logicalFixture: "grafana/12.3.1/linux-amd64", logicalFixture: "grafana/12.3.1/linux-amd64",
expected: pkg.Package{ expected: pkg.Package{

View File

@ -697,6 +697,37 @@ func DefaultClassifiers() []binutils.Classifier {
PURL: mustPURL("pkg:generic/elixir@version"), PURL: mustPURL("pkg:generic/elixir@version"),
CPEs: singleCPE("cpe:2.3:a:elixir-lang:elixir:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource), CPEs: singleCPE("cpe:2.3:a:elixir-lang:elixir:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
}, },
{
Class: "istio-binary",
FileGlob: "**/pilot-discovery",
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<version>[0-9]+\.[0-9]+\.[0-9]+)\x00+`),
// Clean[NUL][NUL][NUL]1.8.0[NUL]
m.FileContentsVersionMatcher(`Clean\x00+(?P<version>[0-9]+\.[0-9]+\.[0-9]+)\x00+`),
// 1.1.17[NUL]...S=v<y5
m.FileContentsVersionMatcher(`(?s)(?P<version>[0-9]+\.[0-9]+\.[0-9]+)\x00+.{1,100}S?=v<y5`),
),
Package: "pilot-discovery",
PURL: mustPURL("pkg:generic/istio@version"),
CPEs: singleCPE("cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
{
Class: "istio-binary",
FileGlob: "**/pilot-agent",
EvidenceMatcher: binutils.MatchAny(
// [NUL]1.26.8[NUL][NUL]1.26.8[NUL]
m.FileContentsVersionMatcher(`[0-9]+\.[0-9]+\.[0-9]+\x00+(?P<version>[0-9]+\.[0-9]+\.[0-9]+)\x00+`),
// Clean[NUL][NUL][NUL]1.8.0[NUL]
m.FileContentsVersionMatcher(`Clean\x00+(?P<version>[0-9]+\.[0-9]+\.[0-9]+)\x00+`),
// 1.1.17[NUL]...S=v<y5
m.FileContentsVersionMatcher(`(?s)(?P<version>[0-9]+\.[0-9]+\.[0-9]+)\x00+.{1,100}S?=v<y5`),
),
Package: "pilot-agent",
PURL: mustPURL("pkg:generic/istio@version"),
CPEs: singleCPE("cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
{ {
Class: "grafana-binary", Class: "grafana-binary",
FileGlob: "**/grafana", FileGlob: "**/grafana",

View File

@ -853,6 +853,61 @@ from-images:
paths: paths:
- /usr/local/lib/python3.11/site-packages/opencv_contrib_python.libs/libavcodec-9aae324f.so.59.37.100 - /usr/local/lib/python3.11/site-packages/opencv_contrib_python.libs/libavcodec-9aae324f.so.59.37.100
- name: istio_pilot-discovery
version: 1.26.8
images:
- ref: istio/pilot:1.26.8@sha256:977d7941743cde8eb4868a00d8493ea3c18bb92622d5e6d9003c5d4f95780e69
platform: linux/amd64
paths:
- /usr/local/bin/pilot-discovery
- name: istio_pilot-discovery
version: 1.8.0
images:
- ref: istio/pilot:1.8.0@sha256:2a11b6eab182a62ba44686c6cee35a6fceae782c4aa5532f4ade023c8c177bd0
platform: linux/amd64
paths:
- /usr/local/bin/pilot-discovery
- name: istio_pilot-discovery
version: 1.3.8
images:
- ref: istio/pilot:1.3.8@sha256:e86394d237e1626f117cadea3588c5182d63b6a8712f9763ee419d4c72e7669b
platform: linux/amd64
paths:
- /usr/local/bin/pilot-discovery
- name: istio_pilot-discovery
version: 1.1.17
images:
- ref: istio/pilot:1.1.17@sha256:79a39ea04dbf7f9e36be80439d44f82968073eea307a58a6b073b551063ec629
platform: linux/amd64
paths:
- /usr/local/bin/pilot-discovery
- name: istio_pilot-agent
version: 1.26.8
images:
- ref: istio/proxyv2:1.26.8@sha256:a5ef82f7954bb4137244b7dbc1b4bd30382673c9425d74933da6f2de2c3a345b
platform: linux/amd64
paths:
- /usr/local/bin/pilot-agent
- name: istio_pilot-agent
version: 1.8.0
images:
- ref: istio/proxyv2:1.8.0@sha256:8721ddb5acf86dbe9d4c68993947c27d4b98a6d23ecde80246c74bf8bebd163f
platform: linux/amd64
paths:
- /usr/local/bin/pilot-agent
- name: istio_pilot-agent
version: 1.1.17
images:
- ref: istio/proxyv2:1.1.17@sha256:f97470c9b3124c19069ce9b773198da0efddbeea85dd33f88e2fb4f3b0c55e31
platform: linux/amd64
paths:
- /usr/local/bin/pilot-agent
- name: grafana - name: grafana
version: 12.3.1 version: 12.3.1
images: images: