@cyclonedx/cdxgen 10.4.3 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/analyzer.js +1 -0
- package/bin/cdxgen.js +29 -2
- package/bin/repl.js +39 -0
- package/binary.js +2 -0
- package/data/crypto-oid.json +32 -0
- package/data/lic-mapping.json +14 -4
- package/data/templates/README.md +3 -0
- package/data/templates/asvs-4.0.3.cdx.json +2943 -0
- package/data/templates/bsimm-v13.cdx.json +1008 -0
- package/data/templates/masvs-2.0.0.cdx.json +225 -0
- package/data/templates/nist-ssdf-1.1.cdx.json +828 -0
- package/data/templates/pcissc-secure-slc-1.1.cdx.json +1027 -0
- package/data/templates/scvs-1.0.0.cdx.json +813 -0
- package/data/templates/ssaf-DRAFT-2023-11.cdx.json +127 -0
- package/display.js +55 -25
- package/envcontext.js +2 -1
- package/evinser.js +15 -6
- package/index.js +206 -79
- package/package.json +6 -6
- package/postgen.js +63 -0
- package/types/analyzer.d.ts.map +1 -1
- package/types/binary.d.ts.map +1 -1
- package/types/display.d.ts +2 -2
- package/types/display.d.ts.map +1 -1
- package/types/envcontext.d.ts.map +1 -1
- package/types/evinser.d.ts.map +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/postgen.d.ts +1 -0
- package/types/postgen.d.ts.map +1 -1
- package/types/utils.d.ts +22 -0
- package/types/utils.d.ts.map +1 -1
- package/utils.js +119 -5
- package/utils.test.js +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[](https://jsr.io/@cyclonedx/cdxgen) [](https://www.npmjs.com/package/@cyclonedx/cdxgen) [](https://github.com/CycloneDX/cdxgen/releases) [](<(https://www.npmjs.com/package/@cyclonedx/cdxgen)>) [](./LICENSE.md) [](https://github.com/CycloneDX/cdxgen/graphs/contributors)
|
|
2
2
|
|
|
3
|
+
[](https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/CycloneDX/cdxgen)
|
|
4
|
+
|
|
3
5
|
# CycloneDX Generator
|
|
4
6
|
|
|
5
7
|

|
|
@@ -9,7 +11,7 @@ cdxgen is a CLI tool, library, [REPL](./ADVANCED.md), and server to create a val
|
|
|
9
11
|
When used with plugins:
|
|
10
12
|
|
|
11
13
|
- cdxgen could generate an OBOM for Linux docker images and even VMs running Linux or Windows operating systems
|
|
12
|
-
- cdxgen also includes an evinse tool to generate component evidence, CBOM and SaaSBOM for some languages
|
|
14
|
+
- cdxgen also includes an evinse tool to generate component evidence, CBOM, and SaaSBOM for some languages
|
|
13
15
|
|
|
14
16
|
## Why cdxgen?
|
|
15
17
|
|
|
@@ -124,7 +126,7 @@ For the bun version, use `ghcr.io/cyclonedx/cdxgen-bun` as the image name.
|
|
|
124
126
|
docker run --rm -v /tmp:/tmp -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-bun -r /app -o /app/bom.json
|
|
125
127
|
```
|
|
126
128
|
|
|
127
|
-
In deno applications, cdxgen could be directly imported without any conversion. Please see the section on [integration as library](#integration-as-library)
|
|
129
|
+
In deno applications, cdxgen could be directly imported without any conversion. Please see the section on [integration as a library](#integration-as-library)
|
|
128
130
|
|
|
129
131
|
```ts
|
|
130
132
|
import { createBom, submitBom } from "npm:@cyclonedx/cdxgen@^9.0.1";
|
|
@@ -201,6 +203,13 @@ Options:
|
|
|
201
203
|
[boolean] [default: false]
|
|
202
204
|
--include-crypto Include crypto libraries found under formulation.
|
|
203
205
|
[boolean] [default: false]
|
|
206
|
+
--standard The list of standards which may consist of regula
|
|
207
|
+
tions, industry or organizational-specific standa
|
|
208
|
+
rds, maturity models, best practices, or any othe
|
|
209
|
+
r requirements which can be evaluated against or
|
|
210
|
+
attested to.
|
|
211
|
+
[array] [choices: "asvs-4.0.3", "bsimm-v13", "masvs-2.0.0", "nist_ssdf-1.1", "
|
|
212
|
+
pcissc-secure-slc-1.1", "scvs-1.0.0", "ssaf-DRAFT-2023-11"]
|
|
204
213
|
--auto-compositions Automatically set compositions when the BOM was f
|
|
205
214
|
iltered. Defaults to true
|
|
206
215
|
[boolean] [default: true]
|
package/analyzer.js
CHANGED
package/bin/cdxgen.js
CHANGED
|
@@ -244,11 +244,25 @@ const args = yargs(hideBin(process.argv))
|
|
|
244
244
|
default: false,
|
|
245
245
|
description: "Include crypto libraries found under formulation.",
|
|
246
246
|
})
|
|
247
|
+
.option("standard", {
|
|
248
|
+
description:
|
|
249
|
+
"The list of standards which may consist of regulations, industry or organizational-specific standards, maturity models, best practices, or any other requirements which can be evaluated against or attested to.",
|
|
250
|
+
choices: [
|
|
251
|
+
"asvs-4.0.3",
|
|
252
|
+
"bsimm-v13",
|
|
253
|
+
"masvs-2.0.0",
|
|
254
|
+
"nist_ssdf-1.1",
|
|
255
|
+
"pcissc-secure-slc-1.1",
|
|
256
|
+
"scvs-1.0.0",
|
|
257
|
+
"ssaf-DRAFT-2023-11",
|
|
258
|
+
],
|
|
259
|
+
})
|
|
247
260
|
.completion("completion", "Generate bash/zsh completion")
|
|
248
261
|
.array("filter")
|
|
249
262
|
.array("only")
|
|
250
263
|
.array("author")
|
|
251
264
|
.array("exclude")
|
|
265
|
+
.array("standard")
|
|
252
266
|
.option("auto-compositions", {
|
|
253
267
|
type: "boolean",
|
|
254
268
|
default: true,
|
|
@@ -318,7 +332,9 @@ if (process.argv[1].includes("cbom")) {
|
|
|
318
332
|
options.specVersion = 1.6;
|
|
319
333
|
options.deep = true;
|
|
320
334
|
}
|
|
321
|
-
|
|
335
|
+
if (options.standard) {
|
|
336
|
+
options.specVersion = 1.6;
|
|
337
|
+
}
|
|
322
338
|
/**
|
|
323
339
|
* Method to apply advanced options such as profile and lifecycles
|
|
324
340
|
*
|
|
@@ -442,7 +458,12 @@ const checkPermissions = (filePath) => {
|
|
|
442
458
|
options.usagesSlicesFile = `${options.projectName}-usages.json`;
|
|
443
459
|
}
|
|
444
460
|
let bomNSData = (await createBom(filePath, options)) || {};
|
|
445
|
-
if (
|
|
461
|
+
if (
|
|
462
|
+
options.requiredOnly ||
|
|
463
|
+
options["filter"] ||
|
|
464
|
+
options["only"] ||
|
|
465
|
+
options.standard
|
|
466
|
+
) {
|
|
446
467
|
bomNSData = postProcess(bomNSData, options);
|
|
447
468
|
}
|
|
448
469
|
if (
|
|
@@ -666,5 +687,11 @@ const checkPermissions = (filePath) => {
|
|
|
666
687
|
if (options.print && bomNSData.bomJson && bomNSData.bomJson.components) {
|
|
667
688
|
printDependencyTree(bomNSData.bomJson);
|
|
668
689
|
printTable(bomNSData.bomJson);
|
|
690
|
+
// CBOM related print
|
|
691
|
+
if (options.includeCrypto) {
|
|
692
|
+
console.log("*** Cryptography BOM ***");
|
|
693
|
+
printTable(bomNSData.bomJson, ["cryptographic-asset"]);
|
|
694
|
+
printDependencyTree(bomNSData.bomJson, "provides");
|
|
695
|
+
}
|
|
669
696
|
}
|
|
670
697
|
})();
|
package/bin/repl.js
CHANGED
|
@@ -244,6 +244,32 @@ cdxgenRepl.defineCommand("print", {
|
|
|
244
244
|
this.displayPrompt();
|
|
245
245
|
},
|
|
246
246
|
});
|
|
247
|
+
cdxgenRepl.defineCommand("cryptos", {
|
|
248
|
+
help: "print the components of type cryptographic-asset as a table",
|
|
249
|
+
action() {
|
|
250
|
+
if (sbom) {
|
|
251
|
+
printTable(sbom, ["cryptographic-asset"]);
|
|
252
|
+
} else {
|
|
253
|
+
console.log(
|
|
254
|
+
"⚠ No BOM is loaded. Use .import command to import an existing BOM",
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
this.displayPrompt();
|
|
258
|
+
},
|
|
259
|
+
});
|
|
260
|
+
cdxgenRepl.defineCommand("frameworks", {
|
|
261
|
+
help: "print the components of type framework as a table",
|
|
262
|
+
action() {
|
|
263
|
+
if (sbom) {
|
|
264
|
+
printTable(sbom, ["framework"]);
|
|
265
|
+
} else {
|
|
266
|
+
console.log(
|
|
267
|
+
"⚠ No BOM is loaded. Use .import command to import an existing BOM",
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
this.displayPrompt();
|
|
271
|
+
},
|
|
272
|
+
});
|
|
247
273
|
cdxgenRepl.defineCommand("tree", {
|
|
248
274
|
help: "display the dependency tree",
|
|
249
275
|
action() {
|
|
@@ -257,6 +283,19 @@ cdxgenRepl.defineCommand("tree", {
|
|
|
257
283
|
this.displayPrompt();
|
|
258
284
|
},
|
|
259
285
|
});
|
|
286
|
+
cdxgenRepl.defineCommand("provides", {
|
|
287
|
+
help: "display the provides tree",
|
|
288
|
+
action() {
|
|
289
|
+
if (sbom) {
|
|
290
|
+
printDependencyTree(sbom, "provides");
|
|
291
|
+
} else {
|
|
292
|
+
console.log(
|
|
293
|
+
"⚠ No BOM is loaded. Use .import command to import an existing BOM",
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
this.displayPrompt();
|
|
297
|
+
},
|
|
298
|
+
});
|
|
260
299
|
cdxgenRepl.defineCommand("validate", {
|
|
261
300
|
help: "validate the bom using jsonschema",
|
|
262
301
|
action() {
|
package/binary.js
CHANGED
|
@@ -245,6 +245,8 @@ const OS_DISTRO_ALIAS = {
|
|
|
245
245
|
"ubuntu-20.10": "groovy",
|
|
246
246
|
"ubuntu-22.04": "jammy",
|
|
247
247
|
"ubuntu-23.04": "lunar",
|
|
248
|
+
"ubuntu-23.10": "mantic",
|
|
249
|
+
"ubuntu-24.04": "noble",
|
|
248
250
|
"debian-14": "forky",
|
|
249
251
|
"debian-14.5": "forky",
|
|
250
252
|
"debian-13": "trixie",
|
package/data/crypto-oid.json
CHANGED
|
@@ -1946,5 +1946,37 @@
|
|
|
1946
1946
|
"sm2sign_with_": {
|
|
1947
1947
|
"oid": "1.2.156.10197.1.501",
|
|
1948
1948
|
"description": "Chinese Cryptography Standardization Technology Committee (CCSTC)"
|
|
1949
|
+
},
|
|
1950
|
+
"PBKDF2": {
|
|
1951
|
+
"oid": "1.2.840.113549.1.5.12",
|
|
1952
|
+
"description": "PBKDF2 key derivation algorithm"
|
|
1953
|
+
},
|
|
1954
|
+
"pbeWithMD2AndDES-CBC": {
|
|
1955
|
+
"oid": "1.2.840.113549.1.5.1",
|
|
1956
|
+
"description": "Password Based Encryption Algorithm"
|
|
1957
|
+
},
|
|
1958
|
+
"pbeWithMD5AndDES-CBC": {
|
|
1959
|
+
"oid": "1.2.840.113549.1.5.3",
|
|
1960
|
+
"description": "Password Based Encryption Algorithm"
|
|
1961
|
+
},
|
|
1962
|
+
"pbeWithMD2AndRC2-CBC": {
|
|
1963
|
+
"oid": "1.2.840.113549.1.5.4",
|
|
1964
|
+
"description": "Password Based Encryption Algorithm. Uses RC2 in Cipher Block Chaining Mode (RC2-CBC)"
|
|
1965
|
+
},
|
|
1966
|
+
"pbeWithMD5AndRC2-CBC": {
|
|
1967
|
+
"oid": "1.2.840.113549.1.5.6",
|
|
1968
|
+
"description": "Password Based Encryption Algorithm. Uses RC2 in Cipher Block Chaining Mode (RC2-CBC)"
|
|
1969
|
+
},
|
|
1970
|
+
"pbeWithMD5AndXOR": {
|
|
1971
|
+
"oid": "1.2.840.113549.1.5.9",
|
|
1972
|
+
"description": "Password Based Encryption Algorithm. Uses XOR. Uses MD5 to hash a password & salt to get Key and IV."
|
|
1973
|
+
},
|
|
1974
|
+
"pbeWithSHA1AndDES-CBC": {
|
|
1975
|
+
"oid": "1.2.840.113549.1.5.10",
|
|
1976
|
+
"description": "Password Based Encryption Algorithm. Uses Data Encryption Standard in Cipher Block Chaining Mode (DES-CBC)"
|
|
1977
|
+
},
|
|
1978
|
+
"pbeWithSHA1AndRC2-CBC": {
|
|
1979
|
+
"oid": "1.2.840.113549.1.5.11",
|
|
1980
|
+
"description": "Password Based Encryption Algorithm. Uses RC2 in Cipher Block Chaining Mode (RC2-CBC)."
|
|
1949
1981
|
}
|
|
1950
1982
|
}
|
package/data/lic-mapping.json
CHANGED
|
@@ -174,7 +174,8 @@
|
|
|
174
174
|
"GNU Lesser General Public License",
|
|
175
175
|
"GNU Lesser General Public License Version 2.1",
|
|
176
176
|
"GNU Lesser General Public License Version 2.1, February 1999",
|
|
177
|
-
"GNU Library or Lesser General Public License (LGPL) V2.1"
|
|
177
|
+
"GNU Library or Lesser General Public License (LGPL) V2.1",
|
|
178
|
+
"GNU Library or Lesser General Public License (LGPL)"
|
|
178
179
|
]
|
|
179
180
|
},
|
|
180
181
|
{
|
|
@@ -192,6 +193,7 @@
|
|
|
192
193
|
"LGPL v3.0",
|
|
193
194
|
"LGPL-3.0",
|
|
194
195
|
"LGPL3.0",
|
|
196
|
+
"LGPL 3",
|
|
195
197
|
"GNU Lesser General Public License (LGPL), version 3",
|
|
196
198
|
"GNU Lesser General Public License (LGPL), version 3.0",
|
|
197
199
|
"GNU Lesser General Public License v3.0",
|
|
@@ -203,9 +205,15 @@
|
|
|
203
205
|
"names": [
|
|
204
206
|
"GNU Lesser General Public License (LGPL), version 3 or later",
|
|
205
207
|
"GNU Lesser General Public License (LGPL), version 3.0 or later",
|
|
206
|
-
"GNU Lesser General Public License v3.0 or later"
|
|
208
|
+
"GNU Lesser General Public License v3.0 or later",
|
|
209
|
+
"GNU Lesser General Public License v3 or later (LGPLv3+)",
|
|
210
|
+
"LGPLv3+"
|
|
207
211
|
]
|
|
208
212
|
},
|
|
213
|
+
{
|
|
214
|
+
"exp": "GPL-1.0-only",
|
|
215
|
+
"names": ["GNU General Public License (GPL)"]
|
|
216
|
+
},
|
|
209
217
|
{
|
|
210
218
|
"exp": "GPL-2.0-only",
|
|
211
219
|
"names": [
|
|
@@ -217,7 +225,8 @@
|
|
|
217
225
|
"GNU General Public License v2.0",
|
|
218
226
|
"GNU General Public License Version 2",
|
|
219
227
|
"GNU General Public License, version 2",
|
|
220
|
-
"GNU General Public License as published by the Free Software Foundation; version 2."
|
|
228
|
+
"GNU General Public License as published by the Free Software Foundation; version 2.",
|
|
229
|
+
"GNU General Public License v2 (GPLv2)"
|
|
221
230
|
]
|
|
222
231
|
},
|
|
223
232
|
{
|
|
@@ -251,7 +260,8 @@
|
|
|
251
260
|
"GNU General Public License v3.0",
|
|
252
261
|
"GNU General Public License as published by the Free Software Foundation, version 3.",
|
|
253
262
|
"GPL-3",
|
|
254
|
-
"GPL-3.0"
|
|
263
|
+
"GPL-3.0",
|
|
264
|
+
"GNU GPL 3"
|
|
255
265
|
]
|
|
256
266
|
},
|
|
257
267
|
{
|