mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 08:53:15 +01:00
Added OpenSSL binary matcher (#2416)
* Added OpenSSL binary matcher Signed-off-by: Laurent Goderre <laurent.goderre@docker.com> * chore: strip binary to smaller detection Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> --------- Signed-off-by: Laurent Goderre <laurent.goderre@docker.com> Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
parent
04e8c96822
commit
63e7a004cb
@ -763,6 +763,18 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) {
|
|||||||
Metadata: metadata("bash-binary"),
|
Metadata: metadata("bash-binary"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "positive-openssl-3.1.4",
|
||||||
|
fixtureDir: "test-fixtures/classifiers/positive/openssl-3.1.4",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "openssl",
|
||||||
|
Version: "3.1.4",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/openssl@3.1.4",
|
||||||
|
Locations: locations("openssl"),
|
||||||
|
Metadata: metadata("openssl-binary"),
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
@ -334,6 +334,17 @@ var defaultClassifiers = []classifier{
|
|||||||
PURL: mustPURL("pkg:generic/bash@version"),
|
PURL: mustPURL("pkg:generic/bash@version"),
|
||||||
CPEs: singleCPE("cpe:2.3:a:gnu:bash:*:*:*:*:*:*:*:*"),
|
CPEs: singleCPE("cpe:2.3:a:gnu:bash:*:*:*:*:*:*:*:*"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Class: "openssl-binary",
|
||||||
|
FileGlob: "**/openssl",
|
||||||
|
EvidenceMatcher: fileContentsVersionMatcher(
|
||||||
|
// [NUL]OpenSSL 3.1.4'
|
||||||
|
`\x00OpenSSL (?P<version>[0-9]+\.[0-9]+\.[0-9]+(-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:*:*:*:*:*:*:*:*"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// in both binaries and shared libraries, the version pattern is [NUL]3.11.2[NUL]
|
// in both binaries and shared libraries, the version pattern is [NUL]3.11.2[NUL]
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user