mirror of
https://github.com/anchore/syft
synced 2024-11-10 14:24:12 +00:00
feat: add perl binary classifier (#1592)
Signed-off-by: Benji Visser <benji@093b.org>
This commit is contained in:
parent
bb52a25c8a
commit
e84ffc6003
5 changed files with 51 additions and 0 deletions
|
@ -173,6 +173,48 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "positive-perl-5.12.5",
|
||||
fixtureDir: "test-fixtures/classifiers/positive/perl-5.12.5",
|
||||
expected: pkg.Package{
|
||||
Name: "perl",
|
||||
Version: "5.12.5",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/perl@5.12.5",
|
||||
Locations: singleLocation("perl"),
|
||||
Metadata: pkg.BinaryMetadata{
|
||||
Classifier: "perl-binary",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "positive-perl-5.20.0",
|
||||
fixtureDir: "test-fixtures/classifiers/positive/perl-5.20.0",
|
||||
expected: pkg.Package{
|
||||
Name: "perl",
|
||||
Version: "5.20.0",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/perl@5.20.0",
|
||||
Locations: singleLocation("perl"),
|
||||
Metadata: pkg.BinaryMetadata{
|
||||
Classifier: "perl-binary",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "positive-perl-5.37.8",
|
||||
fixtureDir: "test-fixtures/classifiers/positive/perl-5.37.8",
|
||||
expected: pkg.Package{
|
||||
Name: "perl",
|
||||
Version: "5.37.8",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/perl@5.37.8",
|
||||
Locations: singleLocation("perl"),
|
||||
Metadata: pkg.BinaryMetadata{
|
||||
Classifier: "perl-binary",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "positive-redis-2.8.23",
|
||||
fixtureDir: "test-fixtures/classifiers/positive/redis-server-2.8.23",
|
||||
|
|
|
@ -120,6 +120,15 @@ var defaultClassifiers = []classifier{
|
|||
Package: "busybox",
|
||||
CPEs: singleCPE("cpe:2.3:a:busybox:busybox:*:*:*:*:*:*:*:*"),
|
||||
},
|
||||
{
|
||||
Class: "perl-binary",
|
||||
FileGlob: "**/perl",
|
||||
EvidenceMatcher: fileContentsVersionMatcher(
|
||||
`(?m)\/usr\/local\/lib\/perl\d\/(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`),
|
||||
Package: "perl",
|
||||
PURL: mustPURL("pkg:generic/perl@version"),
|
||||
CPEs: singleCPE("cpe:2.3:a:perl:perl:*:*:*:*:*:*:*:*"),
|
||||
},
|
||||
{
|
||||
Class: "php-cli-binary",
|
||||
FileGlob: "**/php*",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue