add valkey classifier (#4509)

* add valkey classifier
Signed-off-by: witchcraze <witchcraze@gmail.com>

* fix test path
Signed-off-by: witchcraze <witchcraze@gmail.com>

* Run 'go generate ./internal/capabilities'
Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
witchcraze 2026-01-05 23:40:35 +09:00 committed by GitHub
parent 1e15428c6f
commit 15af992225
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 44 additions and 0 deletions

View File

@ -87,6 +87,18 @@ catalogers:
- cpe:2.3:a:redislabs:redis:*:*:*:*:*:*:*:*
- cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:*
type: BinaryPkg
- method: glob
criteria:
- '**/valkey-server'
packages:
- class: valkey-binary
name: valkey
purl: pkg:generic/valkey
cpes:
- cpe:2.3:a:lfprojects:valkey:*:*:*:*:*:*:*:*
- cpe:2.3:a:linuxfoundation:valkey:*:*:*:*:*:*:*:*
- cpe:2.3:a:valkey-io:valkey:*:*:*:*:*:*:*:*
type: BinaryPkg
- method: glob
criteria:
- '**/node'

View File

@ -469,6 +469,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("redis-binary"),
},
},
{
logicalFixture: "valkey-server/9.0.0/linux-amd64",
expected: pkg.Package{
Name: "valkey",
Version: "9.0.0",
Type: "binary",
PURL: "pkg:generic/valkey@9.0.0",
Locations: locations("valkey-server"),
Metadata: metadata("valkey-binary"),
},
},
{
logicalFixture: "python-shared-lib/3.7.4/linux-amd64",
expected: pkg.Package{

View File

@ -113,6 +113,20 @@ func DefaultClassifiers() []binutils.Classifier {
cpe.Must("cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
},
{
Class: "valkey-binary",
FileGlob: "**/valkey-server",
EvidenceMatcher: m.FileContentsVersionMatcher(
// valkey9.0.0buildkitsandbox-1764887574000000000
`[^\d](?P<version>\d+.\d+\.\d+)buildkitsandbox-\d+`),
Package: "valkey",
PURL: mustPURL("pkg:generic/valkey@version"),
CPEs: []cpe.CPE{
cpe.Must("cpe:2.3:a:lfprojects:valkey:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
cpe.Must("cpe:2.3:a:linuxfoundation:valkey:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
cpe.Must("cpe:2.3:a:valkey-io:valkey:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
},
{
Class: "nodejs-binary",
FileGlob: "**/node",

View File

@ -513,6 +513,13 @@ from-images:
paths:
- /usr/local/bin/redis-server
- version: 9.0.0
images:
- ref: valkey/valkey:9.0.0@sha256:42ea97850708540d4e05f6241cfbd241c1ba502e64d9a42efb2c2e277a8ca9d6
platform: linux/amd64
paths:
- /usr/local/bin/valkey-server
- version: 2.9.0
images:
- ref: wordpress:cli-2.9.0-php8.3@sha256:3a008aafccc6a8d2d7ec2b069722cb43b3569b61cd833f9f2f13d74a9284746e