@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
|
@@ -61,6 +61,39 @@ export declare function simplifyRubyVersion(version: string): string;
|
|
|
61
61
|
* @returns {string} purl string
|
|
62
62
|
*/
|
|
63
63
|
export declare function toGemPurl(name: string, version: string | undefined, platform: string | undefined): string;
|
|
64
|
+
/**
|
|
65
|
+
* Read the Ruby string literal at the start of `text`: a double or single
|
|
66
|
+
* quoted string, or a `%q`/`%Q`/`%` percent literal. Escaped delimiters and
|
|
67
|
+
* backslashes are unescaped; every other escape sequence is kept as written.
|
|
68
|
+
* An interpolation such as `#{spec.name}` is kept verbatim, including any
|
|
69
|
+
* quotes inside it.
|
|
70
|
+
*
|
|
71
|
+
* @param {string} text Source starting with the literal
|
|
72
|
+
* @returns {{value: string, interpolated: boolean, complete: boolean, rest: string} | undefined}
|
|
73
|
+
* The literal's value, whether it holds an interpolation, whether it was
|
|
74
|
+
* closed within `text`, and the source after it. Undefined when `text` does
|
|
75
|
+
* not start with a string literal.
|
|
76
|
+
*/
|
|
77
|
+
export declare function readRubyStringLiteral(text: string): {
|
|
78
|
+
value: string;
|
|
79
|
+
interpolated: boolean;
|
|
80
|
+
complete: boolean;
|
|
81
|
+
rest: string;
|
|
82
|
+
} | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Read a Ruby list of strings as written for `authors`, `email`, or `licenses`:
|
|
85
|
+
* an array of string literals, a `%w[]` word array, or a single string. Array
|
|
86
|
+
* elements that are not string literals, such as constants, are skipped.
|
|
87
|
+
*
|
|
88
|
+
* @param {string} text Source of the value
|
|
89
|
+
* @returns {{values: string[], complete: boolean} | undefined} The strings,
|
|
90
|
+
* and whether the array was closed within `text`. Undefined when the value
|
|
91
|
+
* is an expression that cannot be read statically.
|
|
92
|
+
*/
|
|
93
|
+
export declare function readRubyStringList(text: string): {
|
|
94
|
+
values: string[];
|
|
95
|
+
complete: boolean;
|
|
96
|
+
} | undefined;
|
|
64
97
|
/**
|
|
65
98
|
* Parse a single line from the `CHECKSUMS` section of a Gemfile.lock. Bundler
|
|
66
99
|
* 2.5 onwards writes `name (version[-platform]) algo=digest[,algo=digest]`,
|
|
@@ -159,15 +192,35 @@ export declare function toGemModuleNames(name: any): string[];
|
|
|
159
192
|
*/
|
|
160
193
|
export declare function collectGemModuleNames(rubyCommand: string, bundleCommand: string, gemHome: string, gemName: string, filePath: string): Array<string>;
|
|
161
194
|
/**
|
|
162
|
-
* Method to parse Gemspec file contents
|
|
195
|
+
* Method to parse Gemspec file contents.
|
|
196
|
+
*
|
|
197
|
+
* A source gemspec is Ruby code. The values that can be read without running
|
|
198
|
+
* it are string literals, lists of them, heredocs, and a version constant
|
|
199
|
+
* defined in the version file the gemspec requires. Anything else is left
|
|
200
|
+
* unresolved instead of being guessed.
|
|
201
|
+
*
|
|
202
|
+
* Bundler evaluates the gemspec of a project that uses the Gemfile `gemspec`
|
|
203
|
+
* directive, and locks the gem under `PATH remote: .`. Such a locked version
|
|
204
|
+
* can be supplied through `options.lockedVersions` and is used when the
|
|
205
|
+
* gemspec computes its version in a way that cannot be read statically.
|
|
163
206
|
*
|
|
164
207
|
* @param {string} gemspecData Gemspec data
|
|
165
208
|
* @param {string} gemspecFile File name for evidence.
|
|
209
|
+
* @param {Object} [options] Parse options
|
|
210
|
+
* @param {Object<string, string>} [options.lockedVersions] Locked versions of
|
|
211
|
+
* the gems the project directory serves, by gem name
|
|
166
212
|
*/
|
|
167
|
-
export declare function parseGemspecData(gemspecData: string, gemspecFile: string
|
|
213
|
+
export declare function parseGemspecData(gemspecData: string, gemspecFile: string, options?: {
|
|
214
|
+
lockedVersions?: Record<string, string>;
|
|
215
|
+
}): Promise<any[]>;
|
|
168
216
|
/**
|
|
169
217
|
* Method to parse Gemfile.lock
|
|
170
218
|
*
|
|
219
|
+
* Besides the components and the dependency tree, the result lists as
|
|
220
|
+
* `projectGemRefs` the bom-refs of the gems served from the lockfile's own
|
|
221
|
+
* directory (`PATH` with `remote: .`), which is how Bundler records the gem a
|
|
222
|
+
* project builds when its Gemfile uses the `gemspec` directive.
|
|
223
|
+
*
|
|
171
224
|
* @param {object} gemLockData Gemfile.lock data
|
|
172
225
|
* @param {string} lockFile Lock file
|
|
173
226
|
*/
|
|
@@ -178,5 +231,93 @@ export declare function parseGemfileLockData(gemLockData: object, lockFile: stri
|
|
|
178
231
|
dependsOn: any[];
|
|
179
232
|
}[];
|
|
180
233
|
rootList: any[];
|
|
234
|
+
projectGemRefs: any[];
|
|
181
235
|
}>;
|
|
236
|
+
/**
|
|
237
|
+
* Describe the gem a project builds in its parent component.
|
|
238
|
+
*
|
|
239
|
+
* A gem project sees its own gem more than once: in its gemspec, in the `PATH`
|
|
240
|
+
* entry the Gemfile `gemspec` directive adds to its lockfile, and possibly as
|
|
241
|
+
* an installed copy. Each of them describes the project itself, so all are
|
|
242
|
+
* folded into the parent (discussion 4388). The parent takes the gem's
|
|
243
|
+
* identity, its descriptive metadata, and its `cdx:gem:*` properties; the
|
|
244
|
+
* dependency edges of the sightings move to the parent; and the sightings
|
|
245
|
+
* leave the component list, so the gem is never a dependency of itself.
|
|
246
|
+
*
|
|
247
|
+
* An explicit `--project-version` names the version of the parent. Otherwise
|
|
248
|
+
* the version of the gemspec, which may have come from the lockfile, is used.
|
|
249
|
+
*
|
|
250
|
+
* @param {object} parentComponent Parent component, updated in place
|
|
251
|
+
* @param {object} projectGem Component parsed from the root gemspec
|
|
252
|
+
* @param {object[]} pkgList Components
|
|
253
|
+
* @param {object[]} dependencies Dependency edges
|
|
254
|
+
* @param {string[]} rootList bom-refs of the direct dependencies
|
|
255
|
+
* @param {string[]} projectGemRefs bom-refs of the gems the lockfiles serve from the project directory
|
|
256
|
+
* @param {object} options CLI options
|
|
257
|
+
* @returns {{pkgList: object[], dependencies: object[], rootList: string[]}}
|
|
258
|
+
* The components, edges, and direct dependencies with the gem folded in
|
|
259
|
+
*/
|
|
260
|
+
export declare function describeProjectGem(parentComponent: object, projectGem: object, pkgList: object[], dependencies: object[], rootList: string[], projectGemRefs: string[], options?: object): {
|
|
261
|
+
pkgList: object[];
|
|
262
|
+
dependencies: object[];
|
|
263
|
+
rootList: string[];
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* Point each gem resolved from the public RubyGems registry at its `.gem`
|
|
267
|
+
* tarball with a `distribution` external reference (discussion 4406).
|
|
268
|
+
*
|
|
269
|
+
* The registry API supplies `gem_uri` when it is reachable, but an offline
|
|
270
|
+
* scan — a dry run, an air-gapped host, or one that only consulted Bundler's
|
|
271
|
+
* local caches — has no way to learn it. For the public registry the URL is
|
|
272
|
+
* deterministic, so it is derived from the recorded `cdx:gem:remote` and the
|
|
273
|
+
* release identity instead. Gems from any other remote are left alone: a
|
|
274
|
+
* private mirror's layout is its own business.
|
|
275
|
+
*
|
|
276
|
+
* @param {Array} pkgList Gem components, enriched in place
|
|
277
|
+
* @returns {Array} The package list
|
|
278
|
+
*/
|
|
279
|
+
export declare function addRubyGemsDistributionUrls(pkgList: any[]): any[];
|
|
280
|
+
/**
|
|
281
|
+
* Intersect Gem::Requirement strings into one `vers` range with the RubyGems
|
|
282
|
+
* versioning scheme, as the CycloneDX `versionRange` requires. `>= 2.3` and
|
|
283
|
+
* `>= 3.3` intersect to `vers:gem/>=3.3`, and `~> 3.1` becomes
|
|
284
|
+
* `vers:gem/>=3.1|<4`, since vers has no pessimistic operator.
|
|
285
|
+
*
|
|
286
|
+
* @param {string[]} requirements Requirement strings, each possibly holding
|
|
287
|
+
* several comma separated constraints
|
|
288
|
+
* @returns {string|null|undefined} The range, `null` when the requirements
|
|
289
|
+
* exclude each other, or undefined when none of them could be read
|
|
290
|
+
*/
|
|
291
|
+
export declare function rubyRequirementToVers(requirements: string[]): string | null | undefined;
|
|
292
|
+
/**
|
|
293
|
+
* Describe the Ruby runtime the gems require as one external `platform`
|
|
294
|
+
* component, and make the components that declare a `required_ruby_version`
|
|
295
|
+
* depend on it (discussion 4409).
|
|
296
|
+
*
|
|
297
|
+
* The component stands for the Ruby the bundle as a whole runs on, so its
|
|
298
|
+
* `versionRange` is the intersection of every requirement that could be read,
|
|
299
|
+
* in the `vers` syntax CycloneDX mandates for the field. Each component's own
|
|
300
|
+
* requirement stays in its `cdx:gem:rubyVersionSpecifiers` property. One
|
|
301
|
+
* runtime component per distinct requirement would describe the same
|
|
302
|
+
* interpreter many times over: a modest bundle spells `>= 2.x` a dozen ways.
|
|
303
|
+
*
|
|
304
|
+
* The type is `platform`, the CycloneDX type for a runtime environment that
|
|
305
|
+
* interprets software, and the one cdxgen gives the Ruby it finds in the
|
|
306
|
+
* build environment. The purl names no version, since a range is not one.
|
|
307
|
+
*
|
|
308
|
+
* `isExternal` and `versionRange` are CycloneDX 1.7 fields, and without them
|
|
309
|
+
* the component would claim the product bundles its interpreter, so the caller
|
|
310
|
+
* decides whether the BOM should carry it at all.
|
|
311
|
+
*
|
|
312
|
+
* @param {Array} pkgList Components
|
|
313
|
+
* @param {object} parentComponent The metadata.component, when the project is
|
|
314
|
+
* itself a gem
|
|
315
|
+
* @param {Array} dependencies Dependency edges
|
|
316
|
+
* @returns {{pkgList: Array, dependencies: Array}} Components and edges with
|
|
317
|
+
* the runtime component added
|
|
318
|
+
*/
|
|
319
|
+
export declare function addRubyRuntimeComponent(pkgList: any[], parentComponent: object, dependencies: any[]): {
|
|
320
|
+
pkgList: any[];
|
|
321
|
+
dependencies: any[];
|
|
322
|
+
};
|
|
182
323
|
//# sourceMappingURL=rubyutils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rubyutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rubyutils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rubyutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rubyutils.js"],"names":[],"mappings":"AAsEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAHzB,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XE,MAWG,GAVD;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAC,CAkH3E;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,OAAA,SAmClD;AA8GD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EALvC,MAAM,EAKiC,GAHrC,MAAM,GAAC,IAAI,GAAC,SAAS,CAoHjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,OAAA,EACP,eAAe,EARN,MAQM,EACf,YAAY,OAAA,GAND;IAAC,OAAO,QAAQ;IAAC,YAAY,QAAO;CAAC,CAmEjD"}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the backend rusi actually used. `options.backend` is only the
|
|
3
|
+
* requested backend: when the compiler backend cannot run (missing
|
|
4
|
+
* components, wrapper build failure), rusi still echoes "compiler" but falls
|
|
5
|
+
* back to the stable source analysis. Compiler evidence was collected only
|
|
6
|
+
* when rusi emits its compiler-source-evidence diagnostic; a backend-error
|
|
7
|
+
* alone is not conclusive because native interop scanning reports failures
|
|
8
|
+
* under that kind too.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} rusiReport Parsed rusi report
|
|
11
|
+
* @returns {string|undefined} Effective backend name
|
|
12
|
+
*/
|
|
13
|
+
export declare function effectiveRusiBackend(rusiReport?: Object): string | undefined;
|
|
1
14
|
/**
|
|
2
15
|
* Checks if the provided language is a Rust language alias.
|
|
3
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rusi.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rusi.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rusi.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rusi.js"],"names":[],"mappings":"AAgWA;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,GAHpC,MAGyC,GAFvC,MAAM,GAAC,SAAS,CAW5B;AAsZD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAHhC,MAGgC,GAF9B,OAAO,CAInB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAH9B,MAG8B,GAF5B,MAAM,GAAC,SAAS,CAW5B;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EALxB,MAKwB,EAAE,UAAU,EAJpC,MAIoC,EAAE,OAAO,GAH7C,MAGkD,GAFhD,OAAO,CAuDnB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAJ3B,MAI2B,EAAE,OAAO,GAHpC,MAGyC,GAFvC,MAAM,GAAC,SAAS,CA2B5B;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAJnC,MAIwC,EAAE,UAAU,QAAK,GAFvD,MAAM,CA8DlB"}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges one analyzer run's metadata properties into the BOM's metadata
|
|
3
|
+
* component. Analyzer metadata describes a single run, so when the input BOM
|
|
4
|
+
* already carries facts from an earlier run (cdxgen --profile research, then
|
|
5
|
+
* evinse), everything under the analyzer's own `cdx:<analyzer>:` prefix is
|
|
6
|
+
* replaced. Replacing by exact name would keep facts the new run no longer
|
|
7
|
+
* emits, such as a cdx:rusi:requestedBackend left from a fallback run.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} component Metadata component to update in place
|
|
10
|
+
* @param {Object[]} metadataProperties Properties from the analyzer run
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergeAnalyzerMetadataProperties(component: Object, metadataProperties?: Object[]): void;
|
|
13
|
+
/**
|
|
14
|
+
* Build the options for the evinse phase (prepareDB, analyzeProject, and
|
|
15
|
+
* createEvinseFile) from the cdxgen CLI options.
|
|
16
|
+
*
|
|
17
|
+
* This object used to be assembled inline in bin/cdxgen.js, which dropped
|
|
18
|
+
* fields the analyzers read - most notably `exclude`, so every dosai and atom
|
|
19
|
+
* run triggered by `--evidence` ignored the user's `--exclude` patterns. Keep
|
|
20
|
+
* the wiring in one place so the forwarded fields stay testable.
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} options CLI options
|
|
23
|
+
* @param {Object} args Parsed CLI arguments; `args._[0]` is the source directory
|
|
24
|
+
* @param {string} input Path of the BOM file the evinse phase enriches
|
|
25
|
+
* @returns {Object} Options for prepareDB, analyzeProject, and createEvinseFile
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildEvinseOptions(options: Object, args: Object, input: string): Object;
|
|
1
28
|
/**
|
|
2
29
|
* Function to create the db for the libraries referred in the sbom.
|
|
3
30
|
*
|
|
@@ -91,8 +118,9 @@ export declare function purlToLanguage(purl: string, filePath?: string): string
|
|
|
91
118
|
* Seed purl-location and import maps from SBOM component evidence.
|
|
92
119
|
*
|
|
93
120
|
* Walks the supplied components reading `internal:ImportedModules` (or
|
|
94
|
-
* `internal:Namespaces` for php/ruby
|
|
95
|
-
*
|
|
121
|
+
* `internal:Namespaces` for php/ruby, plus the `internal:ImportedSymbols` the
|
|
122
|
+
* C/C++ collector records) and `evidence.occurrences` properties to construct
|
|
123
|
+
* lookup maps used during slice analysis.
|
|
96
124
|
*
|
|
97
125
|
* @param {Object[]} components CycloneDX components from the input SBOM
|
|
98
126
|
* @param {string} language Application language used to select the import property name
|
|
@@ -102,6 +130,26 @@ export declare function initFromSbom(components: Object[], language: string): {
|
|
|
102
130
|
purlLocationMap: Record<string, Set<any>>;
|
|
103
131
|
purlImportsMap: Record<string, string[]>;
|
|
104
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Load a semantics slices file for reuse when it belongs to this project.
|
|
135
|
+
*
|
|
136
|
+
* `--semantics-slices-file` defaults to `semantics.slices.json` in the working
|
|
137
|
+
* directory, which is shared by every project scanned from there and also
|
|
138
|
+
* receives the reports of other analyzers (dosai, rusi, golem). A file is
|
|
139
|
+
* only reused when its shape matches the language. Swift slices must also
|
|
140
|
+
* describe the same project directory and must not predate the input SBOM:
|
|
141
|
+
* `cdxgen --evidence` writes a fresh SBOM before evinse runs, so an older
|
|
142
|
+
* slice was made from an earlier state of the sources and is regenerated.
|
|
143
|
+
* Scala slices cannot be regenerated by evinse and are reused whenever their
|
|
144
|
+
* shape matches.
|
|
145
|
+
*
|
|
146
|
+
* @param {string} language Project language
|
|
147
|
+
* @param {string} slicesFile Candidate semantics slices file
|
|
148
|
+
* @param {string} bomFile Input SBOM
|
|
149
|
+
* @param {string} dirPath Project directory
|
|
150
|
+
* @returns {undefined|Object} Parsed slice when it can be reused
|
|
151
|
+
*/
|
|
152
|
+
export declare function loadReusableSemanticsSlice(language: string, slicesFile: string, bomFile: string, dirPath: string): undefined | Object;
|
|
105
153
|
/**
|
|
106
154
|
* Function to analyze the project
|
|
107
155
|
*
|
|
@@ -155,13 +203,7 @@ export declare function analyzeProject(dbObjMap: Object, options: Object): Promi
|
|
|
155
203
|
cryptoGeneratePurls: {};
|
|
156
204
|
servicesMap: {};
|
|
157
205
|
userDefinedTypesMap: {};
|
|
158
|
-
workspaceComponent:
|
|
159
|
-
type: string;
|
|
160
|
-
name: any;
|
|
161
|
-
version: any;
|
|
162
|
-
purl: any;
|
|
163
|
-
"bom-ref": any;
|
|
164
|
-
} | undefined;
|
|
206
|
+
workspaceComponent: Object | undefined;
|
|
165
207
|
atomFile?: undefined;
|
|
166
208
|
usagesSlicesFile?: undefined;
|
|
167
209
|
dataFlowSlicesFile?: undefined;
|
|
@@ -244,6 +286,14 @@ export declare function parseSliceUsages(language: string, userDefinedTypesMap:
|
|
|
244
286
|
/**
|
|
245
287
|
* Method to parse semantic slice data. Currently supported for swift and scala languages.
|
|
246
288
|
*
|
|
289
|
+
* Swift slices created by cdxgen record, for every indexed source file, the
|
|
290
|
+
* lines that reference each dependency module (`moduleReferences`); the module
|
|
291
|
+
* of a reference is the declaring module recovered from the compiler-resolved
|
|
292
|
+
* USR. Components are mapped to their package's modules through the
|
|
293
|
+
* `packages` slice, so every occurrence is backed by a resolved reference.
|
|
294
|
+
* Slices without `moduleReferences` (created by older cdxgen versions) fall
|
|
295
|
+
* back to matching symbol names.
|
|
296
|
+
*
|
|
247
297
|
* @param {String} language Project language.
|
|
248
298
|
* @param {Array} components Components from the input SBOM
|
|
249
299
|
* @param {Object} semanticsSlice Semantic slice data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evinser.d.ts","sourceRoot":"","sources":["../../../lib/evinser/evinser.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evinser.d.ts","sourceRoot":"","sources":["../../../lib/evinser/evinser.js"],"names":[],"mappings":"AA0GA;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAJA,MAIA,EACT,kBAAkB,GAJT,MAAM,EAIQ,QAkBxB;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAL/B,MAK+B,EAAE,IAAI,EAJrC,MAIqC,EAAE,KAAK,EAH5C,MAG4C,GAF1C,MAAM,CA+BlB;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAF5B,MAE4B;;;;;;;eAuDtC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAPE,MAOF,EACP,SAAS,wBAAA,EACT,UAAU,EAPD,MAOC,EACV,OAAO,GAPE,MAOG,GAND,OAAO,CAAC,IAAI,CAAC,CAmDzB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EALpC,MAKoC,EAAE,SAAS,wBAAA,EAAE,UAAU,EAH3D,MAG2D,GAFzD,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EA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