feat: add aws-lc classifier (#4882)

Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
witchcraze 2026-05-07 05:43:34 +09:00 committed by GitHub
parent 4f0e32ab51
commit e2007d9bf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 68 additions and 9 deletions

View File

@ -96,6 +96,20 @@ var binaryClassifierOverrides = map[string][]binaryClassifierOverride{
CPEs: singleCPE("cpe:2.3:a:oracle:jdk:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource), CPEs: singleCPE("cpe:2.3:a:oracle:jdk:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
}, },
}, },
"openssl-binary": {
{
Class: "openssl-binary-aws-lc",
Package: "aws-lc",
PURL: mustPURL("pkg:generic/aws-lc@version"),
CPEs: singleCPE("cpe:2.3:a:amazon:aws_libcrypto:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
{
Class: "openssl-binary",
Package: "openssl",
PURL: mustPURL("pkg:generic/openssl@version"),
CPEs: singleCPE("cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
},
} }
func mustPURL(purl string) string { func mustPURL(purl string) string {

View File

@ -427,6 +427,17 @@ catalogers:
criteria: criteria:
- '**/openssl' - '**/openssl'
packages: packages:
- class: openssl-binary
name: ""
purl: pkg:/
cpes: []
type: BinaryPkg
- class: openssl-binary-aws-lc
name: aws-lc
purl: pkg:generic/aws-lc
cpes:
- cpe:2.3:a:amazon:aws_libcrypto:*:*:*:*:*:*:*:*
type: BinaryPkg
- class: openssl-binary - class: openssl-binary
name: openssl name: openssl
purl: pkg:generic/openssl purl: pkg:generic/openssl

View File

@ -1485,6 +1485,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("openssl-binary"), Metadata: metadata("openssl-binary"),
}, },
}, },
{
logicalFixture: "aws-lc/1.69.0/linux-amd64",
expected: pkg.Package{
Name: "aws-lc",
Version: "1.69.0",
Type: "binary",
PURL: "pkg:generic/aws-lc@1.69.0",
Locations: locations("openssl"),
Metadata: metadata("openssl-binary-aws-lc"),
},
},
{ {
logicalFixture: "openldap/2.6.10/linux-amd64", logicalFixture: "openldap/2.6.10/linux-amd64",
expected: pkg.Package{ expected: pkg.Package{

View File

@ -564,6 +564,19 @@ func DefaultClassifiers() []binutils.Classifier {
{ {
Class: "openssl-binary", Class: "openssl-binary",
FileGlob: "**/openssl", FileGlob: "**/openssl",
EvidenceMatcher: binutils.BranchingEvidenceMatcher([]binutils.Classifier{
{
Class: "openssl-binary-aws-lc",
EvidenceMatcher: m.FileContentsVersionMatcher(
// [NUL]OpenSSL 1.1.1 (compatible; AWS-LC 1.69.0)[NUL]
`AWS-LC (?P<version>[0-9]+\.[0-9]+\.[0-9]+)\)\x00`,
),
Package: "aws-lc",
PURL: mustPURL("pkg:generic/aws-lc@version"),
CPEs: singleCPE("cpe:2.3:a:amazon:aws_libcrypto:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
{
Class: "openssl-binary",
EvidenceMatcher: m.FileContentsVersionMatcher( EvidenceMatcher: m.FileContentsVersionMatcher(
// [NUL]OpenSSL 3.1.4' // [NUL]OpenSSL 3.1.4'
// [NUL]OpenSSL 1.1.1w' // [NUL]OpenSSL 1.1.1w'
@ -573,6 +586,8 @@ func DefaultClassifiers() []binutils.Classifier {
PURL: mustPURL("pkg:generic/openssl@version"), PURL: mustPURL("pkg:generic/openssl@version"),
CPEs: singleCPE("cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource), CPEs: singleCPE("cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
}, },
}...),
},
{ {
Class: "openldap-search-binary", Class: "openldap-search-binary",
FileGlob: "**/ldapsearch", FileGlob: "**/ldapsearch",

View File

@ -919,11 +919,19 @@ from-images:
- name: openssl - name: openssl
version: 1.1.1w version: 1.1.1w
images: images:
- ref: openresty/openresty:1.25.3.1-2-alpine@sha256:b1cb45b1556801b8cb1bc29ea78faf2eaf67926a37b052dd070866e44d7df07a - ref: openresty/openresty:1.25.3.1-2-alpine@sha256:6c24f25318e5ecf0c981bec584842af329552a538fe48a24ec25387374c652b2
platform: linux/arm64 platform: linux/arm64
paths: paths:
- /usr/local/openresty/openssl/bin/openssl - /usr/local/openresty/openssl/bin/openssl
- name: aws-lc
version: 1.69.0
images:
- ref: haproxytech/haproxy-alpine:3.3.8@sha256:ba237771cc7e734b4449829b09d107012c8d7578d77487b8453207e7ca851996
platform: linux/amd64
paths:
- /opt/aws-lc/bin/openssl
- name: openldap - name: openldap
version: 2.6.10 version: 2.6.10
images: images: