@cyclonedx/cdxgen 12.1.0 → 12.1.2
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 +17 -1
- package/bin/dependencies.js +36 -36
- package/bin/licenses.js +78 -0
- package/data/spdx.schema.json +35 -2
- package/data/templates/asvs-5.0.cdx.json +1727 -3471
- package/lib/cli/index.js +32 -3
- package/lib/helpers/licenses.poku.js +11 -0
- package/lib/helpers/utils.js +66 -29
- package/lib/helpers/utils.poku.js +21 -1
- package/lib/helpers/validator.js +31 -0
- package/lib/managers/binary.js +42 -11
- package/lib/managers/containerutils.js +68 -0
- package/lib/managers/docker.js +75 -101
- package/package.json +58 -57
- package/types/bin/dependencies.d.ts.map +1 -1
- package/types/bin/licenses.d.ts +3 -0
- package/types/bin/licenses.d.ts.map +1 -0
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/helpers/utils.d.ts +1 -1
- package/types/lib/helpers/utils.d.ts.map +1 -1
- package/types/lib/helpers/validator.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/containerutils.d.ts +3 -0
- package/types/lib/managers/containerutils.d.ts.map +1 -0
- package/types/lib/managers/docker.d.ts +0 -2
- package/types/lib/managers/docker.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -540,7 +540,19 @@ const dbody = await submitBom(args, bomNSData.bomJson);
|
|
|
540
540
|
|
|
541
541
|
## Contributing
|
|
542
542
|
|
|
543
|
-
Please check out our [
|
|
543
|
+
Please check out our [open issues][github-contribute] if you are interested in helping.
|
|
544
|
+
|
|
545
|
+
### Codeberg Mirror
|
|
546
|
+
|
|
547
|
+
The project is mirrored on [Codeberg](https://codeberg.org/cdxgen/cdxgen). Users can clone the repository using the following URL:
|
|
548
|
+
|
|
549
|
+
```shell
|
|
550
|
+
git clone https://codeberg.org/cdxgen/cdxgen.git
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
The maintainers accept Pull Requests (PRs) against the Codeberg repository.
|
|
554
|
+
|
|
555
|
+
> **Note:** The Codeberg repository is currently synced manually from GitHub.
|
|
544
556
|
|
|
545
557
|
Before raising a PR, please run the following commands.
|
|
546
558
|
|
|
@@ -588,6 +600,10 @@ Some features are funded through [NGI Zero Core](https://nlnet.nl/core), a fund
|
|
|
588
600
|
[<img src="https://nlnet.nl/logo/banner.png" alt="NLnet foundation logo" width="20%" />](https://nlnet.nl)
|
|
589
601
|
[<img src="https://nlnet.nl/image/logos/NGI0_tag.svg" alt="NGI Zero Logo" width="20%" />](https://nlnet.nl/core)
|
|
590
602
|
|
|
603
|
+
cdxgen is an OWASP Foundation production project.
|
|
604
|
+
|
|
605
|
+
[<img src="https://owasp.org/assets/images/logo.png" width="20%" />](https://owasp.org)
|
|
606
|
+
|
|
591
607
|
<!-- LINK LABELS -->
|
|
592
608
|
<!-- Badges -->
|
|
593
609
|
|
package/bin/dependencies.js
CHANGED
|
@@ -61,15 +61,35 @@ for (const override in pkgJson.pnpm.overrides) {
|
|
|
61
61
|
checkObsolescence(override, obsoletePnpmOverrides);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
if (missingNpmOverrides.length) {
|
|
65
|
+
console.log("\nThe following dependencies are not in the 'overrides'-block:");
|
|
66
|
+
console.log(missingNpmOverrides.join(",\n"));
|
|
67
|
+
}
|
|
68
|
+
if (incorrectNpmOverridesVersions.length) {
|
|
69
|
+
console.log(
|
|
70
|
+
"\nThe following dependencies have a different version in the 'overrides'-block:",
|
|
71
|
+
);
|
|
72
|
+
console.log(incorrectNpmOverridesVersions.join("\n"));
|
|
73
|
+
}
|
|
74
|
+
if (missingPnpmOverrides.length) {
|
|
75
|
+
console.log(
|
|
76
|
+
"\nThe following dependencies are not in the 'pnpm.overrides'-block:",
|
|
77
|
+
);
|
|
78
|
+
console.log(missingPnpmOverrides.join(",\n"));
|
|
79
|
+
}
|
|
80
|
+
if (incorrectPnpmOverridesVersions.length) {
|
|
81
|
+
console.log(
|
|
82
|
+
"\nThe following dependencies have a different version in the 'pnpm.overrides'-block:",
|
|
72
83
|
);
|
|
84
|
+
console.log(incorrectPnpmOverridesVersions.join("\n"));
|
|
85
|
+
}
|
|
86
|
+
if (obsoleteNpmOverrides.length) {
|
|
87
|
+
console.log("\nThe following entries in 'overrides' are not used:");
|
|
88
|
+
console.log(obsoleteNpmOverrides.join("\n"));
|
|
89
|
+
}
|
|
90
|
+
if (obsoletePnpmOverrides.length) {
|
|
91
|
+
console.log("\nThe following entries in 'pnpm.overrides' are not used:");
|
|
92
|
+
console.log(obsoletePnpmOverrides.join("\n"));
|
|
73
93
|
}
|
|
74
94
|
|
|
75
95
|
function checkOverride(packageName, packageVersion) {
|
|
@@ -99,33 +119,13 @@ function checkObsolescence(override, obsoletionArray) {
|
|
|
99
119
|
}
|
|
100
120
|
}
|
|
101
121
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
console.log(incorrectNpmOverridesVersions.join("\n"));
|
|
111
|
-
}
|
|
112
|
-
if (missingPnpmOverrides.length) {
|
|
113
|
-
console.log(
|
|
114
|
-
"The following dependencies are not in the 'pnpm.overrides'-block:",
|
|
115
|
-
);
|
|
116
|
-
console.log(missingPnpmOverrides.join(",\n"));
|
|
117
|
-
}
|
|
118
|
-
if (incorrectPnpmOverridesVersions.length) {
|
|
119
|
-
console.log(
|
|
120
|
-
"The following dependencies have a different version in the 'pnpm.overrides'-block:",
|
|
122
|
+
export function checkDependencies() {
|
|
123
|
+
return (
|
|
124
|
+
incorrectNpmOverridesVersions.length +
|
|
125
|
+
incorrectPnpmOverridesVersions.length +
|
|
126
|
+
missingNpmOverrides.length +
|
|
127
|
+
missingPnpmOverrides.length +
|
|
128
|
+
obsoleteNpmOverrides.length +
|
|
129
|
+
obsoletePnpmOverrides.length
|
|
121
130
|
);
|
|
122
|
-
console.log(incorrectPnpmOverridesVersions.join("\n"));
|
|
123
|
-
}
|
|
124
|
-
if (obsoleteNpmOverrides.length) {
|
|
125
|
-
console.log("The following entries in 'overrides' are not used:");
|
|
126
|
-
console.log(obsoleteNpmOverrides.join("\n"));
|
|
127
|
-
}
|
|
128
|
-
if (obsoletePnpmOverrides.length) {
|
|
129
|
-
console.log("The following entries in 'pnpm.overrides' are not used:");
|
|
130
|
-
console.log(obsoletePnpmOverrides.join("\n"));
|
|
131
131
|
}
|
package/bin/licenses.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
+
|
|
5
|
+
const CURRENT_LICENSES = [
|
|
6
|
+
"Apache-2.0",
|
|
7
|
+
"BSD-2-Clause",
|
|
8
|
+
"BSD-3-Clause",
|
|
9
|
+
"BlueOak-1.0.0",
|
|
10
|
+
"CC-BY-3.0",
|
|
11
|
+
"CC0-1.0",
|
|
12
|
+
"ISC",
|
|
13
|
+
"MIT",
|
|
14
|
+
"WTFPL",
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const newLicenses = new Map();
|
|
18
|
+
const noLicenses = [];
|
|
19
|
+
|
|
20
|
+
if (existsSync("./bom.json")) {
|
|
21
|
+
const sbom = JSON.parse(readFileSync("./bom.json", "utf8"));
|
|
22
|
+
|
|
23
|
+
for (const component of sbom.components) {
|
|
24
|
+
const componentID =
|
|
25
|
+
(component.group !== "" ? `${component.group}/` : "") +
|
|
26
|
+
`${component.name}@${component.version}`;
|
|
27
|
+
if (component.licenses) {
|
|
28
|
+
for (const license of component.licenses) {
|
|
29
|
+
if (license.license) {
|
|
30
|
+
if (!CURRENT_LICENSES.includes(license.license.id)) {
|
|
31
|
+
newLicenses.set(componentID, license.license.id);
|
|
32
|
+
}
|
|
33
|
+
} else if (license.expression) {
|
|
34
|
+
const licenses = license.expression
|
|
35
|
+
.replaceAll("(", "")
|
|
36
|
+
.replaceAll(")", "")
|
|
37
|
+
.split(/ (?:and|or) /i);
|
|
38
|
+
for (const aLicense of licenses) {
|
|
39
|
+
if (!CURRENT_LICENSES.includes(aLicense)) {
|
|
40
|
+
newLicenses.set(componentID, license.expression);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
noLicenses.push(componentID);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
noLicenses.push(componentID);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (newLicenses.size) {
|
|
54
|
+
console.log(
|
|
55
|
+
"The following dependencies have licenses that are not yet used in the project:",
|
|
56
|
+
);
|
|
57
|
+
for (const dependency of newLicenses.keys()) {
|
|
58
|
+
console.log(` - ${dependency}: ${newLicenses.get(dependency)}`);
|
|
59
|
+
}
|
|
60
|
+
console.log(
|
|
61
|
+
"If the licenses are allowed, add them to CURRENT_LICENSES in 'bin/licenses.js'.",
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (noLicenses.length) {
|
|
66
|
+
console.log("The following dependencies have NO license:");
|
|
67
|
+
for (const dependency of noLicenses) {
|
|
68
|
+
console.log(` - ${dependency}`);
|
|
69
|
+
}
|
|
70
|
+
console.log(
|
|
71
|
+
"If this is correct and the dependency should be allowed, an ignore mechanism should be implemented!",
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function checkLicenses() {
|
|
77
|
+
return newLicenses.size + noLicenses.length;
|
|
78
|
+
}
|
package/data/spdx.schema.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "http://cyclonedx.org/schema/spdx.schema.json",
|
|
4
|
-
"$comment": "v1.0-3.
|
|
4
|
+
"$comment": "v1.0-3.28.0",
|
|
5
5
|
"type": "string",
|
|
6
6
|
"enum": [
|
|
7
7
|
"0BSD",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"Adobe-Glyph",
|
|
15
15
|
"Adobe-Utopia",
|
|
16
16
|
"ADSL",
|
|
17
|
+
"Advanced-Cryptics-Dictionary",
|
|
17
18
|
"AFL-1.1",
|
|
18
19
|
"AFL-1.2",
|
|
19
20
|
"AFL-2.0",
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
"AGPL-3.0-only",
|
|
28
29
|
"AGPL-3.0-or-later",
|
|
29
30
|
"Aladdin",
|
|
31
|
+
"ALGLIB-Documentation",
|
|
30
32
|
"AMD-newlib",
|
|
31
33
|
"AMDPLPA",
|
|
32
34
|
"AML",
|
|
@@ -68,6 +70,7 @@
|
|
|
68
70
|
"BlueOak-1.0.0",
|
|
69
71
|
"Boehm-GC",
|
|
70
72
|
"Boehm-GC-without-fee",
|
|
73
|
+
"BOLA-1.1",
|
|
71
74
|
"Borceux",
|
|
72
75
|
"Brian-Gladman-2-Clause",
|
|
73
76
|
"Brian-Gladman-3-Clause",
|
|
@@ -94,6 +97,7 @@
|
|
|
94
97
|
"BSD-3-Clause-No-Nuclear-Warranty",
|
|
95
98
|
"BSD-3-Clause-Open-MPI",
|
|
96
99
|
"BSD-3-Clause-Sun",
|
|
100
|
+
"BSD-3-Clause-Tso",
|
|
97
101
|
"BSD-4-Clause",
|
|
98
102
|
"BSD-4-Clause-Shortened",
|
|
99
103
|
"BSD-4-Clause-UC",
|
|
@@ -102,12 +106,14 @@
|
|
|
102
106
|
"BSD-Advertising-Acknowledgement",
|
|
103
107
|
"BSD-Attribution-HPND-disclaimer",
|
|
104
108
|
"BSD-Inferno-Nettverk",
|
|
109
|
+
"BSD-Mark-Modifications",
|
|
105
110
|
"BSD-Protection",
|
|
106
111
|
"BSD-Source-beginning-file",
|
|
107
112
|
"BSD-Source-Code",
|
|
108
113
|
"BSD-Systemics",
|
|
109
114
|
"BSD-Systemics-W3Works",
|
|
110
115
|
"BSL-1.0",
|
|
116
|
+
"Buddy",
|
|
111
117
|
"BUSL-1.1",
|
|
112
118
|
"bzip2-1.0.5",
|
|
113
119
|
"bzip2-1.0.6",
|
|
@@ -116,6 +122,7 @@
|
|
|
116
122
|
"CAL-1.0-Combined-Work-Exception",
|
|
117
123
|
"Caldera",
|
|
118
124
|
"Caldera-no-preamble",
|
|
125
|
+
"CAPEC-tou",
|
|
119
126
|
"Catharon",
|
|
120
127
|
"CATOSL-1.1",
|
|
121
128
|
"CC-BY-1.0",
|
|
@@ -245,6 +252,9 @@
|
|
|
245
252
|
"EPL-1.0",
|
|
246
253
|
"EPL-2.0",
|
|
247
254
|
"ErlPL-1.1",
|
|
255
|
+
"ESA-PL-permissive-2.4",
|
|
256
|
+
"ESA-PL-strong-copyleft-2.4",
|
|
257
|
+
"ESA-PL-weak-copyleft-2.4",
|
|
248
258
|
"etalab-2.0",
|
|
249
259
|
"EUDatagrid",
|
|
250
260
|
"EUPL-1.0",
|
|
@@ -350,11 +360,14 @@
|
|
|
350
360
|
"HPND-sell-MIT-disclaimer-xserver",
|
|
351
361
|
"HPND-sell-regexpr",
|
|
352
362
|
"HPND-sell-variant",
|
|
363
|
+
"HPND-sell-variant-critical-systems",
|
|
353
364
|
"HPND-sell-variant-MIT-disclaimer",
|
|
354
365
|
"HPND-sell-variant-MIT-disclaimer-rev",
|
|
366
|
+
"HPND-SMC",
|
|
355
367
|
"HPND-UC",
|
|
356
368
|
"HPND-UC-export-US",
|
|
357
369
|
"HTMLTIDY",
|
|
370
|
+
"hyphen-bulgarian",
|
|
358
371
|
"IBM-pibs",
|
|
359
372
|
"ICU",
|
|
360
373
|
"IEC-Code-Components-EULA",
|
|
@@ -373,6 +386,7 @@
|
|
|
373
386
|
"IPL-1.0",
|
|
374
387
|
"ISC",
|
|
375
388
|
"ISC-Veillard",
|
|
389
|
+
"ISO-permission",
|
|
376
390
|
"Jam",
|
|
377
391
|
"JasPer-2.0",
|
|
378
392
|
"jove",
|
|
@@ -450,10 +464,12 @@
|
|
|
450
464
|
"MIT-Khronos-old",
|
|
451
465
|
"MIT-Modern-Variant",
|
|
452
466
|
"MIT-open-group",
|
|
467
|
+
"MIT-STK",
|
|
453
468
|
"MIT-testregex",
|
|
454
469
|
"MIT-Wu",
|
|
455
470
|
"MITNFA",
|
|
456
471
|
"MMIXware",
|
|
472
|
+
"MMPL-1.0.1",
|
|
457
473
|
"Motosoto",
|
|
458
474
|
"MPEG-SSG",
|
|
459
475
|
"mpi-permissive",
|
|
@@ -487,6 +503,7 @@
|
|
|
487
503
|
"NICTA-1.0",
|
|
488
504
|
"NIST-PD",
|
|
489
505
|
"NIST-PD-fallback",
|
|
506
|
+
"NIST-PD-TNT",
|
|
490
507
|
"NIST-Software",
|
|
491
508
|
"NLOD-1.0",
|
|
492
509
|
"NLOD-2.0",
|
|
@@ -540,6 +557,7 @@
|
|
|
540
557
|
"OLDAP-2.8",
|
|
541
558
|
"OLFL-1.3",
|
|
542
559
|
"OML",
|
|
560
|
+
"OpenMDW-1.0",
|
|
543
561
|
"OpenPBS-2.3",
|
|
544
562
|
"OpenSSL",
|
|
545
563
|
"OpenSSL-standalone",
|
|
@@ -547,13 +565,16 @@
|
|
|
547
565
|
"OPL-1.0",
|
|
548
566
|
"OPL-UK-3.0",
|
|
549
567
|
"OPUBL-1.0",
|
|
568
|
+
"OSC-1.0",
|
|
550
569
|
"OSET-PL-2.1",
|
|
551
570
|
"OSL-1.0",
|
|
552
571
|
"OSL-1.1",
|
|
553
572
|
"OSL-2.0",
|
|
554
573
|
"OSL-2.1",
|
|
555
574
|
"OSL-3.0",
|
|
575
|
+
"OSSP",
|
|
556
576
|
"PADL",
|
|
577
|
+
"ParaType-Free-Font-1.3",
|
|
557
578
|
"Parity-6.0.0",
|
|
558
579
|
"Parity-7.0.0",
|
|
559
580
|
"PDDL-1.0",
|
|
@@ -598,6 +619,7 @@
|
|
|
598
619
|
"SGI-B-1.1",
|
|
599
620
|
"SGI-B-2.0",
|
|
600
621
|
"SGI-OpenGL",
|
|
622
|
+
"SGMLUG-PM",
|
|
601
623
|
"SGP4",
|
|
602
624
|
"SHL-0.5",
|
|
603
625
|
"SHL-0.51",
|
|
@@ -635,6 +657,7 @@
|
|
|
635
657
|
"TAPR-OHL-1.0",
|
|
636
658
|
"TCL",
|
|
637
659
|
"TCP-wrappers",
|
|
660
|
+
"TekHVC",
|
|
638
661
|
"TermReadKey",
|
|
639
662
|
"TGPPL-1.0",
|
|
640
663
|
"ThirdEye",
|
|
@@ -662,9 +685,11 @@
|
|
|
662
685
|
"Unlicense",
|
|
663
686
|
"Unlicense-libtelnet",
|
|
664
687
|
"Unlicense-libwhirlpool",
|
|
688
|
+
"UnRAR",
|
|
665
689
|
"UPL-1.0",
|
|
666
690
|
"URT-RLE",
|
|
667
691
|
"Vim",
|
|
692
|
+
"Vixie-Cron",
|
|
668
693
|
"VOSTROM",
|
|
669
694
|
"VSL-1.0",
|
|
670
695
|
"W3C",
|
|
@@ -673,12 +698,15 @@
|
|
|
673
698
|
"w3m",
|
|
674
699
|
"Watcom-1.0",
|
|
675
700
|
"Widget-Workshop",
|
|
701
|
+
"WordNet",
|
|
676
702
|
"Wsuipa",
|
|
703
|
+
"WTFNMFPL",
|
|
677
704
|
"WTFPL",
|
|
678
705
|
"wwl",
|
|
679
706
|
"wxWindows",
|
|
680
707
|
"X11",
|
|
681
708
|
"X11-distribute-modifications-variant",
|
|
709
|
+
"X11-no-permit-persons",
|
|
682
710
|
"X11-swapped",
|
|
683
711
|
"Xdebug-1.03",
|
|
684
712
|
"Xerox",
|
|
@@ -716,6 +744,7 @@
|
|
|
716
744
|
"Bootloader-exception",
|
|
717
745
|
"CGAL-linking-exception",
|
|
718
746
|
"Classpath-exception-2.0",
|
|
747
|
+
"Classpath-exception-2.0-short",
|
|
719
748
|
"CLISP-exception-2.0",
|
|
720
749
|
"cryptsetup-OpenSSL-exception",
|
|
721
750
|
"Digia-Qt-LGPL-exception-1.1",
|
|
@@ -746,6 +775,7 @@
|
|
|
746
775
|
"i2p-gpl-java-exception",
|
|
747
776
|
"Independent-modules-exception",
|
|
748
777
|
"KiCad-libraries-exception",
|
|
778
|
+
"kvirc-openssl-exception",
|
|
749
779
|
"LGPL-3.0-linking-exception",
|
|
750
780
|
"libpri-OpenH323-exception",
|
|
751
781
|
"Libtool-exception",
|
|
@@ -769,9 +799,12 @@
|
|
|
769
799
|
"Qwt-exception-1.0",
|
|
770
800
|
"romic-exception",
|
|
771
801
|
"RRDtool-FLOSS-exception-2.0",
|
|
802
|
+
"rsync-linking-exception",
|
|
772
803
|
"SANE-exception",
|
|
773
804
|
"SHL-2.0",
|
|
774
805
|
"SHL-2.1",
|
|
806
|
+
"Simple-Library-Usage-exception",
|
|
807
|
+
"sqlitestudio-OpenSSL-exception",
|
|
775
808
|
"stunnel-exception",
|
|
776
809
|
"SWI-exception",
|
|
777
810
|
"Swift-exception",
|
|
@@ -783,4 +816,4 @@
|
|
|
783
816
|
"WxWindows-exception-3.1",
|
|
784
817
|
"x11vnc-openssl-exception"
|
|
785
818
|
]
|
|
786
|
-
}
|
|
819
|
+
}
|