@cyclonedx/cdxgen 12.1.2 → 12.1.4
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 -9
- package/bin/cdxgen.js +1 -1
- package/lib/cli/index.js +9 -5
- package/lib/evinser/evinser.js +2 -8
- package/lib/helpers/display.js +1 -1
- package/lib/helpers/envcontext.js +10 -2
- package/lib/helpers/utils.js +462 -86
- package/lib/helpers/utils.poku.js +179 -2
- package/lib/helpers/validator.js +8 -5
- package/lib/managers/docker.getConnection.poku.js +61 -0
- package/lib/managers/docker.js +36 -23
- package/lib/parsers/iri.js +1 -2
- package/lib/server/server.js +164 -34
- package/lib/server/server.poku.js +232 -10
- package/lib/stages/postgen/annotator.js +281 -3
- package/lib/stages/postgen/postgen.js +4 -7
- package/lib/third-party/arborist/lib/diff.js +1 -1
- package/lib/third-party/arborist/lib/node.js +1 -1
- package/lib/third-party/arborist/lib/yarn-lock.js +1 -1
- package/package.json +22 -328
- package/types/bin/dependencies.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts +39 -39
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +19 -19
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/swiftsem.d.ts +14 -14
- package/types/lib/evinser/swiftsem.d.ts.map +1 -1
- package/types/lib/helpers/cbomutils.d.ts +1 -1
- package/types/lib/helpers/cbomutils.d.ts.map +1 -1
- package/types/lib/helpers/db.d.ts +2 -2
- package/types/lib/helpers/db.d.ts.map +1 -1
- package/types/lib/helpers/display.d.ts +2 -2
- package/types/lib/helpers/display.d.ts.map +1 -1
- package/types/lib/helpers/envcontext.d.ts +14 -14
- package/types/lib/helpers/envcontext.d.ts.map +1 -1
- package/types/lib/helpers/logger.d.ts +1 -1
- package/types/lib/helpers/logger.d.ts.map +1 -1
- package/types/lib/helpers/protobom.d.ts +4 -2
- package/types/lib/helpers/protobom.d.ts.map +1 -1
- package/types/lib/helpers/utils.d.ts +103 -88
- 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 +2 -2
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +2 -2
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/managers/oci.d.ts +1 -1
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/managers/piptree.d.ts +1 -1
- package/types/lib/managers/piptree.d.ts.map +1 -1
- package/types/lib/parsers/iri.d.ts +6 -6
- package/types/lib/parsers/iri.d.ts.map +1 -1
- package/types/lib/server/server.d.ts +14 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/annotator.d.ts +3 -3
- package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +5 -5
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +6 -6
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/arborist/index.d.ts +4 -3
- package/types/lib/third-party/arborist/lib/arborist/index.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/can-place-dep.d.ts +5 -5
- package/types/lib/third-party/arborist/lib/can-place-dep.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/case-insensitive-map.d.ts +4 -4
- package/types/lib/third-party/arborist/lib/case-insensitive-map.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/diff.d.ts +3 -3
- package/types/lib/third-party/arborist/lib/diff.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/edge.d.ts +2 -2
- package/types/lib/third-party/arborist/lib/edge.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/gather-dep-set.d.ts +1 -1
- package/types/lib/third-party/arborist/lib/gather-dep-set.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/inventory.d.ts +3 -2
- package/types/lib/third-party/arborist/lib/inventory.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/link.d.ts +10 -7
- package/types/lib/third-party/arborist/lib/link.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/node.d.ts +8 -8
- package/types/lib/third-party/arborist/lib/node.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/optional-set.d.ts +1 -1
- package/types/lib/third-party/arborist/lib/optional-set.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/override-set.d.ts +3 -3
- package/types/lib/third-party/arborist/lib/override-set.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/peer-entry-sets.d.ts +1 -1
- package/types/lib/third-party/arborist/lib/peer-entry-sets.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/place-dep.d.ts +3 -3
- package/types/lib/third-party/arborist/lib/place-dep.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/shrinkwrap.d.ts +7 -7
- package/types/lib/third-party/arborist/lib/shrinkwrap.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/version-from-tgz.d.ts +1 -1
- package/types/lib/third-party/arborist/lib/version-from-tgz.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/yarn-lock.d.ts +4 -3
- package/types/lib/third-party/arborist/lib/yarn-lock.d.ts.map +1 -1
- package/bin/dependencies.js +0 -131
- package/bin/licenses.js +0 -78
- package/lib/helpers/dependencies.poku.js +0 -11
- package/lib/helpers/licenses.poku.js +0 -11
- package/types/lib/third-party/arborist/lib/arborist/load-actual.d.ts +0 -34
- package/types/lib/third-party/arborist/lib/arborist/load-actual.d.ts.map +0 -1
- package/types/lib/third-party/arborist/lib/arborist/load-virtual.d.ts +0 -24
- package/types/lib/third-party/arborist/lib/arborist/load-virtual.d.ts.map +0 -1
- package/types/lib/third-party/arborist/lib/tracker.d.ts +0 -13
- package/types/lib/third-party/arborist/lib/tracker.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
[](https://github.com/cdxgen/cdxgen)
|
|
1
2
|
[![JSR][badge-jsr]][jsr-cdxgen]
|
|
2
3
|
[![NPM][badge-npm]][npmjs-cdxgen]
|
|
3
4
|
[![GitHub Releases][badge-github-releases]][github-releases]
|
|
@@ -50,13 +51,6 @@ Sections include:
|
|
|
50
51
|
|
|
51
52
|
## Usage
|
|
52
53
|
|
|
53
|
-
## For Contributors / Developers
|
|
54
|
-
|
|
55
|
-
```shell
|
|
56
|
-
pnpm install
|
|
57
|
-
pnpm dlx cdxgen
|
|
58
|
-
```
|
|
59
|
-
|
|
60
54
|
## Installing
|
|
61
55
|
|
|
62
56
|
```shell
|
|
@@ -78,7 +72,7 @@ $ brew install cdxgen
|
|
|
78
72
|
If you are a [Winget][winget-homepage] user on windows, you can also install cdxgen via:
|
|
79
73
|
|
|
80
74
|
```shell
|
|
81
|
-
|
|
75
|
+
winget install cdxgen
|
|
82
76
|
```
|
|
83
77
|
|
|
84
78
|
Deno and bun runtime can be used with limited support.
|
|
@@ -110,7 +104,7 @@ docker run --rm -e CDXGEN_DEBUG_MODE=debug -v /tmp:/tmp -v $(pwd):/app:rw -t ghc
|
|
|
110
104
|
In deno applications, cdxgen could be directly imported without any conversion. Please see the section on [integration as a library](#integration-as-library)
|
|
111
105
|
|
|
112
106
|
```ts
|
|
113
|
-
import { createBom, submitBom } from "npm:@cyclonedx/cdxgen@^
|
|
107
|
+
import { createBom, submitBom } from "npm:@cyclonedx/cdxgen@^12.1.0";
|
|
114
108
|
```
|
|
115
109
|
|
|
116
110
|
## Getting Help
|
|
@@ -604,6 +598,14 @@ cdxgen is an OWASP Foundation production project.
|
|
|
604
598
|
|
|
605
599
|
[<img src="https://owasp.org/assets/images/logo.png" width="20%" />](https://owasp.org)
|
|
606
600
|
|
|
601
|
+
## cdxgen badge
|
|
602
|
+
|
|
603
|
+
Copy the below block to your markdown files to show your ❤️ for cdxgen.
|
|
604
|
+
|
|
605
|
+
```markdown
|
|
606
|
+
[](https://github.com/cdxgen/cdxgen)
|
|
607
|
+
```
|
|
608
|
+
|
|
607
609
|
<!-- LINK LABELS -->
|
|
608
610
|
<!-- Badges -->
|
|
609
611
|
|
package/bin/cdxgen.js
CHANGED
|
@@ -1114,7 +1114,7 @@ const needsBomSigning = ({ generateKeyAndSign }) =>
|
|
|
1114
1114
|
protobomModule.writeBinary(bomNSData.bomJson, options.protoBinFile);
|
|
1115
1115
|
thoughtLog("BOM file is also available in .proto format!");
|
|
1116
1116
|
}
|
|
1117
|
-
if (options.print && bomNSData.bomJson
|
|
1117
|
+
if (options.print && bomNSData.bomJson?.components) {
|
|
1118
1118
|
printSummary(bomNSData.bomJson);
|
|
1119
1119
|
if (options.includeFormulation) {
|
|
1120
1120
|
printFormulation(bomNSData.bomJson);
|
package/lib/cli/index.js
CHANGED
|
@@ -2883,7 +2883,7 @@ export async function createNodejsBom(path, options) {
|
|
|
2883
2883
|
// Only perform npm install for smaller projects (< 2 package.json) without the correct number of lock files
|
|
2884
2884
|
if (
|
|
2885
2885
|
(pkgJsonLockFiles?.length === 0 ||
|
|
2886
|
-
pkgJsonLockFiles?.length < pkgJsonFiles?.length) &&
|
|
2886
|
+
pkgJsonLockFiles?.length < pkgJsonFiles?.length - 1) &&
|
|
2887
2887
|
yarnLockFiles?.length === 0 &&
|
|
2888
2888
|
pnpmLockFiles?.length === 0 &&
|
|
2889
2889
|
pkgJsonFiles?.length <= npmInstallCount &&
|
|
@@ -2930,11 +2930,15 @@ export async function createNodejsBom(path, options) {
|
|
|
2930
2930
|
process.env[`${pkgMgr.toUpperCase()}_INSTALL_ARGS`].split(" ");
|
|
2931
2931
|
installArgs = installArgs.concat(addArgs);
|
|
2932
2932
|
}
|
|
2933
|
-
|
|
2933
|
+
// Always invoke the install command with ignore-scripts to guard against version spoofing
|
|
2934
|
+
if (["npm", "pnpm", "yarn"].includes(pkgMgr)) {
|
|
2934
2935
|
if (!installArgs.includes("--ignore-scripts")) {
|
|
2935
2936
|
installArgs.push("--ignore-scripts");
|
|
2936
2937
|
}
|
|
2937
|
-
if (
|
|
2938
|
+
if (pkgMgr === "pnpm") {
|
|
2939
|
+
installArgs.push("--ignore-pnpmfile");
|
|
2940
|
+
}
|
|
2941
|
+
if (pkgMgr === "npm" && !installArgs.includes("--no-audit")) {
|
|
2938
2942
|
installArgs.push("--no-audit");
|
|
2939
2943
|
}
|
|
2940
2944
|
}
|
|
@@ -3957,7 +3961,7 @@ export async function createPythonBom(path, options) {
|
|
|
3957
3961
|
metadataFilename = reqDirFiles.join(", ");
|
|
3958
3962
|
} else if (reqFiles?.length) {
|
|
3959
3963
|
for (const f of reqFiles) {
|
|
3960
|
-
const dlist = await parseReqFile(f,
|
|
3964
|
+
const dlist = await parseReqFile(f, false);
|
|
3961
3965
|
if (dlist?.length) {
|
|
3962
3966
|
pkgList = pkgList.concat(dlist);
|
|
3963
3967
|
}
|
|
@@ -7061,7 +7065,7 @@ export async function createCsharpBom(path, options) {
|
|
|
7061
7065
|
}
|
|
7062
7066
|
}
|
|
7063
7067
|
// Parent dependency tree
|
|
7064
|
-
if (parentDependsOn.size && parentComponent
|
|
7068
|
+
if (parentDependsOn.size && parentComponent?.["bom-ref"]) {
|
|
7065
7069
|
dependencies.splice(0, 0, {
|
|
7066
7070
|
ref: parentComponent["bom-ref"],
|
|
7067
7071
|
dependsOn: Array.from(parentDependsOn).sort(),
|
package/lib/evinser/evinser.js
CHANGED
|
@@ -1248,8 +1248,7 @@ export function detectServicesFromUsages(language, slice, servicesMap = {}) {
|
|
|
1248
1248
|
export function detectServicesFromUDT(language, userDefinedTypes, servicesMap) {
|
|
1249
1249
|
if (
|
|
1250
1250
|
["python", "py", "c", "cpp", "c++", "php", "ruby"].includes(language) &&
|
|
1251
|
-
userDefinedTypes
|
|
1252
|
-
userDefinedTypes.length
|
|
1251
|
+
userDefinedTypes?.length
|
|
1253
1252
|
) {
|
|
1254
1253
|
for (const audt of userDefinedTypes) {
|
|
1255
1254
|
if (
|
|
@@ -1270,12 +1269,7 @@ export function detectServicesFromUDT(language, userDefinedTypes, servicesMap) {
|
|
|
1270
1269
|
audt.name.toLowerCase().includes("connect")
|
|
1271
1270
|
) {
|
|
1272
1271
|
const fields = audt.fields || [];
|
|
1273
|
-
if (
|
|
1274
|
-
fields.length &&
|
|
1275
|
-
fields[0] &&
|
|
1276
|
-
fields[0].name &&
|
|
1277
|
-
fields[0].name.length > 1
|
|
1278
|
-
) {
|
|
1272
|
+
if (fields.length && fields[0]?.name && fields[0].name.length > 1) {
|
|
1279
1273
|
const endpoints = extractEndpoints(language, fields[0].name);
|
|
1280
1274
|
let serviceName = "service";
|
|
1281
1275
|
if (audt.fileName) {
|
package/lib/helpers/display.js
CHANGED
|
@@ -14,7 +14,7 @@ const SYMBOLS_ANSI = {
|
|
|
14
14
|
|
|
15
15
|
const MAX_TREE_DEPTH = 6;
|
|
16
16
|
const highlightStr = (s, highlight) => {
|
|
17
|
-
if (highlight && s
|
|
17
|
+
if (highlight && s?.includes(highlight)) {
|
|
18
18
|
s = s.replaceAll(highlight, `\x1b[1;33m${highlight}\x1b[0m`);
|
|
19
19
|
}
|
|
20
20
|
return s;
|
|
@@ -200,9 +200,17 @@ export function collectDotnetInfo(dir) {
|
|
|
200
200
|
* @returns Object containing python details
|
|
201
201
|
*/
|
|
202
202
|
export function collectPythonInfo(dir) {
|
|
203
|
-
const versionDesc = getCommandOutput(getPythonCommand(), dir, [
|
|
203
|
+
const versionDesc = getCommandOutput(getPythonCommand(), dir, [
|
|
204
|
+
"-S",
|
|
205
|
+
"--version",
|
|
206
|
+
]);
|
|
204
207
|
const moduleDesc =
|
|
205
|
-
getCommandOutput(getPythonCommand(), dir, [
|
|
208
|
+
getCommandOutput(getPythonCommand(), dir, [
|
|
209
|
+
"-S",
|
|
210
|
+
"-m",
|
|
211
|
+
"pip",
|
|
212
|
+
"--version",
|
|
213
|
+
]) || "";
|
|
206
214
|
if (versionDesc) {
|
|
207
215
|
return {
|
|
208
216
|
type: "platform",
|