@cdxgen/cdxgen 13.2.0 → 13.3.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 +28 -12
- package/bin/cdxgen.js +227 -119
- package/bin/evinse.js +5 -0
- package/bin/sign.js +88 -14
- package/bin/tracebom.js +64 -4
- package/bin/validate.js +29 -7
- package/bin/verify.js +79 -39
- package/data/remediations.json +24 -0
- package/lib/cli/bomAssembly.js +105 -15
- package/lib/cli/cliOptions.js +93 -1
- package/lib/cli/index.js +43 -4
- package/lib/cli/jsBom.js +49 -24
- package/lib/cli/jvmBom.js +46 -12
- package/lib/cli/managedBom.js +112 -41
- package/lib/cli/nativeBom.js +125 -14
- package/lib/core/env.js +5 -6
- package/lib/core/fs.js +174 -6
- package/lib/core/metadataProperties.js +97 -0
- package/lib/core/projectConfig.js +31 -4
- package/lib/ecosystems/bunutils.js +269 -101
- package/lib/ecosystems/caxa.js +434 -2
- package/lib/ecosystems/cmakeResolver.js +66 -0
- package/lib/ecosystems/cppEvidence.js +64 -31
- package/lib/ecosystems/ecosystems.js +19 -8
- package/lib/ecosystems/gradleutils.js +42 -7
- package/lib/ecosystems/jsEvidence.js +19 -20
- package/lib/ecosystems/kosi.js +10 -3
- package/lib/ecosystems/npmutils.js +110 -9
- package/lib/ecosystems/parsers-dotnet.js +51 -10
- package/lib/ecosystems/parsers-go.js +47 -9
- package/lib/ecosystems/parsers-js.js +171 -50
- package/lib/ecosystems/parsers-misc.js +747 -161
- package/lib/ecosystems/parsers-python.js +26 -14
- package/lib/ecosystems/parsers-rust.js +24 -18
- package/lib/ecosystems/rubyutils.js +1426 -166
- package/lib/ecosystems/rusi.js +32 -1
- package/lib/evinser/evinser.js +436 -128
- package/lib/evinser/swiftsem.js +1914 -302
- package/lib/helpers/bomSigner.js +652 -221
- package/lib/inventory/atomUtils.js +568 -31
- package/lib/inventory/cdxrs.js +103 -12
- package/lib/inventory/depsUtils.js +183 -11
- package/lib/inventory/display.js +4 -5
- package/lib/inventory/dosai.js +550 -13
- package/lib/inventory/dynamic.js +39 -1
- package/lib/inventory/evidenceUtils.js +14 -6
- package/lib/inventory/fetchBatch.js +116 -17
- package/lib/inventory/protobom.js +8 -1
- package/lib/inventory/purl.js +152 -3
- package/lib/inventory/sbomDocument.js +2 -70
- package/lib/inventory/source.js +37 -19
- package/lib/inventory/traceRunner.js +210 -21
- package/lib/managers/binary.js +115 -24
- package/lib/managers/docker.js +440 -20
- package/lib/managers/oci.js +39 -1
- package/lib/parsers/cmakeLists.js +452 -0
- package/lib/parsers/largeJson.js +454 -0
- package/lib/parsers/npmrc.js +19 -1
- package/lib/stages/postgen/postgen.js +68 -15
- package/lib/validator/bomValidator.js +6 -16
- package/lib/validator/index.js +48 -10
- package/lib/validator/reporters/console.js +3 -0
- package/lib/validator/reporters/json.js +1 -0
- package/lib/validator/reporters/sarif.js +7 -0
- package/package.json +20 -20
- package/types/lib/cli/bomAssembly.d.ts +2 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +33 -1
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +55 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/metadataProperties.d.ts +39 -0
- package/types/lib/core/metadataProperties.d.ts.map +1 -0
- package/types/lib/core/projectConfig.d.ts +6 -2
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/ecosystems/bunutils.d.ts +12 -5
- package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
- package/types/lib/ecosystems/caxa.d.ts +14 -0
- package/types/lib/ecosystems/caxa.d.ts.map +1 -1
- package/types/lib/ecosystems/cmakeResolver.d.ts +23 -0
- package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/cppEvidence.d.ts +1 -1
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +20 -4
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts +5 -2
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts +13 -0
- package/types/lib/ecosystems/kosi.d.ts.map +1 -1
- package/types/lib/ecosystems/npmutils.d.ts +42 -0
- package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-go.d.ts +10 -0
- package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +10 -4
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts +67 -3
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts +143 -2
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts +13 -0
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +59 -9
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/swiftsem.d.ts +280 -15
- package/types/lib/evinser/swiftsem.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +106 -13
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/inventory/atomUtils.d.ts +145 -3
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/cdxrs.d.ts +8 -3
- package/types/lib/inventory/cdxrs.d.ts.map +1 -1
- package/types/lib/inventory/depsUtils.d.ts +15 -0
- package/types/lib/inventory/depsUtils.d.ts.map +1 -1
- package/types/lib/inventory/display.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +64 -1
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dynamic.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/plugins.d.ts.map +1 -1
- package/types/lib/inventory/protobom.d.ts.map +1 -1
- package/types/lib/inventory/purl.d.ts +71 -2
- package/types/lib/inventory/purl.d.ts.map +1 -1
- package/types/lib/inventory/sbomDocument.d.ts.map +1 -1
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/inventory/traceRunner.d.ts +47 -1
- package/types/lib/inventory/traceRunner.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts +30 -1
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +29 -0
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/managers/oci.d.ts +14 -0
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/parsers/cmakeLists.d.ts +76 -0
- package/types/lib/parsers/cmakeLists.d.ts.map +1 -0
- package/types/lib/parsers/largeJson.d.ts +52 -0
- package/types/lib/parsers/largeJson.d.ts.map +1 -0
- package/types/lib/parsers/npmrc.d.ts +5 -0
- package/types/lib/parsers/npmrc.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +10 -1
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/console.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
- package/types/lib/validator/reporters/sarif.d.ts.map +1 -1
|
@@ -3,6 +3,61 @@
|
|
|
3
3
|
* bundled native `atom` binary.
|
|
4
4
|
*/
|
|
5
5
|
export declare const ATOM_NATIVE_PACKAGES: Set<string>;
|
|
6
|
+
/**
|
|
7
|
+
* Locate the JSON compilation database (`compile_commands.json`) of a C/C++
|
|
8
|
+
* project, which lets atom parse each file with the include paths, macros and
|
|
9
|
+
* language its build uses.
|
|
10
|
+
*
|
|
11
|
+
* An explicit `options.compileCommands` (a file, or a directory holding one
|
|
12
|
+
* directly or under `build/`) wins. Otherwise the scan root, `build/`, `out/`,
|
|
13
|
+
* `builddir/`, `cmake-build-*` and the directory of `options.cmakeCache` are
|
|
14
|
+
* searched. A database can come with the code it describes, and atom asks the
|
|
15
|
+
* GCC or Clang driver it names (from the PATH, or an absolute path outside
|
|
16
|
+
* the project) for its predefined macros, so in secure mode only an explicit
|
|
17
|
+
* database is used.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} src Project scan root
|
|
20
|
+
* @param {Object} options CLI options
|
|
21
|
+
* @returns {string|undefined} Absolute path of the database
|
|
22
|
+
*/
|
|
23
|
+
export declare function findCompileCommands(src: string, options?: Object): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Split an atom command that may carry a leading argument (`node
|
|
26
|
+
* script.js`, a custom `ATOM_CMD`) into its binary and that argument. The
|
|
27
|
+
* first space only splits when it can: a binary under a path with spaces
|
|
28
|
+
* (`C:\Program Files\...\node.exe script.js`) would otherwise be cut
|
|
29
|
+
* mid-path and the shell told to run `C:\Program`. A command name without a
|
|
30
|
+
* path separator (`node script.js`) resolves through the PATH, so it splits
|
|
31
|
+
* at its first space as before; otherwise the first prefix that exists as a
|
|
32
|
+
* file is the binary, and when none does the first space keeps the old
|
|
33
|
+
* behaviour.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} command The atom command, possibly with an argument
|
|
36
|
+
* @returns {[string, string|undefined]} The binary and its leading argument, when present
|
|
37
|
+
*/
|
|
38
|
+
export declare function splitAtomCommand(command: string): [string, string | undefined];
|
|
39
|
+
/**
|
|
40
|
+
* The `--frontend-args` keys the installed atom accepts for a language, as
|
|
41
|
+
* `atom --frontend-args-keys -l <language>` lists them. Asked once per atom
|
|
42
|
+
* command and language. An atom that cannot list them (a release without
|
|
43
|
+
* `--frontend-args`, or one that fails to start) accepts none.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} language atom `-l` value
|
|
46
|
+
* @returns {Set<string>} Supported keys
|
|
47
|
+
*/
|
|
48
|
+
export declare function atomFrontendArgKeys(language: string): Set<string>;
|
|
49
|
+
/**
|
|
50
|
+
* The `--frontend-args` atom takes for a C/C++ language: the project's
|
|
51
|
+
* compilation database, when there is one and the installed atom reads it
|
|
52
|
+
* (atom 4 and later). An older atom is given the arguments it has always
|
|
53
|
+
* been given, and parses the sources without the database.
|
|
54
|
+
*
|
|
55
|
+
* @param {string} src Project scan root
|
|
56
|
+
* @param {string} language atom `-l` value
|
|
57
|
+
* @param {Object} options CLI options
|
|
58
|
+
* @returns {string[]} Arguments to add to the atom command
|
|
59
|
+
*/
|
|
60
|
+
export declare function atomCompileCommandsArgs(src: string, language: string, options?: Object): string[];
|
|
6
61
|
/**
|
|
7
62
|
* Convert cdxgen's glob-style exclude patterns to a Scala/Java regex string.
|
|
8
63
|
*
|
|
@@ -69,9 +124,19 @@ export declare function resolveAtomProvider(opts?: {
|
|
|
69
124
|
libc?: string;
|
|
70
125
|
};
|
|
71
126
|
/**
|
|
72
|
-
* Returns `"native"` or `"jar"` for the
|
|
73
|
-
*
|
|
74
|
-
*
|
|
127
|
+
* Returns `"native"` or `"jar"` for the atom provider that will actually run.
|
|
128
|
+
*
|
|
129
|
+
* The platform decides which provider atom prefers, but the dispatcher falls
|
|
130
|
+
* back to the jar package when the platform's native package is not installed
|
|
131
|
+
* (optional dependencies skipped, a failed download). The two take the heap
|
|
132
|
+
* ceiling differently, and a native-image runtime option on a jar run reaches
|
|
133
|
+
* atom as an unknown argument that fails every slice. So the kind follows what
|
|
134
|
+
* is installed where cdxgen can see it: the native binary means native, the jar
|
|
135
|
+
* package without it means jar. With neither in view (a custom `ATOM_CMD`, an
|
|
136
|
+
* install elsewhere) the platform's kind stands.
|
|
137
|
+
*
|
|
138
|
+
* Also used to gate Java/JDK advice, so users on the five native platforms are
|
|
139
|
+
* not told to install a JDK for a failure that has nothing to do with Java.
|
|
75
140
|
*/
|
|
76
141
|
export declare function atomProviderKind(): "jar" | "native";
|
|
77
142
|
/**
|
|
@@ -131,6 +196,41 @@ export declare function getAtomCommand(): any;
|
|
|
131
196
|
* @returns {number|undefined} Heap ceiling in bytes, or `undefined` to leave the runtime default in place
|
|
132
197
|
*/
|
|
133
198
|
export declare function atomMaxHeapBytes(): number | undefined;
|
|
199
|
+
/**
|
|
200
|
+
* Compute how long atom may run, and how long cdxgen waits for it.
|
|
201
|
+
*
|
|
202
|
+
* cdxgen's spawn timeout kills only the process cdxgen started, and for atom
|
|
203
|
+
* that is the npm dispatcher. The runtime under it (the native binary or the
|
|
204
|
+
* JVM) used to survive that kill, re-parented and still holding its heap. atom
|
|
205
|
+
* therefore gets its own limit, `ATOM_TIMEOUT`, which the dispatcher enforces on
|
|
206
|
+
* the runtime, and cdxgen's spawn timeout sits a grace period beyond it as the
|
|
207
|
+
* last resort.
|
|
208
|
+
*
|
|
209
|
+
* An explicit `ATOM_TIMEOUT` (milliseconds) sets atom's limit independently of
|
|
210
|
+
* `CDXGEN_TIMEOUT_MS`, which keeps bounding every other tool. Otherwise atom's
|
|
211
|
+
* limit is `CDXGEN_TIMEOUT_MS` less the grace period.
|
|
212
|
+
*
|
|
213
|
+
* @returns {{atomTimeoutMs: number, spawnTimeoutMs: number}} atom's own limit and cdxgen's spawn timeout for it
|
|
214
|
+
*/
|
|
215
|
+
export declare function atomTimeouts(): {
|
|
216
|
+
atomTimeoutMs: number;
|
|
217
|
+
spawnTimeoutMs: number;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Whether an atom run ended because it ran out of time.
|
|
221
|
+
*
|
|
222
|
+
* The dispatcher reports its own limit with status 124. cdxgen's spawn timeout
|
|
223
|
+
* shows up as `ETIMEDOUT`. A dispatcher older than the status code stops atom
|
|
224
|
+
* with SIGTERM and exits 1, so status 1 at or past the limit counts as well,
|
|
225
|
+
* unless atom's own output shows it failed for another reason first (an
|
|
226
|
+
* exhausted heap, a crash), which deserves its own diagnosis.
|
|
227
|
+
*
|
|
228
|
+
* @param {Object} result spawnSync result
|
|
229
|
+
* @param {number} elapsedMs How long the run took
|
|
230
|
+
* @param {number} atomTimeoutMs atom's time limit
|
|
231
|
+
* @returns {boolean} true when the run hit a time limit
|
|
232
|
+
*/
|
|
233
|
+
export declare function atomRunTimedOut(result: Object, elapsedMs: number, atomTimeoutMs: number): boolean;
|
|
134
234
|
/**
|
|
135
235
|
* Execute the atom tool against a source directory or file with the given arguments.
|
|
136
236
|
*
|
|
@@ -145,6 +245,48 @@ export declare function atomMaxHeapBytes(): number | undefined;
|
|
|
145
245
|
* @returns {boolean} `true` if atom executed successfully and the language is supported; `false` otherwise
|
|
146
246
|
*/
|
|
147
247
|
export declare function executeAtom(src: string, args: string[], extra_env?: Object): boolean;
|
|
248
|
+
/**
|
|
249
|
+
* The numbered chunks atom wrote beside a reachables slices file.
|
|
250
|
+
*
|
|
251
|
+
* atom writes reachables at most 1000 flows per file: `<base>.json`, then
|
|
252
|
+
* `<base>_1.json`, `<base>_2.json` and so on. Chunks are taken until the first
|
|
253
|
+
* gap. A chunk older than the base file was left by an earlier run with more
|
|
254
|
+
* flows (atom before 4.0.0 did not remove those), so it ends the sequence
|
|
255
|
+
* instead of being merged.
|
|
256
|
+
*
|
|
257
|
+
* @param {string} slicesFile Path of the base reachables slices file
|
|
258
|
+
* @returns {string[]} Chunk file paths, in order
|
|
259
|
+
*/
|
|
260
|
+
export declare function reachablesChunkFiles(slicesFile: string): string[];
|
|
261
|
+
/**
|
|
262
|
+
* Remove the numbered chunks beside a reachables slices file, before atom
|
|
263
|
+
* writes a new set there, so no chunk of an earlier run survives next to it.
|
|
264
|
+
*
|
|
265
|
+
* @param {string} slicesFile Path of the base reachables slices file
|
|
266
|
+
*/
|
|
267
|
+
export declare function removeReachablesChunkFiles(slicesFile: string): void;
|
|
268
|
+
/**
|
|
269
|
+
* Read an atom slices file, or warn and return `undefined` when it cannot be
|
|
270
|
+
* parsed. A run stopped while writing (a timeout, a kill) can leave a
|
|
271
|
+
* truncated file, and the evidence from the other slices is still worth
|
|
272
|
+
* keeping.
|
|
273
|
+
*
|
|
274
|
+
* @param {string} slicesFile Path of the slices file
|
|
275
|
+
* @param {string} sliceType Slice type, for the warning
|
|
276
|
+
* @returns {*} The parsed slices, or `undefined`
|
|
277
|
+
*/
|
|
278
|
+
export declare function readSlicesFile(slicesFile: string, sliceType: string): any;
|
|
279
|
+
/**
|
|
280
|
+
* Read a reachables slices file together with its chunks.
|
|
281
|
+
*
|
|
282
|
+
* Reading only the base file silently dropped every flow past the first
|
|
283
|
+
* thousand. A chunk that cannot be parsed ends the sequence, keeping the flows
|
|
284
|
+
* read before it.
|
|
285
|
+
*
|
|
286
|
+
* @param {string} slicesFile Path of the base reachables slices file
|
|
287
|
+
* @returns {Object[]|Object|undefined} Every flow, in the base file's shape (an array, or an object with `reachables`)
|
|
288
|
+
*/
|
|
289
|
+
export declare function readReachablesSlices(slicesFile: string): Object[] | Object | undefined;
|
|
148
290
|
/**
|
|
149
291
|
* Find the imported modules in the application with atom parsedeps command
|
|
150
292
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/atomUtils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atomUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/atomUtils.js"],"names":[],"mappings":"AAyDA;;;GAGG;A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AAgB,cAAc,CAAC,UAAU,EAJ9B,MAI8B,EAAE,SAAS,EAHzC,MAGyC,GAFvC,GAAC,CAcb;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAHpC,MAGoC,GAFlC,MAAM,EAAE,GAAC,MAAM,GAAC,SAAS,CAwBrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EARM,MAQN,EACH,QAAQ,EARC,MAQD,EACR,WAAW,GARF,MAQa,EACtB,UAAU,GARD,MAQa,EACtB,OAAO,GARE,MAQG,OA8Cb"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module is the ONLY place that spawns the `cdxrs` binary. It enforces
|
|
5
5
|
* the governing invariant: **no failure mode may abort SBOM generation.**
|
|
6
|
-
* Every failure (missing binary, non-zero exit, timeout,
|
|
7
|
-
* version-major mismatch, CDXGEN_RS_DISABLE) logs once at
|
|
8
|
-
* a sentinel that makes the caller take the JS path.
|
|
6
|
+
* Every failure (missing binary, non-zero exit, timeout, oversized stdout,
|
|
7
|
+
* malformed stdout, version-major mismatch, CDXGEN_RS_DISABLE) logs once at
|
|
8
|
+
* `warn` and returns a sentinel that makes the caller take the JS path.
|
|
9
9
|
*
|
|
10
10
|
* Protocol:
|
|
11
11
|
* cdxrs <subcommand> --input <file|-> --output <file|-> --format json
|
|
@@ -67,6 +67,11 @@ export declare function cdxrsAvailable(subcommand?: string): {
|
|
|
67
67
|
*
|
|
68
68
|
* Passing `content` is the normal case, since cdxgen holds BOMs in memory.
|
|
69
69
|
*
|
|
70
|
+
* Collected stdout is bounded: it must become a single JS string, so a child
|
|
71
|
+
* that would exceed V8's string limit (by default; see
|
|
72
|
+
* CDXGEN_RS_MAX_STDOUT_BYTES) is killed and reported as a fallback instead of
|
|
73
|
+
* crashing the process at the concat.
|
|
74
|
+
*
|
|
70
75
|
* @param {string} subcommand The subcommand to run (e.g. "info").
|
|
71
76
|
* @param {Object} opts
|
|
72
77
|
* @param {string|Buffer} [opts.content] BOM data to feed over stdin.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdxrs.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cdxrs.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"cdxrs.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cdxrs.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoEH,iFAAiF;AACjF,eAAO,MAAM,cAAc;;;;;EAKzB,CAAC;AAOH;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAH7B,MAG6B,GAF3B,OAAO,CAkBnB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAFlB,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,UAAU,AAHtC,CACA,EADQ,MAG8B,GAF5B;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAuBrE;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,QAAQ,CAAC,UAAU,EAT9B,MAS8B,EAAE,IAAI,GAP5C;IAA6B,OAAO,AAApC,CACA,EADQ,MAAM,GAAC,MAAM,CACrB;IAAsB,KAAK,AAA3B,CAEA,EAFQ,MAAM,CAEd;IAAwB,IAAI,AAA5B,CACA,EADQ,MAAM,EAAE,CAChB;IAAsB,SAAS,AAA/B,CACA,EADQ,MAAM,CACd;CAEiD,GAFvC,OAAO,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAC,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAgS1F"}
|
|
@@ -29,6 +29,21 @@ export declare function markNpmTypesPackagesAsExcluded(components?: Object[]): O
|
|
|
29
29
|
* @returns {Object[]} The same component array with scopes updated in place
|
|
30
30
|
*/
|
|
31
31
|
export declare function propagateRequiredScopeFromDependencies(components?: Object[], dependencies?: Object[]): Object[];
|
|
32
|
+
/**
|
|
33
|
+
* Scopes the dependencies of type-only npm packages as optional.
|
|
34
|
+
*
|
|
35
|
+
* A package imported only for its TypeScript types, like an `@types` package,
|
|
36
|
+
* is erased at compile time, and so is what it depends on unless a runtime
|
|
37
|
+
* package depends on it too. A component below a type-only package becomes
|
|
38
|
+
* optional when no dependency path from a root of the graph reaches it without
|
|
39
|
+
* passing through a type-only package. A component that already has a scope,
|
|
40
|
+
* from its manifest or from usage evidence, keeps it.
|
|
41
|
+
*
|
|
42
|
+
* @param {Object[]} components CycloneDX component objects
|
|
43
|
+
* @param {Object[]} dependencies CycloneDX dependency entries
|
|
44
|
+
* @returns {Object[]} The same component array with scopes updated in place
|
|
45
|
+
*/
|
|
46
|
+
export declare function markTypeOnlyDependenciesOptional(components?: Object[], dependencies?: Object[]): Object[];
|
|
32
47
|
/**
|
|
33
48
|
* Merge CycloneDX services using bom-ref or group/name/version identity.
|
|
34
49
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depsUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/depsUtils.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EANH,MAAM,EAMH,EACZ,eAAe,EANN,MAAM,EAMA,EACf,eAAe,GANN,MAMW,GALT,MAAM,EAAE,CAuEpB;AA4CD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,GAH9C,MAAM,EAG6C,GAFjD,MAAM,EAAE,CAYpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sCAAsC,CACpD,UAAU,GALD,MAAM,EAKA,EACf,YAAY,GALH,MAAM,EAKE,GAJN,MAAM,EAAE,CA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V,UAAU,AANT,CACA,EADQ,MAMU,EACnB,UAAU,AANT,CACA,EADQ,OAMY,GALV,MAAM,EAAE,CA8BpB;AA6BD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAPE,MAOF,EACP,WAAW,AAPV,CACA,EADQ,MAAM,EAOQ,EACvB,SAAS,AAPR,CACA,EADQ,MAOY,EACrB,WAAW,AAPV,CACA,EADQ,MAOc,GANZ,IAAI,CA+EhB;AAQD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAHzB,MAGyB,GAFvB,IAAI,CAsBhB;AACD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAH1B,MAG0B,GAFxB,IAAI,CAwBhB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAH7B,MAG6B,GAF3B,IAAI,CAuBhB;AA0BD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAH7B,MAG6B,GAF3B,IAAI,CAwChB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAH3B,MAG2B,GAFzB,IAAI,CA+ChB;AACD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EANE,MAMF,EACP,IAAI,AANH,CACA,EADQ,MAMS,EAClB,SAAS,AANR,CACA,EADQ,MAMY,GALV,IAAI,CAoChB;AAkJD;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,iBAJ1B,MAAM,EAAE,SACR,MAAM,KACJ,MAAM,EAyClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAHnC,MAGmC,GAFjC,IAAI,
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../lib/inventory/display.js"],"names":[],"mappings":"AAwKA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAHnC,MAGmC,GAFjC,MAAM,EAAE,CAkFpB;AAED;;;;GAIG;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,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,CAAiB;AA6DrH;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,gBAAgB,GAHnD,eAAe,EAGyC,GAFtD,IAAI,CA+BhB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EANC,MAMD,EACR,MAAM,EANG,MAMH,EACN,OAAO,EANE,MAMF,EACP,gBAAgB,EANP,eAAe,EAMR,QAgUjB"}
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translate cdxgen --exclude globs into dosai --exclude globs.
|
|
3
|
+
*
|
|
4
|
+
* Dosai is an evidence analyzer, so the translation follows the exclude
|
|
5
|
+
* filter cdxgen already applies to atom evidence slices
|
|
6
|
+
* (`globPatternsToAtomIgnoreRegex`): a relative pattern matches at any depth,
|
|
7
|
+
* and an absolute pattern is anchored to the scanned directory. Dosai itself
|
|
8
|
+
* uses gitignore conventions, where a pattern with a slash is anchored, so
|
|
9
|
+
* relative patterns get a leading "**\/". Like the atom filter, and unlike
|
|
10
|
+
* cdxgen's file discovery, excluding a directory also excludes everything
|
|
11
|
+
* beneath it.
|
|
12
|
+
*
|
|
13
|
+
* Brace groups and numeric ranges are expanded, and comma separated lists are
|
|
14
|
+
* split, since dosai reads both as literal text. Character classes, extglobs,
|
|
15
|
+
* escapes, negation, and patterns that step outside the scanned directory
|
|
16
|
+
* have no dosai equivalent; they are reported as skipped rather than passed
|
|
17
|
+
* on as literals that match nothing. So is any pattern that still carries a
|
|
18
|
+
* character outside a small allowlist, such as a literal brace group or a
|
|
19
|
+
* shell metacharacter. Dosai matches case-sensitively on Linux.
|
|
20
|
+
*
|
|
21
|
+
* @param {string[]} excludes cdxgen exclude globs
|
|
22
|
+
* @param {string} srcPath Absolute directory dosai scans
|
|
23
|
+
* @returns {{patterns: string[], skipped: string[], truncated: number}} Translated patterns, dropped patterns, and how many were left out by the cap
|
|
24
|
+
*/
|
|
25
|
+
export declare function toDosaiExcludePatterns(excludes: string[], srcPath: string): {
|
|
26
|
+
patterns: string[];
|
|
27
|
+
skipped: string[];
|
|
28
|
+
truncated: number;
|
|
29
|
+
};
|
|
1
30
|
/**
|
|
2
31
|
* Check whether a language is a .NET language supported by dosai analysis.
|
|
3
32
|
*
|
|
@@ -12,6 +41,40 @@ export declare function isDosaiDotnetLanguage(language: string): boolean;
|
|
|
12
41
|
* @returns {Object|undefined} Parsed JSON content, or undefined when missing or invalid
|
|
13
42
|
*/
|
|
14
43
|
export declare function readDosaiJsonFile(jsonFile: string): Object | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Read a dosai methods report of any size.
|
|
46
|
+
*
|
|
47
|
+
* A report that fits in one JavaScript string is parsed whole. A larger one is
|
|
48
|
+
* read in bounded runs, keeping the requested sections, the CallGraph nodes and
|
|
49
|
+
* edges that PackageReachability references, and the MethodCalls accepted by
|
|
50
|
+
* `keepMethodCall` (none when it is omitted). Nothing cdxgen reads is lost.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} reportFile Path to the dosai methods JSON
|
|
53
|
+
* @param {Object} [options] Options
|
|
54
|
+
* @param {string[]} [options.sections] Sections to keep from a large report (default: every section cdxgen reads)
|
|
55
|
+
* @param {Function} [options.keepMethodCall] Predicate choosing the MethodCalls to keep from a large report
|
|
56
|
+
* @param {number} [options.maxTextBytes] Largest report parsed whole, for tests
|
|
57
|
+
* @returns {Object|undefined} Parsed report, or undefined when missing or invalid
|
|
58
|
+
*/
|
|
59
|
+
export declare function readDosaiMethodsReport(reportFile: string, options?: {
|
|
60
|
+
sections?: string[];
|
|
61
|
+
keepMethodCall?: Function;
|
|
62
|
+
maxTextBytes?: number;
|
|
63
|
+
}): Object | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Read a dosai data-flow report of any size.
|
|
66
|
+
*
|
|
67
|
+
* A report that fits in one JavaScript string is parsed whole. A larger one
|
|
68
|
+
* keeps Metadata, Slices, PackageReachability, and the Nodes those reference.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} reportFile Path to the dosai data-flow JSON
|
|
71
|
+
* @param {Object} [options] Options
|
|
72
|
+
* @param {number} [options.maxTextBytes] Largest report parsed whole, for tests
|
|
73
|
+
* @returns {Object|undefined} Parsed report, or undefined when missing or invalid
|
|
74
|
+
*/
|
|
75
|
+
export declare function readDosaiDataFlowReport(reportFile: string, options?: {
|
|
76
|
+
maxTextBytes?: number;
|
|
77
|
+
}): Object | undefined;
|
|
15
78
|
/**
|
|
16
79
|
* Run a dosai subcommand ("methods", "dataflows", or "crypto") against a source
|
|
17
80
|
* tree and write its JSON output to the given file.
|
|
@@ -19,7 +82,7 @@ export declare function readDosaiJsonFile(jsonFile: string): Object | undefined;
|
|
|
19
82
|
* @param {string} command Dosai subcommand to execute
|
|
20
83
|
* @param {string} src Source directory to analyze
|
|
21
84
|
* @param {string} outputFile Path where the dosai JSON output is written
|
|
22
|
-
* @param {Object} [options] Options carrying dosaiCommand, dataFlowPatterns, or
|
|
85
|
+
* @param {Object} [options] Options carrying dosaiCommand, dataFlowPatterns, patternPacks, or exclude globs
|
|
23
86
|
* @returns {boolean} True when the command succeeded and produced the output file, false otherwise
|
|
24
87
|
*/
|
|
25
88
|
export declare function runDosaiCommand(command: string, src: string, outputFile: string, options?: Object): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dosai.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dosai.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dosai.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dosai.js"],"names":[],"mappings":"AA6WA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAJpC,MAAM,EAI8B,EAAE,OAAO,EAH7C,MAG6C,GAF3C;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC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,OAEmE,SA6FrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAJ/C,MAI+C,EAAE,WAAW,AAHpE,CACA,EADQ,MAGiE,GAF/D,MAAM,CAyKlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,YAAY,EALH,MAKG,EACZ,WAAW,AALV,CACA,EADQ,MAKO,GAJL,MAAM,CA+GlB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,AAHjD,CACA,EADQ,MAG8C,GAF5C,MAAM,EAAE,CA6CpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dynamic.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAND,MAMC,EACV,UAAU,EAND,MAMC,EACV,YAAY,AANX,CACA,EADQ,MAMQ,GALN,OAAO,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"dynamic.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dynamic.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAND,MAMC,EACV,UAAU,EAND,MAMC,EACV,YAAY,AANX,CACA,EADQ,MAMQ,GALN,OAAO,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,CA4JzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidenceUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/evidenceUtils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evidenceUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/evidenceUtils.js"],"names":[],"mappings":"AA+BA;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAJtC,MAIsC,EAAE,OAAO,AAHvD,CACA,EADQ,MAGoD,GAFlD,MAAM,GAAC,SAAS,CAgB5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAJ7C,MAI6C,EAAE,OAAO,AAH9D,CACA,EADQ,MAG2D,GAFzD,MAAM,GAAC,SAAS,CA8B5B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAHxC,MAGwC,GAFtC,MAAM,CAalB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAJ1B,MAAM,EAAE,GAAC,MAIiB,EAAE,SAAS,UAAA,GAFnC,MAAM,EAAE,CAmDpB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAJjC,MAAM,GAAC,MAAM,EAIoB,EAAE,QAAQ,EAH3C,MAAM,EAGqC,GAFzC,MAAM,GAAC,MAAM,EAAE,CAwB3B;AAsCD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAJjC,MAAM,EAI2B,EAAE,UAAU,EAH7C,MAG6C,GAF3C,MAAM,EAAE,CAwOpB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EANJ,MAMI,EACb,QAAQ,EANC,MAMD,EACR,OAAO,OAAA,EACP,OAAO,UAAQ,EACf,gBAAgB,YAAY;;;;;;;;;IA6H7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchBatch.d.ts","sourceRoot":"","sources":["../../../lib/inventory/fetchBatch.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA8EH;;;GAGG;AACH,wBAAgB,cAAc,IAHjB,M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AACH,wBAAgB,kBAAkB,CAAC,UAAU,EARlC,GAAG,CAAC,MAAM,EAAE,UAAU,CAQY,EAAE,GAAG,EAPvC,MAOuC,GANrC;IAAC,IAAI,EAAE,GAAC,CAAA;CAAC,GAAC,SAAS,CAoB/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,IAFlB,OAAO,CAOnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../lib/inventory/plugins.js"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH,wBAAgB,mBAAmB,IAFtB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAC,CAgCpF;AA8DD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,IAXvB;IACR,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,GAAC,SAAS,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,GAAC,SAAS,CAAC;IACrC,aAAa,EAAE,MAAM,GAAC,SAAS,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB,CAqMH;AAYD;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAF1B,UAAU,CAAC,OAAO,oBAAoB,CAAC,CASnD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,AAH5C,CACA,EADQ,UAAU,CAAC,OAAO,oBAAoB,CAGU,GAF9C,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAWnD;
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../lib/inventory/plugins.js"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH,wBAAgB,mBAAmB,IAFtB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M,GAAC,SAAS,cAChB,MAAM,SAYhB,CAAC;AAgCF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,YAJb,MAAM,GAAG,MAAM,WACf,MAAM,gBACN,MAAM,GAAG,MAAM,SAezB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,YAJZ,MAAM,UACN,OAAO,gBACP,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"protobom.d.ts","sourceRoot":"","sources":["../../../lib/inventory/protobom.js"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EAAE,cAAc,EAAE,CAAC;AAsB1B;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,gBAH7B,MAAM,GAAC,SAAS,KACd,OAGgE,CAAC;AAE9E;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B,gBAHjC,MAAM,GAAC,SAAS,cAChB,MAAM,SAYhB,CAAC;AAgCF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,YAJb,MAAM,GAAG,MAAM,WACf,MAAM,gBACN,MAAM,GAAG,MAAM,SAezB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,YAJZ,MAAM,UACN,OAAO,gBACP,MAAM,GAAG,MAAM,4FAwBzB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,YAJb,MAAM,GAAG,MAAM,gBACf,MAAM,GAAG,MAAM,KACb,MAKV,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,qBAAqB,YALvB,MAAM,GAAG,MAAM,qBACf,MAAM,GAAG,MAAM,gBACf,MAAM,GAAG,MAAM,KACb;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAahD,CAAC"}
|
|
@@ -35,8 +35,17 @@ export declare function purlTypeIsRegistered(type: string): boolean;
|
|
|
35
35
|
*/
|
|
36
36
|
export declare function purlTypeIsRegisteredString(purlString: string): boolean;
|
|
37
37
|
/**
|
|
38
|
-
* Encode a string for
|
|
39
|
-
*
|
|
38
|
+
* Encode a string for inclusion in a hand-written PackageURL string,
|
|
39
|
+
* percent-encoding every character the purl grammar does not allow literally,
|
|
40
|
+
* while preserving already-encoded `%40` sequences and keeping `:` and `/`
|
|
41
|
+
* unencoded.
|
|
42
|
+
*
|
|
43
|
+
* `encodeURIComponent` alone leaves `!`, `'`, `(`, `)` and `*` literal, and the
|
|
44
|
+
* purl grammar requires them escaped, so they are escaped here as well.
|
|
45
|
+
*
|
|
46
|
+
* Only for comparing against or assembling purl text. Never pass the result to
|
|
47
|
+
* `build()`, `new Purl()` or one of the helpers in this module: they escape
|
|
48
|
+
* their inputs themselves, and escaping twice turns `+` into `%252B`.
|
|
40
49
|
*
|
|
41
50
|
* @param {string} s String to encode
|
|
42
51
|
* @returns {string} Encoded string suitable for use in a PackageURL component
|
|
@@ -195,6 +204,66 @@ export declare function genericPurl(name: string): string | null;
|
|
|
195
204
|
* @returns {boolean} true when cdx-purl parses it
|
|
196
205
|
*/
|
|
197
206
|
export declare function isValidPurl(candidate: string): boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Split a purl into its components without requiring it to be well-formed.
|
|
209
|
+
*
|
|
210
|
+
* `Purl.parse` rejects a purl whose parts are not already escaped, which is the
|
|
211
|
+
* case this exists to handle: a `bom-ref` (cdxgen writes the decoded form of the
|
|
212
|
+
* purl there), a `go mod graph` token such as `github.com/Azure/go-autorest@v14.2.0+incompatible`,
|
|
213
|
+
* or a purl from a third-party document that left a `+` or a `://` unescaped.
|
|
214
|
+
* The separators (`:`, `/`, `@`, `?`, `#`, `&`, `=`) are structural and are read
|
|
215
|
+
* positionally; everything between them is decoded and handed back raw, ready
|
|
216
|
+
* for `build` to escape correctly.
|
|
217
|
+
*
|
|
218
|
+
* The version is taken after the last `@` of the path, so a scoped npm name
|
|
219
|
+
* (`@scope/name@1.0.0`) and a composer branch version (`dev-feature/x`) both
|
|
220
|
+
* split correctly.
|
|
221
|
+
*
|
|
222
|
+
* @param {string} purl Purl to split
|
|
223
|
+
* @returns {{type: string, namespace: (string|null), name: string, version: (string|null), qualifiers: (Object|null), subpath: (string|null)}|null} Parts, or null when the purl has no type and name
|
|
224
|
+
*/
|
|
225
|
+
export declare function splitPurlLoose(purl: string): {
|
|
226
|
+
type: string;
|
|
227
|
+
namespace: (string | null);
|
|
228
|
+
name: string;
|
|
229
|
+
version: (string | null);
|
|
230
|
+
qualifiers: (Object | null);
|
|
231
|
+
subpath: (string | null);
|
|
232
|
+
} | null;
|
|
233
|
+
/**
|
|
234
|
+
* Parse a purl string that may carry unescaped reserved characters.
|
|
235
|
+
*
|
|
236
|
+
* A well-formed purl is parsed strictly, so its components come back exactly as
|
|
237
|
+
* cdx-purl reads them. Anything else is split structurally by
|
|
238
|
+
* {@link splitPurlLoose}. Use this where the input is known to be a decoded or
|
|
239
|
+
* hand-written purl (a `bom-ref`, a workspace reference, a package manager's
|
|
240
|
+
* `name@version` token), never to accept an invalid purl into a `purl` field:
|
|
241
|
+
* pass the parts to `build()` instead, which escapes them.
|
|
242
|
+
*
|
|
243
|
+
* @param {string} purlString Purl or decoded purl
|
|
244
|
+
* @returns {{type: string, namespace: (string|null), name: string, version: (string|null), qualifiers: (Object|null), subpath: (string|null)}|null} Raw components, or null when nothing purl-shaped remains
|
|
245
|
+
*/
|
|
246
|
+
export declare function parsePurlLoose(purlString: string): {
|
|
247
|
+
type: string;
|
|
248
|
+
namespace: (string | null);
|
|
249
|
+
name: string;
|
|
250
|
+
version: (string | null);
|
|
251
|
+
qualifiers: (Object | null);
|
|
252
|
+
subpath: (string | null);
|
|
253
|
+
} | null;
|
|
254
|
+
/**
|
|
255
|
+
* Turn a decoded or hand-written purl into a canonical, correctly escaped one.
|
|
256
|
+
*
|
|
257
|
+
* `bom-ref` values are the decoded form of a purl
|
|
258
|
+
* (`pkg:npm/foo@1.0.0+build`), which cdx-purl rightly rejects as a purl. This
|
|
259
|
+
* recovers the purl the ref was made from by splitting it structurally and
|
|
260
|
+
* rebuilding it with `build()`, so every reserved character is escaped exactly
|
|
261
|
+
* once.
|
|
262
|
+
*
|
|
263
|
+
* @param {string} purlString Purl or decoded purl
|
|
264
|
+
* @returns {string|null} Canonical purl string, or `null` when no valid purl can be built
|
|
265
|
+
*/
|
|
266
|
+
export declare function canonicalPurlFromLooseString(purlString: string): string | null;
|
|
198
267
|
/**
|
|
199
268
|
* Parse a purl string, returning `null` instead of throwing when it is invalid.
|
|
200
269
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purl.d.ts","sourceRoot":"","sources":["../../../lib/inventory/purl.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,aAAmC,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAH9B,MAG8B,GAF5B,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAH1C,MAG0C,GAFxC,OAAO,CASnB;AAED
|
|
1
|
+
{"version":3,"file":"purl.d.ts","sourceRoot":"","sources":["../../../lib/inventory/purl.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,aAAmC,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAH9B,MAG8B,GAF5B,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAH1C,MAG0C,GAFxC,OAAO,CASnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAHpB,MAGoB,GAFlB,MAAM,CAYlB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAHvB,MAGuB,GAFrB,MAAM,GAAC,IAAI,CAcvB;AAED;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,IAI6B,EAAE,WAAW,AAHzD,CACA,EADQ,MAGiD,GAF/C,MAAM,CAWlB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAJnC,MAImC,EAAE,QAAQ,AAHrD,CACA,EADQ,MAG6C,GAF3C,MAAM,CAiClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,UAAU,EAJvB,MAIuB,EAAE,GAAG,AAHpC,CACA,EADQ,MAG4B,GAF1B,MAAM,GAAC,IAAI,CA4BvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAL3B,MAK2B,EAAE,OAAO,EAJpC,MAIoC,EAAE,OAAO,EAH7C,MAG6C,GAF3C,UAAU,GAAC,SAAS,CAuDhC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAH9B,MAG8B,UAExC;AAwCD;;;;;;;;;GASG;AACH,wBAAgB,2CAA2C,CAAC,WAAW,EAH5D,MAG4D,GAF1D,CAAC,MAAM,GAAC,IAAI,CAAC,EAAE,CA6H3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sbomDocument.d.ts","sourceRoot":"","sources":["../../../lib/inventory/sbomDocument.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sbomDocument.d.ts","sourceRoot":"","sources":["../../../lib/inventory/sbomDocument.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAF1B,MAE4C,CAAC;AAsBvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAPK,MAOL,EACJ,EAAE,MAAkB,EAAE,QAAkC,EAAE,AAPzD,CAGA,EAFA;IAAuB,MAAM,AAA7B,CACA,EADQ,MAAM,CACd;IAAuB,QAAQ,AAA/B,CACA,EADQ,MAAM,CACd;CAI8D,GAJpD;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,MAAM,GAAC,SAAS,CAAC,CAAA;CAAC,GAAC,IAAI,CAoE5G;AAwBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAFzB,MAEyB,QAsBnC;AAsDD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAJjC,MAAM,EAI2B,EAAE,UAAU,EAH7C,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAGU,GAF3C,MAAM,EAAE,CAoBpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/inventory/source.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/inventory/source.js"],"names":[],"mappings":"AAqCA,6FAA6F;AAC7F,eAAO,MAAM,4BAA4B,wIAC8F,CAAC;AAExI,6DAA6D;AAC7D,eAAO,MAAM,2BAA2B,UAWvC,CAAC;AAuBF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAH7B,MAAM,GAAC,SAGsB,GAF3B,OAAO,CAUnB;AAiBD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAL5B,MAAM,EAKsB,EAAE,OAAO,GAH7C;IAAkC,GAAG,EAA7B,MAAM,GAAC,SAAS,CACxB;CAEkD,GAFxC,MAAM,CAuClB;AA+ED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAJtC,MAAM,GAAC,SAI+B,EAAE,OAAO,GAH/C,MAGoD,GAFlD,MAAM,GAAC,SAAS,CA6I5B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAFtB,MAAM,CASlB;AAkBD;;;;;GAKG;AACH,wBAAgB,a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AAyB,SAExC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,qBAAqB,CAAC,WAAW,EAJ5C,KAAK,CAAC,MAAM,CAIgC,GAF1C,OAAO,CAAC,IAAI,CAAC,CA6BzB;AAmDD;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,EAJ3C,MAI2C,EAAE,OAAO,AAH5D,CACA,EADQ,MAGyD,GAFvD,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAAC,CA4MlI;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAF5B,MAE4B,QAkCtC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the @cdxgen/safer-exec tracing runtime could be loaded. When false,
|
|
3
|
+
* dynamic tracing cannot run at all, and every trace would otherwise exit 0
|
|
4
|
+
* with a valid but empty BOM, hiding the broken installation (#4378).
|
|
5
|
+
*
|
|
6
|
+
* @returns {boolean} True when the tracing runtime is available
|
|
7
|
+
*/
|
|
8
|
+
export declare function isSaferExecAvailable(): boolean;
|
|
1
9
|
/**
|
|
2
10
|
* Parses a command string into command and arguments array.
|
|
3
11
|
* @param {string} cmdStr - Command string to parse
|
|
@@ -40,7 +48,19 @@ export declare function resolveSaferExecBinary(): string | undefined;
|
|
|
40
48
|
* @param {boolean} [options.traceExec] - Log every child process spawned
|
|
41
49
|
* @param {string[]} [options.allowExec] - Executables the command is allowed to run
|
|
42
50
|
* @param {string[]} [options.blockExec] - Executables to block from running
|
|
43
|
-
* @
|
|
51
|
+
* @param {boolean} [options.proxyEgress] - Route egress through safer-exec's hostname-pinning proxy (network stays enabled; only allowHosts are reachable)
|
|
52
|
+
* @param {boolean} [options.allowLoopback] - Allow loopback connections
|
|
53
|
+
* @param {boolean} [options.dryRun] - Deny every filesystem and network side effect and collect a dry-run report
|
|
54
|
+
* @param {string} [options.policy] - Named safer-exec ecosystem policy (npm, pypi, maven, ...)
|
|
55
|
+
* @param {string} [options.policyFile] - Path to a safer-exec JSON policy file
|
|
56
|
+
* @param {boolean} [options.blockInterpreters] - Block interpreters with sandbox or task-port exemptions (macOS)
|
|
57
|
+
* @param {boolean} [options.denyPersistenceWrites] - Deny writes to auto-execution and persistence locations
|
|
58
|
+
* @param {boolean} [options.privateTmp] - Private tmpfs /tmp and /var/tmp (Linux)
|
|
59
|
+
* @param {string} [options.protectHome] - Home isolation: read-only, tmpfs, or off (Linux)
|
|
60
|
+
* @returns {Promise<{libPaths: string[], httpAccessEntries: Object[], egressEntries?: Object[], dryRunSummary?: Object}>} Collected libraries, HTTP URLs, proxy egress decisions, and the dry-run summary
|
|
61
|
+
* @throws {Error} When the @cdxgen/safer-exec tracing runtime is not installed
|
|
62
|
+
* (for example after pruning it from a standalone payload), since the traced
|
|
63
|
+
* command could never run and the BOM would silently be empty
|
|
44
64
|
*/
|
|
45
65
|
export declare function executeAndTrace(commandStr: string, workingDir?: string, options?: {
|
|
46
66
|
readPaths?: string[];
|
|
@@ -62,10 +82,36 @@ export declare function executeAndTrace(commandStr: string, workingDir?: string,
|
|
|
62
82
|
traceExec?: boolean;
|
|
63
83
|
allowExec?: string[];
|
|
64
84
|
blockExec?: string[];
|
|
85
|
+
proxyEgress?: boolean;
|
|
86
|
+
allowLoopback?: boolean;
|
|
87
|
+
dryRun?: boolean;
|
|
88
|
+
policy?: string;
|
|
89
|
+
policyFile?: string;
|
|
90
|
+
blockInterpreters?: boolean;
|
|
91
|
+
denyPersistenceWrites?: boolean;
|
|
92
|
+
privateTmp?: boolean;
|
|
93
|
+
protectHome?: string;
|
|
65
94
|
}): Promise<{
|
|
66
95
|
libPaths: string[];
|
|
67
96
|
httpAccessEntries: Object[];
|
|
97
|
+
egressEntries?: Object[];
|
|
98
|
+
dryRunSummary?: Object;
|
|
68
99
|
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Extracts the egress proxy's decisions from a safer-exec audit log.
|
|
102
|
+
* "proxy-connect" targets are "host:port"; "proxy-violation" targets are
|
|
103
|
+
* "CONNECT host:port" or "METHOD http://host[:port]/path". Only the authority
|
|
104
|
+
* is kept, never a path or query.
|
|
105
|
+
*
|
|
106
|
+
* @param {Object[]} auditLog - safer-exec audit entries
|
|
107
|
+
* @returns {{host: string, port: number, protocol: string, decision: string}[]} Unique egress decisions
|
|
108
|
+
*/
|
|
109
|
+
export declare function parseEgressEntries(auditLog: Object[]): {
|
|
110
|
+
host: string;
|
|
111
|
+
port: number;
|
|
112
|
+
protocol: string;
|
|
113
|
+
decision: string;
|
|
114
|
+
}[];
|
|
69
115
|
/**
|
|
70
116
|
* Groups HTTP access entries into a CycloneDX services-ready map.
|
|
71
117
|
* Each unique (host, port, protocol) combination becomes a service.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceRunner.d.ts","sourceRoot":"","sources":["../../../lib/inventory/traceRunner.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"traceRunner.d.ts","sourceRoot":"","sources":["../../../lib/inventory/traceRunner.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAFvB,OAAO,CAInB;AAKD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAHxB,MAGwB,GAFtB;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAC,CA6BzC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAFzB,MAAM,GAAC,SAAS,CAsE5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAsB,eAAe,CAAC,UAAU,EApCrC,MAoCqC,EAAE,UAAU,AAnCzD,CACA,EADQ,MA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