mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
Feature: Add ffmpeg binary cataloger (#3994)
* Add ffmpeg binary cataloger Signed-off-by: Alan Pope <alan.pope@anchore.com> * add linux-amd64 snippet and test Signed-off-by: Alan Pope <alan.pope@anchore.com> * Widen scope of regex to two digit version numbers Signed-off-by: Alan Pope <alan.pope@anchore.com> * Add full test fixtures for ffmpeg Signed-off-by: Alan Pope <alan.pope@anchore.com> --------- Signed-off-by: Alan Pope <alan.pope@anchore.com>
This commit is contained in:
parent
ca21ccf21d
commit
ada74a8121
@ -1370,6 +1370,28 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
|
||||
Metadata: metadata("chrome-binary"),
|
||||
},
|
||||
},
|
||||
{
|
||||
logicalFixture: "ffmpeg/7.1.1/darwin-arm64",
|
||||
expected: pkg.Package{
|
||||
Name: "ffmpeg",
|
||||
Version: "7.1.1",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/ffmpeg@7.1.1",
|
||||
Locations: locations("ffmpeg"),
|
||||
Metadata: metadata("ffmpeg-binary"),
|
||||
},
|
||||
},
|
||||
{
|
||||
logicalFixture: "ffmpeg/6.1.1/linux-amd64",
|
||||
expected: pkg.Package{
|
||||
Name: "ffmpeg",
|
||||
Version: "6.1.1",
|
||||
Type: "binary",
|
||||
PURL: "pkg:generic/ffmpeg@6.1.1",
|
||||
Locations: locations("ffmpeg"),
|
||||
Metadata: metadata("ffmpeg-binary"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
@ -627,6 +627,18 @@ func DefaultClassifiers() []binutils.Classifier {
|
||||
PURL: mustPURL("pkg:generic/chrome@version"),
|
||||
CPEs: singleCPE("cpe:2.3:a:google:chrome:*:*:*:*:*:*:*:*"),
|
||||
},
|
||||
{
|
||||
Class: "ffmpeg-binary",
|
||||
FileGlob: "**/ffmpeg",
|
||||
EvidenceMatcher: m.FileContentsVersionMatcher(
|
||||
// Pattern found in the binary: "%s version 7.1.1" or "%s version 6.0"
|
||||
// When executed outputs: "ffmpeg version 7.1.1" or "ffmpeg version 6.0"
|
||||
`(?m)%s version (?P<version>[0-9]+\.[0-9]+(\.[0-9]+)?)`,
|
||||
),
|
||||
Package: "ffmpeg",
|
||||
PURL: mustPURL("pkg:generic/ffmpeg@version"),
|
||||
CPEs: singleCPE("cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
|
||||
},
|
||||
}
|
||||
|
||||
return append(classifiers, defaultJavaClassifiers()...)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -810,3 +810,23 @@ from-images:
|
||||
platform: linux/amd64
|
||||
paths:
|
||||
- /usr/local/bin/jq
|
||||
|
||||
- name: ffmpeg
|
||||
version: 8.0
|
||||
images:
|
||||
- ref: linuxserver/ffmpeg:version-8.0-cli@sha256:9d7e80710e7f11a276a4185f07e5e81db26fc7027ea70d1591f93ddf58e36ab4
|
||||
platform: linux/amd64
|
||||
- ref: linuxserver/ffmpeg:arm64v8-version-8.0-cli@sha256:0b6cf2e15a78094396f23a7cb3afaf7dffcad195573a2b97f190eae1ee1a0420
|
||||
platform: linux/arm64
|
||||
paths:
|
||||
- /usr/local/bin/ffmpeg
|
||||
|
||||
- name: ffmpeg
|
||||
version: 7.1.1
|
||||
images:
|
||||
- ref: linuxserver/ffmpeg:7.1.1@sha256:aea59a11c54291ac456bb2d67000445e5a8994f70bc3d96cdc29f022fbbf89fb
|
||||
platform: linux/amd64
|
||||
- ref: linuxserver/ffmpeg:arm64v8-7.1.1@sha256:b2aa507f205ea2dc32369c55d0f93b5649f1b39e42d9e6cd27bd53def7a63655
|
||||
platform: linux/arm64
|
||||
paths:
|
||||
- /usr/local/bin/ffmpeg
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user