mirror of
https://github.com/anchore/syft.git
synced 2026-02-12 10:36:45 +01:00
feat: add memcached classifier (#1486)
Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
parent
09a5baf523
commit
7427445fe9
@ -17,6 +17,20 @@ func TestClassifierCataloger_DefaultClassifiers_PositiveCases(t *testing.T) {
|
|||||||
fixtureDir string
|
fixtureDir string
|
||||||
expected pkg.Package
|
expected pkg.Package
|
||||||
}{
|
}{
|
||||||
|
{
|
||||||
|
name: "positive-memcached-1.6.18",
|
||||||
|
fixtureDir: "test-fixtures/classifiers/positive/memcached-1.6.18",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "memcached",
|
||||||
|
Version: "1.6.18",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/memcached@1.6.18",
|
||||||
|
Locations: singleLocation("memcached"),
|
||||||
|
Metadata: pkg.BinaryMetadata{
|
||||||
|
Classifier: "memcached-binary",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "positive-httpd-2.4.54",
|
name: "positive-httpd-2.4.54",
|
||||||
fixtureDir: "test-fixtures/classifiers/positive/httpd-2.4.54",
|
fixtureDir: "test-fixtures/classifiers/positive/httpd-2.4.54",
|
||||||
@ -30,7 +44,8 @@ func TestClassifierCataloger_DefaultClassifiers_PositiveCases(t *testing.T) {
|
|||||||
Classifier: "httpd-binary",
|
Classifier: "httpd-binary",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
name: "positive-php-cli-8.2.1",
|
name: "positive-php-cli-8.2.1",
|
||||||
fixtureDir: "test-fixtures/classifiers/positive/php-cli-8.2.1",
|
fixtureDir: "test-fixtures/classifiers/positive/php-cli-8.2.1",
|
||||||
expected: pkg.Package{
|
expected: pkg.Package{
|
||||||
|
|||||||
@ -141,4 +141,12 @@ var defaultClassifiers = []classifier{
|
|||||||
PURL: mustPURL("pkg:generic/httpd@version"),
|
PURL: mustPURL("pkg:generic/httpd@version"),
|
||||||
CPEs: singleCPE("cpe:2.3:a:apache:http_server:*:*:*:*:*:*:*:*"),
|
CPEs: singleCPE("cpe:2.3:a:apache:http_server:*:*:*:*:*:*:*:*"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Class: "memcached-binary",
|
||||||
|
FileGlob: "**/memcached",
|
||||||
|
EvidenceMatcher: fileContentsVersionMatcher(
|
||||||
|
`(?m)memcached\s(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`),
|
||||||
|
Package: "memcached",
|
||||||
|
PURL: mustPURL("pkg:generic/memcached@version"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
secs_since_last_cmd
|
||||||
|
listen
|
||||||
|
memcached 1.6.18
|
||||||
|
udp-port
|
||||||
|
memcached 1.6.18
|
||||||
|
Failed to allocate memory
|
||||||
|
%s,%s
|
||||||
|
--
|
||||||
|
bget
|
||||||
|
flush_all
|
||||||
|
VERSION 1.6.18
|
||||||
|
quit
|
||||||
|
BADCLASS invalid class id
|
||||||
Loading…
x
Reference in New Issue
Block a user