mirror of
https://github.com/anchore/syft.git
synced 2026-05-20 12:15:27 +02:00
feat: add aws-lc classifier (#4882)
Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
parent
4f0e32ab51
commit
e2007d9bf2
@ -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 {
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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{
|
||||||
|
|||||||
@ -564,14 +564,29 @@ func DefaultClassifiers() []binutils.Classifier {
|
|||||||
{
|
{
|
||||||
Class: "openssl-binary",
|
Class: "openssl-binary",
|
||||||
FileGlob: "**/openssl",
|
FileGlob: "**/openssl",
|
||||||
EvidenceMatcher: m.FileContentsVersionMatcher(
|
EvidenceMatcher: binutils.BranchingEvidenceMatcher([]binutils.Classifier{
|
||||||
// [NUL]OpenSSL 3.1.4'
|
{
|
||||||
// [NUL]OpenSSL 1.1.1w'
|
Class: "openssl-binary-aws-lc",
|
||||||
`\x00OpenSSL (?P<version>[0-9]+\.[0-9]+\.[0-9]+([a-z]+|-alpha[0-9]|-beta[0-9]|-rc[0-9])?)`,
|
EvidenceMatcher: m.FileContentsVersionMatcher(
|
||||||
),
|
// [NUL]OpenSSL 1.1.1 (compatible; AWS-LC 1.69.0)[NUL]
|
||||||
Package: "openssl",
|
`AWS-LC (?P<version>[0-9]+\.[0-9]+\.[0-9]+)\)\x00`,
|
||||||
PURL: mustPURL("pkg:generic/openssl@version"),
|
),
|
||||||
CPEs: singleCPE("cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
|
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(
|
||||||
|
// [NUL]OpenSSL 3.1.4'
|
||||||
|
// [NUL]OpenSSL 1.1.1w'
|
||||||
|
`\x00OpenSSL (?P<version>[0-9]+\.[0-9]+\.[0-9]+([a-z]+|-alpha[0-9]|-beta[0-9]|-rc[0-9])?)`,
|
||||||
|
),
|
||||||
|
Package: "openssl",
|
||||||
|
PURL: mustPURL("pkg:generic/openssl@version"),
|
||||||
|
CPEs: singleCPE("cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
|
||||||
|
},
|
||||||
|
}...),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Class: "openldap-search-binary",
|
Class: "openldap-search-binary",
|
||||||
|
|||||||
BIN
syft/pkg/cataloger/binary/testdata/classifiers/snippets/aws-lc/1.69.0/linux-amd64/openssl
vendored
Normal file
BIN
syft/pkg/cataloger/binary/testdata/classifiers/snippets/aws-lc/1.69.0/linux-amd64/openssl
vendored
Normal file
Binary file not shown.
10
syft/pkg/cataloger/binary/testdata/config.yaml
vendored
10
syft/pkg/cataloger/binary/testdata/config.yaml
vendored
@ -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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user