@cyclonedx/cdxgen 12.1.3 → 12.1.5
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 +1 -1
- package/bin/cdxgen.js +12 -0
- package/bin/repl.js +2 -2
- package/lib/cli/index.js +164 -71
- package/lib/evinser/evinser.js +3 -4
- package/lib/evinser/swiftsem.js +1 -1
- package/lib/helpers/caxa.js +1 -1
- package/lib/helpers/display.js +6 -10
- package/lib/helpers/envcontext.js +5 -5
- package/lib/helpers/pythonutils.js +296 -0
- package/lib/helpers/pythonutils.poku.js +469 -0
- package/lib/helpers/utils.js +303 -95
- package/lib/helpers/utils.poku.js +84 -1
- package/lib/managers/piptree.js +1 -1
- package/lib/parsers/npmrc.js +88 -0
- package/lib/parsers/npmrc.poku.js +492 -0
- package/lib/server/openapi.yaml +0 -9
- package/lib/server/server.js +18 -5
- package/lib/stages/pregen/env-audit.js +34 -0
- package/lib/stages/pregen/env-audit.poku.js +290 -0
- package/lib/third-party/arborist/lib/deepest-nesting-target.js +1 -1
- package/lib/third-party/arborist/lib/node.js +3 -3
- package/lib/third-party/arborist/lib/shrinkwrap.js +1 -1
- package/lib/third-party/arborist/lib/tree-check.js +1 -1
- package/package.json +6 -6
- 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/pythonutils.d.ts +9 -0
- package/types/lib/helpers/pythonutils.d.ts.map +1 -0
- package/types/lib/helpers/utils.d.ts +103 -88
- package/types/lib/helpers/utils.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/parsers/npmrc.d.ts +23 -0
- package/types/lib/parsers/npmrc.d.ts.map +1 -0
- package/types/lib/server/server.d.ts +1 -1
- 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/env-audit.d.ts +2 -0
- package/types/lib/stages/pregen/env-audit.d.ts.map +1 -0
- 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/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
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { strict as assert } from "node:assert";
|
|
2
|
+
|
|
3
|
+
import { describe, test } from "poku";
|
|
4
|
+
|
|
5
|
+
import { auditEnvironment } from "./env-audit.js";
|
|
6
|
+
|
|
7
|
+
const NODE_OPTIONS_ATTACK_VECTORS = [
|
|
8
|
+
{
|
|
9
|
+
name: "--require flag",
|
|
10
|
+
value: "--require ./evil.js",
|
|
11
|
+
expectedMatch: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "--require with uppercase",
|
|
15
|
+
value: "--REQUIRE ./evil.js",
|
|
16
|
+
expectedMatch: true,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "-r short flag",
|
|
20
|
+
value: "-r ./evil.js",
|
|
21
|
+
expectedMatch: false,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "--eval flag",
|
|
25
|
+
value: "--eval \"console.log('pwned')\"",
|
|
26
|
+
expectedMatch: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "--eval with complex payload",
|
|
30
|
+
value: "--eval \"require('child_process').execSync('id')\"",
|
|
31
|
+
expectedMatch: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "-e short flag",
|
|
35
|
+
value: "-e \"console.log('test')\"",
|
|
36
|
+
expectedMatch: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "--import flag (Node 18+)",
|
|
40
|
+
value: "--import ./malicious.mjs",
|
|
41
|
+
expectedMatch: true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "--loader flag",
|
|
45
|
+
value: "--loader ./hook-loader.js",
|
|
46
|
+
expectedMatch: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "--inspect flag",
|
|
50
|
+
value: "--inspect=0.0.0.0:9229",
|
|
51
|
+
expectedMatch: true,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "--inspect-brk flag",
|
|
55
|
+
value: "--inspect-brk=9229",
|
|
56
|
+
expectedMatch: true,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "--inspect with host",
|
|
60
|
+
value: "--inspect 127.0.0.1:9229",
|
|
61
|
+
expectedMatch: true,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "safe memory flag",
|
|
65
|
+
value: "--max-old-space-size=4096",
|
|
66
|
+
expectedMatch: false,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "safe GC flag",
|
|
70
|
+
value: "--expose-gc",
|
|
71
|
+
expectedMatch: false,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "safe trace flag",
|
|
75
|
+
value: "--trace-warnings",
|
|
76
|
+
expectedMatch: false,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "multiple flags with one malicious",
|
|
80
|
+
value: "--max-old-space-size=4096 --require ./evil.js",
|
|
81
|
+
expectedMatch: true,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "empty string",
|
|
85
|
+
value: "",
|
|
86
|
+
expectedMatch: false,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "whitespace only",
|
|
90
|
+
value: " ",
|
|
91
|
+
expectedMatch: false,
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
const DANGEROUS_ENV_VAR_CASES = [
|
|
96
|
+
{
|
|
97
|
+
name: "NODE_NO_WARNINGS set",
|
|
98
|
+
env: { NODE_NO_WARNINGS: "1" },
|
|
99
|
+
expectedWarnings: 1,
|
|
100
|
+
expectedVar: "NODE_NO_WARNINGS",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "NODE_PENDING_DEPRECATION set",
|
|
104
|
+
env: { NODE_PENDING_DEPRECATION: "1" },
|
|
105
|
+
expectedWarnings: 1,
|
|
106
|
+
expectedVar: "NODE_PENDING_DEPRECATION",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "UV_THREADPOOL_SIZE set",
|
|
110
|
+
env: { UV_THREADPOOL_SIZE: "128" },
|
|
111
|
+
expectedWarnings: 1,
|
|
112
|
+
expectedVar: "UV_THREADPOOL_SIZE",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "all dangerous vars set",
|
|
116
|
+
env: {
|
|
117
|
+
NODE_NO_WARNINGS: "1",
|
|
118
|
+
NODE_PENDING_DEPRECATION: "1",
|
|
119
|
+
UV_THREADPOOL_SIZE: "128",
|
|
120
|
+
},
|
|
121
|
+
expectedWarnings: 3,
|
|
122
|
+
expectedVar: null,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "no dangerous vars",
|
|
126
|
+
env: { PATH: "/usr/bin", HOME: "/home/user" },
|
|
127
|
+
expectedWarnings: 0,
|
|
128
|
+
expectedVar: null,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "dangerous var with empty value (falsy)",
|
|
132
|
+
env: { NODE_NO_WARNINGS: "" },
|
|
133
|
+
expectedWarnings: 0,
|
|
134
|
+
expectedVar: null,
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
const COMBINED_ATTACK_CASES = [
|
|
139
|
+
{
|
|
140
|
+
name: "NODE_OPTIONS attack + dangerous vars",
|
|
141
|
+
env: {
|
|
142
|
+
NODE_OPTIONS: "--require ./evil.js",
|
|
143
|
+
NODE_NO_WARNINGS: "1",
|
|
144
|
+
UV_THREADPOOL_SIZE: "128",
|
|
145
|
+
},
|
|
146
|
+
minWarnings: 3,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "multiple NODE_OPTIONS patterns",
|
|
150
|
+
env: {
|
|
151
|
+
NODE_OPTIONS: '--require ./a.js --eval "code" --inspect',
|
|
152
|
+
},
|
|
153
|
+
minWarnings: 3,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "clean environment",
|
|
157
|
+
env: {},
|
|
158
|
+
minWarnings: 0,
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
|
|
162
|
+
describe("auditEnvironment - NODE_OPTIONS Detection", () => {
|
|
163
|
+
for (const tc of NODE_OPTIONS_ATTACK_VECTORS) {
|
|
164
|
+
test(`should detect ${tc.name}`, () => {
|
|
165
|
+
const env = { NODE_OPTIONS: tc.value };
|
|
166
|
+
const warnings = auditEnvironment(env);
|
|
167
|
+
|
|
168
|
+
const hasSuspiciousWarning = warnings.some((w) =>
|
|
169
|
+
w.includes("NODE_OPTIONS contains code execution flag"),
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
if (tc.expectedMatch) {
|
|
173
|
+
assert.ok(
|
|
174
|
+
hasSuspiciousWarning,
|
|
175
|
+
`Expected warning for ${tc.name} but got: ${warnings.join(", ")}`,
|
|
176
|
+
);
|
|
177
|
+
} else {
|
|
178
|
+
assert.ok(
|
|
179
|
+
!hasSuspiciousWarning,
|
|
180
|
+
`Unexpected warning for ${tc.name}: ${warnings.join(", ")}`,
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
describe("auditEnvironment - Dangerous Env Vars", () => {
|
|
188
|
+
for (const tc of DANGEROUS_ENV_VAR_CASES) {
|
|
189
|
+
test(`should handle ${tc.name}`, () => {
|
|
190
|
+
const warnings = auditEnvironment(tc.env);
|
|
191
|
+
|
|
192
|
+
assert.strictEqual(
|
|
193
|
+
warnings.length,
|
|
194
|
+
tc.expectedWarnings,
|
|
195
|
+
`Expected ${tc.expectedWarnings} warnings, got ${warnings.length}: ${warnings.join(", ")}`,
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
if (tc.expectedVar) {
|
|
199
|
+
assert.ok(
|
|
200
|
+
warnings.some((w) => w.includes(tc.expectedVar)),
|
|
201
|
+
`Expected warning about ${tc.expectedVar} but got: ${warnings.join(", ")}`,
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
describe("auditEnvironment - Combined Attacks", () => {
|
|
209
|
+
for (const tc of COMBINED_ATTACK_CASES) {
|
|
210
|
+
test(`should handle ${tc.name}`, () => {
|
|
211
|
+
const warnings = auditEnvironment(tc.env);
|
|
212
|
+
|
|
213
|
+
assert.ok(
|
|
214
|
+
warnings.length >= tc.minWarnings,
|
|
215
|
+
`Expected at least ${tc.minWarnings} warnings, got ${warnings.length}: ${warnings.join(", ")}`,
|
|
216
|
+
);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
describe("auditEnvironment - Edge Cases", () => {
|
|
222
|
+
test("should handle undefined NODE_OPTIONS", () => {
|
|
223
|
+
const warnings = auditEnvironment({});
|
|
224
|
+
const hasSuspiciousWarning = warnings.some((w) =>
|
|
225
|
+
w.includes("NODE_OPTIONS contains code execution flag"),
|
|
226
|
+
);
|
|
227
|
+
assert.ok(!hasSuspiciousWarning);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
test("should handle null env (uses process.env)", () => {
|
|
231
|
+
const warnings = auditEnvironment();
|
|
232
|
+
assert.ok(Array.isArray(warnings));
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
test("should return empty array for completely clean env", () => {
|
|
236
|
+
const warnings = auditEnvironment({
|
|
237
|
+
PATH: "/usr/bin",
|
|
238
|
+
HOME: "/home/user",
|
|
239
|
+
LANG: "en_US.UTF-8",
|
|
240
|
+
});
|
|
241
|
+
assert.deepStrictEqual(warnings, []);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
test("should detect all dangerous vars individually", () => {
|
|
245
|
+
const warnings1 = auditEnvironment({ NODE_NO_WARNINGS: "1" });
|
|
246
|
+
const warnings2 = auditEnvironment({ NODE_PENDING_DEPRECATION: "1" });
|
|
247
|
+
const warnings3 = auditEnvironment({ UV_THREADPOOL_SIZE: "128" });
|
|
248
|
+
|
|
249
|
+
assert.strictEqual(warnings1.length, 1);
|
|
250
|
+
assert.strictEqual(warnings2.length, 1);
|
|
251
|
+
assert.strictEqual(warnings3.length, 1);
|
|
252
|
+
|
|
253
|
+
assert.ok(warnings1[0].includes("NODE_NO_WARNINGS"));
|
|
254
|
+
assert.ok(warnings2[0].includes("NODE_PENDING_DEPRECATION"));
|
|
255
|
+
assert.ok(warnings3[0].includes("UV_THREADPOOL_SIZE"));
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test("should be case-sensitive for env var names", () => {
|
|
259
|
+
const warnings = auditEnvironment({
|
|
260
|
+
node_no_warnings: "1",
|
|
261
|
+
Node_Options: "--require ./evil.js",
|
|
262
|
+
});
|
|
263
|
+
assert.strictEqual(warnings.length, 0);
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
describe("auditEnvironment - Warning Message Format", () => {
|
|
268
|
+
test("dangerous var warning should mention unsetting", () => {
|
|
269
|
+
const warnings = auditEnvironment({ NODE_NO_WARNINGS: "1" });
|
|
270
|
+
assert.ok(warnings[0].includes("Unset"));
|
|
271
|
+
assert.ok(warnings[0].includes("NODE_NO_WARNINGS"));
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
test("NODE_OPTIONS warning should mention the pattern", () => {
|
|
275
|
+
const warnings = auditEnvironment({ NODE_OPTIONS: "--require ./evil.js" });
|
|
276
|
+
assert.ok(warnings[0].includes("NODE_OPTIONS"));
|
|
277
|
+
assert.ok(warnings[0].includes("code execution flag"));
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
test("warnings should be human-readable strings", () => {
|
|
281
|
+
const warnings = auditEnvironment({
|
|
282
|
+
NODE_OPTIONS: "--eval test",
|
|
283
|
+
NODE_NO_WARNINGS: "1",
|
|
284
|
+
});
|
|
285
|
+
for (const w of warnings) {
|
|
286
|
+
assert.strictEqual(typeof w, "string");
|
|
287
|
+
assert.ok(w.length > 0);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
});
|
|
@@ -1052,7 +1052,7 @@ class Node {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
1054
|
// it's a top level pkg, or a dep of one
|
|
1055
|
-
if (!this.resolveParent
|
|
1055
|
+
if (!this.resolveParent?.resolveParent) {
|
|
1056
1056
|
return false;
|
|
1057
1057
|
}
|
|
1058
1058
|
|
|
@@ -1382,7 +1382,7 @@ class Node {
|
|
|
1382
1382
|
|
|
1383
1383
|
updateOverridesEdgeInRemoved(otherOverrideSet) {
|
|
1384
1384
|
// If this edge's overrides isn't equal to this node's overrides, then removing it won't change newOverrideSet later.
|
|
1385
|
-
if (!this.overrides
|
|
1385
|
+
if (!this.overrides?.isEqual(otherOverrideSet)) {
|
|
1386
1386
|
return false;
|
|
1387
1387
|
}
|
|
1388
1388
|
let newOverrideSet;
|
|
@@ -1453,7 +1453,7 @@ class Node {
|
|
|
1453
1453
|
|
|
1454
1454
|
addEdgeIn(edge) {
|
|
1455
1455
|
// We need to handle the case where the new edge in has an overrides field which is different from the current value.
|
|
1456
|
-
if (!this.overrides
|
|
1456
|
+
if (!this.overrides?.isEqual(edge.overrides)) {
|
|
1457
1457
|
this.updateOverridesEdgeInAdded(edge.overrides);
|
|
1458
1458
|
}
|
|
1459
1459
|
this.edgesIn.add(edge);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyclonedx/cdxgen",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.5",
|
|
4
4
|
"description": "Creates CycloneDX Software Bill of Materials (SBOM) from source or container image",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sbom",
|
|
@@ -129,21 +129,21 @@
|
|
|
129
129
|
"semver": "7.7.4",
|
|
130
130
|
"ssri": "13.0.1",
|
|
131
131
|
"table": "6.9.0",
|
|
132
|
-
"tar": "7.5.
|
|
132
|
+
"tar": "7.5.13",
|
|
133
133
|
"treeverse": "3.0.0",
|
|
134
134
|
"uuid": "13.0.0",
|
|
135
135
|
"walk-up-path": "4.0.0",
|
|
136
136
|
"xml-js": "1.6.11",
|
|
137
|
-
"yaml": "2.8.
|
|
137
|
+
"yaml": "2.8.3",
|
|
138
138
|
"yargs": "18.0.0",
|
|
139
139
|
"yoctocolors": "2.1.2"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
|
-
"@biomejs/biome": "2.4.
|
|
142
|
+
"@biomejs/biome": "2.4.10",
|
|
143
143
|
"esmock": "2.7.3",
|
|
144
|
-
"poku": "4.
|
|
144
|
+
"poku": "4.2.0",
|
|
145
145
|
"sinon": "21.0.3",
|
|
146
|
-
"typescript": "
|
|
146
|
+
"typescript": "6.0.2"
|
|
147
147
|
},
|
|
148
148
|
"optionalDependencies": {
|
|
149
149
|
"@appthreat/atom": "2.5.2",
|
package/types/lib/cli/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @param {Object} pkg Package object
|
|
8
8
|
* @param {string} ptype Package type
|
|
9
9
|
*/
|
|
10
|
-
export function listComponents(options:
|
|
10
|
+
export function listComponents(options: Object, allImports: Object, pkg: Object, ptype?: string): any[];
|
|
11
11
|
/**
|
|
12
12
|
* Function to create bom string for Java jars
|
|
13
13
|
*
|
|
@@ -16,43 +16,43 @@ export function listComponents(options: any, allImports: any, pkg: any, ptype?:
|
|
|
16
16
|
*
|
|
17
17
|
* @returns {Object} BOM with namespace mapping
|
|
18
18
|
*/
|
|
19
|
-
export function createJarBom(path: string, options:
|
|
19
|
+
export function createJarBom(path: string, options: Object): Object;
|
|
20
20
|
/**
|
|
21
21
|
* Function to create bom string for Android apps using blint
|
|
22
22
|
*
|
|
23
23
|
* @param {string} path to the project
|
|
24
24
|
* @param {Object} options Parse options from the cli
|
|
25
25
|
*/
|
|
26
|
-
export function createAndroidBom(path: string, options:
|
|
26
|
+
export function createAndroidBom(path: string, options: Object): {
|
|
27
27
|
bomJson: any;
|
|
28
28
|
dependencies: any;
|
|
29
29
|
parentComponent: any;
|
|
30
|
-
};
|
|
30
|
+
} | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* Function to create bom string for binaries using blint
|
|
33
33
|
*
|
|
34
34
|
* @param {string} path to the project
|
|
35
35
|
* @param {Object} options Parse options from the cli
|
|
36
36
|
*/
|
|
37
|
-
export function createBinaryBom(path: string, options:
|
|
37
|
+
export function createBinaryBom(path: string, options: Object): {
|
|
38
38
|
bomJson: any;
|
|
39
39
|
dependencies: any;
|
|
40
40
|
parentComponent: any;
|
|
41
|
-
};
|
|
41
|
+
} | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Function to create bom string for Java projects
|
|
44
44
|
*
|
|
45
45
|
* @param {string} path to the project
|
|
46
46
|
* @param {Object} options Parse options from the cli
|
|
47
47
|
*/
|
|
48
|
-
export function createJavaBom(path: string, options:
|
|
48
|
+
export function createJavaBom(path: string, options: Object): Promise<Object>;
|
|
49
49
|
/**
|
|
50
50
|
* Function to create bom string for Node.js projects
|
|
51
51
|
*
|
|
52
52
|
* @param {string} path to the project
|
|
53
53
|
* @param {Object} options Parse options from the cli
|
|
54
54
|
*/
|
|
55
|
-
export function createNodejsBom(path: string, options:
|
|
55
|
+
export function createNodejsBom(path: string, options: Object): Promise<Object>;
|
|
56
56
|
/**
|
|
57
57
|
* Function to create bom string for Projects that use Pixi package manager.
|
|
58
58
|
* createPixiBom is based on createPythonBom.
|
|
@@ -64,161 +64,161 @@ export function createNodejsBom(path: string, options: any): Promise<any>;
|
|
|
64
64
|
* @param {String} path
|
|
65
65
|
* @param {Object} options
|
|
66
66
|
*/
|
|
67
|
-
export function createPixiBom(path: string, options:
|
|
67
|
+
export function createPixiBom(path: string, options: Object): Object | null;
|
|
68
68
|
/**
|
|
69
69
|
* Function to create bom string for Python projects
|
|
70
70
|
*
|
|
71
71
|
* @param {string} path to the project
|
|
72
72
|
* @param {Object} options Parse options from the cli
|
|
73
73
|
*/
|
|
74
|
-
export function createPythonBom(path: string, options:
|
|
74
|
+
export function createPythonBom(path: string, options: Object): Promise<Object>;
|
|
75
75
|
/**
|
|
76
76
|
* Function to create bom string for Go projects
|
|
77
77
|
*
|
|
78
78
|
* @param {string} path to the project
|
|
79
79
|
* @param {Object} options Parse options from the cli
|
|
80
80
|
*/
|
|
81
|
-
export function createGoBom(path: string, options:
|
|
81
|
+
export function createGoBom(path: string, options: Object): Promise<Object | undefined>;
|
|
82
82
|
/**
|
|
83
83
|
* Function to create bom string for Rust projects
|
|
84
84
|
*
|
|
85
85
|
* @param {string} path to the project
|
|
86
86
|
* @param {Object} options Parse options from the cli
|
|
87
87
|
*/
|
|
88
|
-
export function createRustBom(path: string, options:
|
|
88
|
+
export function createRustBom(path: string, options: Object): Promise<Object | undefined>;
|
|
89
89
|
/**
|
|
90
90
|
* Function to create bom string for Dart projects
|
|
91
91
|
*
|
|
92
92
|
* @param {string} path to the project
|
|
93
93
|
* @param {Object} options Parse options from the cli
|
|
94
94
|
*/
|
|
95
|
-
export function createDartBom(path: string, options:
|
|
95
|
+
export function createDartBom(path: string, options: Object): Promise<Object>;
|
|
96
96
|
/**
|
|
97
97
|
* Function to create bom string for cpp projects
|
|
98
98
|
*
|
|
99
99
|
* @param {string} path to the project
|
|
100
100
|
* @param {Object} options Parse options from the cli
|
|
101
101
|
*/
|
|
102
|
-
export function createCppBom(path: string, options:
|
|
102
|
+
export function createCppBom(path: string, options: Object): Object;
|
|
103
103
|
/**
|
|
104
104
|
* Function to create bom string for clojure projects
|
|
105
105
|
*
|
|
106
106
|
* @param {string} path to the project
|
|
107
107
|
* @param {Object} options Parse options from the cli
|
|
108
108
|
*/
|
|
109
|
-
export function createClojureBom(path: string, options:
|
|
109
|
+
export function createClojureBom(path: string, options: Object): Object;
|
|
110
110
|
/**
|
|
111
111
|
* Function to create bom string for Haskell projects
|
|
112
112
|
*
|
|
113
113
|
* @param {string} path to the project
|
|
114
114
|
* @param {Object} options Parse options from the cli
|
|
115
115
|
*/
|
|
116
|
-
export function createHaskellBom(path: string, options:
|
|
116
|
+
export function createHaskellBom(path: string, options: Object): Object;
|
|
117
117
|
/**
|
|
118
118
|
* Function to create bom string for Elixir projects
|
|
119
119
|
*
|
|
120
120
|
* @param {string} path to the project
|
|
121
121
|
* @param {Object} options Parse options from the cli
|
|
122
122
|
*/
|
|
123
|
-
export function createElixirBom(path: string, options:
|
|
123
|
+
export function createElixirBom(path: string, options: Object): Object;
|
|
124
124
|
/**
|
|
125
125
|
* Function to create bom string for GitHub action workflows
|
|
126
126
|
*
|
|
127
127
|
* @param {string} path to the project
|
|
128
128
|
* @param {Object} options Parse options from the cli
|
|
129
129
|
*/
|
|
130
|
-
export function createGitHubBom(path: string, options:
|
|
130
|
+
export function createGitHubBom(path: string, options: Object): Object;
|
|
131
131
|
/**
|
|
132
132
|
* Function to create bom string for cloudbuild yaml
|
|
133
133
|
*
|
|
134
134
|
* @param {string} path to the project
|
|
135
135
|
* @param {Object} options Parse options from the cli
|
|
136
136
|
*/
|
|
137
|
-
export function createCloudBuildBom(path: string, options:
|
|
137
|
+
export function createCloudBuildBom(path: string, options: Object): Object;
|
|
138
138
|
/**
|
|
139
139
|
* Function to create obom string for the current OS using osquery
|
|
140
140
|
*
|
|
141
141
|
* @param {string} _path to the project
|
|
142
142
|
* @param {Object} options Parse options from the cli
|
|
143
143
|
*/
|
|
144
|
-
export function createOSBom(_path: string, options:
|
|
144
|
+
export function createOSBom(_path: string, options: Object): Promise<Object>;
|
|
145
145
|
/**
|
|
146
146
|
* Function to create bom string for Jenkins plugins
|
|
147
147
|
*
|
|
148
148
|
* @param {string} path to the project
|
|
149
149
|
* @param {Object} options Parse options from the cli
|
|
150
150
|
*/
|
|
151
|
-
export function createJenkinsBom(path: string, options:
|
|
151
|
+
export function createJenkinsBom(path: string, options: Object): Promise<Object>;
|
|
152
152
|
/**
|
|
153
153
|
* Function to create bom string for Helm charts
|
|
154
154
|
*
|
|
155
155
|
* @param {string} path to the project
|
|
156
156
|
* @param {Object} options Parse options from the cli
|
|
157
157
|
*/
|
|
158
|
-
export function createHelmBom(path: string, options:
|
|
158
|
+
export function createHelmBom(path: string, options: Object): Object;
|
|
159
159
|
/**
|
|
160
160
|
* Function to create bom string for swift projects
|
|
161
161
|
*
|
|
162
162
|
* @param {string} path to the project
|
|
163
163
|
* @param {Object} options Parse options from the cli
|
|
164
164
|
*/
|
|
165
|
-
export function createSwiftBom(path: string, options:
|
|
165
|
+
export function createSwiftBom(path: string, options: Object): Promise<Object>;
|
|
166
166
|
/**
|
|
167
167
|
* Function to create bom string for cocoa projects
|
|
168
168
|
*
|
|
169
169
|
* @param {string} path to the project
|
|
170
170
|
* @param {Object} options Parse options from the cli
|
|
171
171
|
*/
|
|
172
|
-
export function createCocoaBom(path: string, options:
|
|
172
|
+
export function createCocoaBom(path: string, options: Object): Promise<Object | undefined>;
|
|
173
173
|
/**
|
|
174
174
|
* Function to create bom string for Nix flakes
|
|
175
175
|
*
|
|
176
176
|
* @param {string} path to the project
|
|
177
177
|
* @param {Object} options Parse options from the cli
|
|
178
178
|
*/
|
|
179
|
-
export function createNixBom(path: string, options:
|
|
179
|
+
export function createNixBom(path: string, options: Object): Promise<Object>;
|
|
180
180
|
/**
|
|
181
181
|
* Function to create bom string for caxa SEA binaries
|
|
182
182
|
*
|
|
183
183
|
* @param {string} path to the project
|
|
184
184
|
* @param {Object} options Parse options from the cli
|
|
185
185
|
*/
|
|
186
|
-
export function createCaxaBom(path: string, options:
|
|
186
|
+
export function createCaxaBom(path: string, options: Object): Promise<Object>;
|
|
187
187
|
/**
|
|
188
188
|
* Function to create bom string for docker compose
|
|
189
189
|
*
|
|
190
190
|
* @param {string} path to the project
|
|
191
191
|
* @param {Object} options Parse options from the cli
|
|
192
192
|
*/
|
|
193
|
-
export function createContainerSpecLikeBom(path: string, options:
|
|
193
|
+
export function createContainerSpecLikeBom(path: string, options: Object): any;
|
|
194
194
|
/**
|
|
195
195
|
* Function to create bom string for php projects
|
|
196
196
|
*
|
|
197
197
|
* @param {string} path to the project
|
|
198
198
|
* @param {Object} options Parse options from the cli
|
|
199
199
|
*/
|
|
200
|
-
export function createPHPBom(path: string, options:
|
|
200
|
+
export function createPHPBom(path: string, options: Object): Object;
|
|
201
201
|
/**
|
|
202
202
|
* Function to create bom string for ruby projects
|
|
203
203
|
*
|
|
204
204
|
* @param {string} path to the project
|
|
205
205
|
* @param {Object} options Parse options from the cli
|
|
206
206
|
*/
|
|
207
|
-
export function createRubyBom(path: string, options:
|
|
207
|
+
export function createRubyBom(path: string, options: Object): Promise<Object>;
|
|
208
208
|
/**
|
|
209
209
|
* Function to create bom string for csharp projects
|
|
210
210
|
*
|
|
211
211
|
* @param {string} path to the project
|
|
212
212
|
* @param {Object} options Parse options from the cli
|
|
213
213
|
*/
|
|
214
|
-
export function createCsharpBom(path: string, options:
|
|
214
|
+
export function createCsharpBom(path: string, options: Object): Promise<Object | undefined>;
|
|
215
215
|
/**
|
|
216
216
|
* Function to create bom object for cryptographic certificate files
|
|
217
217
|
*
|
|
218
218
|
* @param {string} path to the project
|
|
219
219
|
* @param {Object} options Parse options from the cli
|
|
220
220
|
*/
|
|
221
|
-
export function createCryptoCertsBom(path: string, options:
|
|
221
|
+
export function createCryptoCertsBom(path: string, options: Object): Promise<{
|
|
222
222
|
bomJson: {
|
|
223
223
|
components: {
|
|
224
224
|
name: any;
|
|
@@ -241,11 +241,11 @@ export function createCryptoCertsBom(path: string, options: any): Promise<{
|
|
|
241
241
|
}>;
|
|
242
242
|
export function mergeDependencies(dependencies: any, newDependencies: any, parentComponent?: {}): ({
|
|
243
243
|
ref: string;
|
|
244
|
-
dependsOn: any;
|
|
245
|
-
provides: any;
|
|
244
|
+
dependsOn: any[];
|
|
245
|
+
provides: any[];
|
|
246
246
|
} | {
|
|
247
247
|
ref: string;
|
|
248
|
-
dependsOn: any;
|
|
248
|
+
dependsOn: any[];
|
|
249
249
|
provides?: undefined;
|
|
250
250
|
})[];
|
|
251
251
|
/**
|
|
@@ -266,28 +266,28 @@ export function trimComponents(components: any[]): any[];
|
|
|
266
266
|
*
|
|
267
267
|
* @returns {Object} Object including BOM Json
|
|
268
268
|
*/
|
|
269
|
-
export function dedupeBom(options:
|
|
269
|
+
export function dedupeBom(options: Object, components: any[], parentComponent: Object, dependencies: any[]): Object;
|
|
270
270
|
/**
|
|
271
271
|
* Function to create bom string for all languages
|
|
272
272
|
*
|
|
273
273
|
* @param {string[]} pathList list of to the project
|
|
274
274
|
* @param {Object} options Parse options from the cli
|
|
275
275
|
*/
|
|
276
|
-
export function createMultiXBom(pathList: string[], options:
|
|
276
|
+
export function createMultiXBom(pathList: string[], options: Object): Promise<Object>;
|
|
277
277
|
/**
|
|
278
278
|
* Function to create bom string for various languages
|
|
279
279
|
*
|
|
280
280
|
* @param {string} path to the project
|
|
281
281
|
* @param {Object} options Parse options from the cli
|
|
282
282
|
*/
|
|
283
|
-
export function createXBom(path: string, options:
|
|
283
|
+
export function createXBom(path: string, options: Object): Promise<any>;
|
|
284
284
|
/**
|
|
285
285
|
* Function to create bom string for various languages
|
|
286
286
|
*
|
|
287
287
|
* @param {string} path to the project
|
|
288
288
|
* @param {Object} options Parse options from the cli
|
|
289
289
|
*/
|
|
290
|
-
export function createBom(path: string, options:
|
|
290
|
+
export function createBom(path: string, options: Object): any;
|
|
291
291
|
/**
|
|
292
292
|
* Method to submit the generated bom to dependency-track or cyclonedx server
|
|
293
293
|
*
|
|
@@ -296,7 +296,7 @@ export function createBom(path: string, options: any): any;
|
|
|
296
296
|
* @return {Promise<{ token: string } | undefined>} a promise with a token (if request was successful) or undefined (in case of invalid arguments)
|
|
297
297
|
* @throws {Error} if the request fails
|
|
298
298
|
*/
|
|
299
|
-
export function submitBom(args:
|
|
299
|
+
export function submitBom(args: Object, bomContents: Object): Promise<{
|
|
300
300
|
token: string;
|
|
301
301
|
} | undefined>;
|
|
302
302
|
//# sourceMappingURL=index.d.ts.map
|