Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rakudo Star binaries cataloger #3224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion syft/pkg/cataloger/binary/classifier_cataloger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("helm"),
},
},

{
logicalFixture: "rakudo-star/2024.08/linux-amd64",
expected: pkg.Package{
Name: "rakudo/star",
Version: "2024.08",
Type: "binary",
PURL: "pkg:generic/rakudo/[email protected]",
Locations: locations("rakudo-2024.08"),
Metadata: metadata("rakudo-star-binary"),
},
},
{
// note: dynamic (non-snippet) test case
logicalFixture: "redis-server/2.8.23/linux-amd64",
Expand Down
10 changes: 10 additions & 0 deletions syft/pkg/cataloger/binary/classifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,16 @@ func DefaultClassifiers() []Classifier {
PURL: mustPURL("pkg:generic/mariadb@version"),
CPEs: singleCPE("cpe:2.3:a:mariadb:mariadb:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
},
{
Class: "rakudo-star-binary",
FileGlob: "**/rakudo",
EvidenceMatcher: FileContentsVersionMatcher(
`(?m)Rakudo Star v(?P<version>[0-9]+\.[0-9]+)`,
),
Package: "rakudo/star",
PURL: mustPURL("pkg:generic/rakudo/star@version"),
CPEs: singleCPE("cpe:2.3:a:rakudo:star:*:*:*:*:*:*:*:*"),
},
{
Class: "rust-standard-library-linux",
FileGlob: "**/libstd-????????????????.so",
Expand Down
Binary file not shown.
16 changes: 16 additions & 0 deletions syft/pkg/cataloger/binary/test-fixtures/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,22 @@ from-images:
paths:
- /opt/pypy/bin/libpypy3.9-c.so

- name: rakudo-star
version: 2024.08
images:
- ref: rakudo-star:2024.08@sha256:71c8e816b299bbccf0d8df8c77b5aa39ad6d4495f368304ddf7b2bca888818f8
platform: linux/amd64
paths:
- /usr/bin/rakudo

- name: rakudo-star
version: 2024.08-alpine
images:
- ref: rakudo-star:2024.08-alpine@sha256:1cb1b203f0800f60f93a3221f2e02b8797094e1aed1fad3bc957fe4fc50fe9c6
platform: linux/amd64
paths:
- /usr/bin/rakudo

- version: 2.8.23
images:
- ref: redis:2.8.23@sha256:e507029ca6a11b85f8628ff16d7ff73ae54582f16fd757e64431f5ca6d27a13c
Expand Down
Loading