added bun binary classifier (#5103)

* added bun binary classifier

Signed-off-by: Rez Moss <hi@rezmoss.com>

* added bun binary classifier

Signed-off-by: Rez Moss <hi@rezmoss.com>

---------

Signed-off-by: Rez Moss <hi@rezmoss.com>
This commit is contained in:
Rez Moss 2026-07-27 10:18:50 -04:00 committed by GitHub
parent 8a229b16c4
commit 138d9ce2a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 116 additions and 0 deletions

View File

@ -433,6 +433,16 @@ catalogers:
cpes: cpes:
- cpe:2.3:a:deno:deno:*:*:*:*:*:*:*:* - cpe:2.3:a:deno:deno:*:*:*:*:*:*:*:*
type: BinaryPkg type: BinaryPkg
- method: glob
criteria:
- '**/bun'
packages:
- class: bun-binary
name: bun
purl: pkg:generic/bun
cpes:
- cpe:2.3:a:oven-sh:bun:*:*:*:*:*:*:*:*
type: BinaryPkg
- method: glob - method: glob
criteria: criteria:
- '**/ghc*' - '**/ghc*'

View File

@ -1565,6 +1565,50 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("deno-binary"), Metadata: metadata("deno-binary"),
}, },
}, },
{
logicalFixture: "bun/0.5.9/linux-amd64",
expected: pkg.Package{
Name: "bun",
Version: "0.5.9",
Type: "binary",
PURL: "pkg:generic/bun@0.5.9",
Locations: locations("bun"),
Metadata: metadata("bun-binary"),
},
},
{
logicalFixture: "bun/1.0.0/linux-amd64",
expected: pkg.Package{
Name: "bun",
Version: "1.0.0",
Type: "binary",
PURL: "pkg:generic/bun@1.0.0",
Locations: locations("bun"),
Metadata: metadata("bun-binary"),
},
},
{
logicalFixture: "bun/1.1.0/linux-amd64",
expected: pkg.Package{
Name: "bun",
Version: "1.1.0",
Type: "binary",
PURL: "pkg:generic/bun@1.1.0",
Locations: locations("bun"),
Metadata: metadata("bun-binary"),
},
},
{
logicalFixture: "bun/1.3.5/linux-amd64",
expected: pkg.Package{
Name: "bun",
Version: "1.3.5",
Type: "binary",
PURL: "pkg:generic/bun@1.3.5",
Locations: locations("bun"),
Metadata: metadata("bun-binary"),
},
},
{ {
logicalFixture: "haskell-ghc/7.10.3/linux-amd64", logicalFixture: "haskell-ghc/7.10.3/linux-amd64",
expected: pkg.Package{ expected: pkg.Package{

View File

@ -611,6 +611,20 @@ func DefaultClassifiers() []binutils.Classifier {
PURL: mustPURL("pkg:generic/deno@version"), PURL: mustPURL("pkg:generic/deno@version"),
CPEs: singleCPE("cpe:2.3:a:deno:deno:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource), CPEs: singleCPE("cpe:2.3:a:deno:deno:*:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource),
}, },
{
Class: "bun-binary",
FileGlob: "**/bun",
EvidenceMatcher: binutils.MatchAny(
// bun 1.1.0
// Bun v1.0.0
m.FileContentsVersionMatcher(`(?m)[Bb]un v?(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`),
// bun-1.1.0
m.FileContentsVersionMatcher(`(?m)bun-(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`),
),
Package: "bun",
PURL: mustPURL("pkg:generic/bun@version"),
CPEs: singleCPE("cpe:2.3:a:oven-sh:bun:*:*:*:*:*:*:*:*"),
},
{ {
Class: "haskell-ghc-binary", Class: "haskell-ghc-binary",
FileGlob: "**/ghc*", FileGlob: "**/ghc*",

View File

@ -0,0 +1,12 @@
name: bun
offset: 1000000
length: 100
snippetSha256: 0000000000000000000000000000000000000000000000000000000000000001
fileSha256: 0000000000000000000000000000000000000000000000000000000000000001
### byte snippet to follow ###
]
Bun v0.5.9
bun-0.5.9
JavaScript runtime for developing, testing, and bundling

View File

@ -0,0 +1,12 @@
name: bun
offset: 1000000
length: 100
snippetSha256: 0000000000000000000000000000000000000000000000000000000000000002
fileSha256: 0000000000000000000000000000000000000000000000000000000000000002
### byte snippet to follow ###
]
Bun v1.0.0
bun-1.0.0
JavaScript runtime for developing, testing, and bundling

View File

@ -0,0 +1,12 @@
name: bun
offset: 1000000
length: 100
snippetSha256: 0000000000000000000000000000000000000000000000000000000000000003
fileSha256: 0000000000000000000000000000000000000000000000000000000000000003
### byte snippet to follow ###
]
Bun v1.1.0
bun-1.1.0
JavaScript runtime for developing, testing, and bundling

View File

@ -0,0 +1,12 @@
name: bun
offset: 1000000
length: 100
snippetSha256: 0000000000000000000000000000000000000000000000000000000000000004
fileSha256: 0000000000000000000000000000000000000000000000000000000000000004
### byte snippet to follow ###
]
Bun v1.3.5
bun-1.3.5
JavaScript runtime for developing, testing, and bundling