-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add binary classifiers for lighttp, proftpd, zstd, xz, gzip, jq…
…, and sqlcipher (#3252) * feat: detect lighttpd binaries Signed-off-by: Krystian Gorny <[email protected]> * feat: detect proftpd binaries Signed-off-by: Krystian Gorny <[email protected]> * feat: detect zstd binaries Signed-off-by: Krystian Gorny <[email protected]> * feat: detect xz utils binarie Signed-off-by: Krystian Gorny <[email protected]> * feat: detect gzip binaries Signed-off-by: Krystian Gorny <[email protected]> * feat: detect sqlcipher binaries Signed-off-by: Krystian Gorny <[email protected]> * feat: detect jq binaries Signed-off-by: Krystian Gorny <[email protected]> * add tests + snippets Signed-off-by: Alex Goodman <[email protected]> --------- Signed-off-by: Krystian Gorny <[email protected]> Signed-off-by: Alex Goodman <[email protected]> Co-authored-by: Krystian Gorny <[email protected]> Co-authored-by: Alex Goodman <[email protected]>
- Loading branch information
1 parent
cb0de97
commit 6a95a5f
Showing
10 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1082,6 +1082,94 @@ func Test_Cataloger_PositiveCases(t *testing.T) { | |
Metadata: metadata("wordpress-cli-binary"), | ||
}, | ||
}, | ||
{ | ||
logicalFixture: "lighttpd/1.4.76/linux-amd64", | ||
expected: pkg.Package{ | ||
Name: "lighttpd", | ||
Version: "1.4.76", | ||
Type: "binary", | ||
PURL: "pkg:generic/[email protected]", | ||
Locations: locations("lighttpd"), | ||
Metadata: metadata("lighttpd-binary"), | ||
}, | ||
}, | ||
{ | ||
logicalFixture: "proftpd/1.3.8b/linux-amd64", | ||
expected: pkg.Package{ | ||
Name: "proftpd", | ||
Version: "1.3.8b", | ||
Type: "binary", | ||
PURL: "pkg:generic/[email protected]", | ||
Locations: locations("proftpd"), | ||
Metadata: metadata("proftpd-binary"), | ||
}, | ||
}, | ||
{ | ||
logicalFixture: "zstd/1.5.6/linux-amd64", | ||
expected: pkg.Package{ | ||
Name: "zstd", | ||
Version: "1.5.6", | ||
Type: "binary", | ||
PURL: "pkg:generic/[email protected]", | ||
Locations: locations("zstd"), | ||
Metadata: metadata("zstd-binary"), | ||
}, | ||
}, | ||
{ | ||
logicalFixture: "zstd/1.5.6/linux-amd64", | ||
expected: pkg.Package{ | ||
Name: "zstd", | ||
Version: "1.5.6", | ||
Type: "binary", | ||
PURL: "pkg:generic/[email protected]", | ||
Locations: locations("zstd"), | ||
Metadata: metadata("zstd-binary"), | ||
}, | ||
}, | ||
{ | ||
logicalFixture: "xz/5.6.2/linux-amd64", | ||
expected: pkg.Package{ | ||
Name: "xz", | ||
Version: "5.6.2", | ||
Type: "binary", | ||
PURL: "pkg:generic/[email protected]", | ||
Locations: locations("xz"), | ||
Metadata: metadata("xz-binary"), | ||
}, | ||
}, | ||
{ | ||
logicalFixture: "gzip/1.12/linux-amd64", | ||
expected: pkg.Package{ | ||
Name: "gzip", | ||
Version: "1.12", | ||
Type: "binary", | ||
PURL: "pkg:generic/[email protected]", | ||
Locations: locations("gzip"), | ||
Metadata: metadata("gzip-binary"), | ||
}, | ||
}, | ||
{ | ||
logicalFixture: "sqlcipher/4.5.5/linux-amd64", | ||
expected: pkg.Package{ | ||
Name: "sqlcipher", | ||
Version: "4.5.5", | ||
Type: "binary", | ||
PURL: "pkg:generic/[email protected]", | ||
Locations: locations("sqlcipher"), | ||
Metadata: metadata("sqlcipher-binary"), | ||
}, | ||
}, | ||
{ | ||
logicalFixture: "jq/1.7.1/linux-amd64", | ||
expected: pkg.Package{ | ||
Name: "jq", | ||
Version: "1.7.1", | ||
Type: "binary", | ||
PURL: "pkg:generic/[email protected]", | ||
Locations: locations("jq"), | ||
Metadata: metadata("jq-binary"), | ||
}, | ||
}, | ||
} | ||
|
||
for _, test := range tests { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+346 Bytes
syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/gzip/1.12/linux-amd64/gzip
Binary file not shown.
Binary file added
BIN
+346 Bytes
syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/jq/1.7.1/linux-amd64/jq
Binary file not shown.
Binary file added
BIN
+351 Bytes
.../cataloger/binary/test-fixtures/classifiers/snippets/lighttpd/1.4.76/linux-amd64/lighttpd
Binary file not shown.
Binary file added
BIN
+350 Bytes
...kg/cataloger/binary/test-fixtures/classifiers/snippets/proftpd/1.3.8b/linux-amd64/proftpd
Binary file not shown.
Binary file added
BIN
+353 Bytes
...cataloger/binary/test-fixtures/classifiers/snippets/sqlcipher/4.5.5/linux-amd64/sqlcipher
Binary file not shown.
Binary file added
BIN
+344 Bytes
syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/xz/5.6.2/linux-amd64/xz
Binary file not shown.
Binary file added
BIN
+348 Bytes
syft/pkg/cataloger/binary/test-fixtures/classifiers/snippets/zstd/1.5.6/linux-amd64/zstd
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters