mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
Added classifier for wordpress cli binary
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
This commit is contained in:
parent
3de5e98db1
commit
873f6e4037
@ -870,6 +870,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
|
|||||||
Metadata: metadata("gcc-binary"),
|
Metadata: metadata("gcc-binary"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
logicalFixture: "wp-cli/2.9.0/linux-amd64",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "wp-cli",
|
||||||
|
Version: "2.9.0",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/wp-cli@2.9.0",
|
||||||
|
Locations: locations("wp"),
|
||||||
|
Metadata: metadata("wordpress-cli-binary"),
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
@ -403,6 +403,17 @@ func DefaultClassifiers() []Classifier {
|
|||||||
PURL: mustPURL("pkg:generic/gcc@version"),
|
PURL: mustPURL("pkg:generic/gcc@version"),
|
||||||
CPEs: singleCPE("cpe:2.3:a:gnu:gcc:*:*:*:*:*:*:*:*"),
|
CPEs: singleCPE("cpe:2.3:a:gnu:gcc:*:*:*:*:*:*:*:*"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Class: "wordpress-cli-binary",
|
||||||
|
FileGlob: "**/wp",
|
||||||
|
EvidenceMatcher: FileContentsVersionMatcher(
|
||||||
|
// wp-cli/wp-cli 2.9.0'
|
||||||
|
`(?m)wp-cli/wp-cli (?P<version>[0-9]+\.[0-9]+\.[0-9]+)`,
|
||||||
|
),
|
||||||
|
Package: "wp-cli",
|
||||||
|
PURL: mustPURL("pkg:generic/wp-cli@version"),
|
||||||
|
CPEs: singleCPE("cpe:2.3:a:wp-cli:wp-cli:*:*:*:*:*:*:*:*"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/wp-cli-2.9.0/wp
Executable file
BIN
syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/wp-cli-2.9.0/wp
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user