@cdxgen/cdxgen 13.0.0 → 13.1.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 +26 -13
- package/bin/audit.js +6 -0
- package/bin/cdxgen.js +140 -8
- package/bin/convert.js +7 -0
- package/bin/evinse.js +1 -1
- package/bin/hbom.js +13 -4
- package/bin/tracebom.js +9 -1
- package/data/component-tags.json +8 -1
- package/data/frameworks-list.json +86 -1
- package/data/remediations.json +1144 -0
- package/data/rules/asar-archives.yaml +1 -1
- package/data/rules/build-fidelity.yaml +782 -0
- package/data/rules/package-integrity.yaml +13 -13
- package/lib/audit/index.js +48 -4
- package/lib/audit/scoring.js +2 -8
- package/lib/cli/bomAssembly.js +83 -15
- package/lib/cli/cliOptions.js +124 -7
- package/lib/cli/index.js +76 -48
- package/lib/cli/jsBom.js +32 -3
- package/lib/cli/jvmBom.js +1494 -1315
- package/lib/cli/managedBom.js +97 -28
- package/lib/cli/nativeBom.js +189 -10
- package/lib/core/buildLedger.js +799 -0
- package/lib/core/deferredExit.js +141 -0
- package/lib/core/env.js +69 -1
- package/lib/core/fs.js +60 -0
- package/lib/core/logger.js +76 -25
- package/lib/core/severity.js +16 -0
- package/lib/core/syncFileWriter.js +106 -0
- package/lib/core/ui.js +46 -2
- package/lib/ecosystems/ecosystems.js +9 -0
- package/lib/ecosystems/gradleutils.js +355 -15
- package/lib/ecosystems/parsers-js.js +26 -0
- package/lib/ecosystems/parsers-jvm.js +9 -0
- package/lib/ecosystems/parsers-misc.js +16 -2
- package/lib/ecosystems/parsers-python.js +171 -35
- package/lib/ecosystems/parsers-rust.js +12 -2
- package/lib/ecosystems/pypiClassifiers.js +326 -0
- package/lib/ecosystems/pythonutils.js +49 -1
- package/lib/ecosystems/rubyutils.js +13 -0
- package/lib/ecosystems/utils.js +9 -1
- package/lib/evinser/evinser.js +30 -12
- package/lib/helpers/remote/dependency-track.js +81 -14
- package/lib/inventory/auditCategories.js +9 -0
- package/lib/inventory/depsUtils.js +72 -0
- package/lib/inventory/dosai.js +431 -22
- package/lib/inventory/envcontext.js +211 -19
- package/lib/inventory/fetchBatch.js +57 -0
- package/lib/inventory/jvmToolEnv.js +593 -0
- package/lib/inventory/osinfo.js +123 -16
- package/lib/inventory/table.js +9 -5
- package/lib/inventory/toolRequirements.js +903 -0
- package/lib/managers/binary.js +216 -40
- package/lib/managers/docker.js +26 -5
- package/lib/server/server.js +1 -1
- package/lib/stages/postgen/annotationBuilder.js +97 -0
- package/lib/stages/postgen/auditBom.js +76 -79
- package/lib/stages/postgen/introspection/annotate.js +320 -0
- package/lib/stages/postgen/introspection/commandFacts.js +293 -0
- package/lib/stages/postgen/introspection/emit.js +192 -0
- package/lib/stages/postgen/introspection/formulationEvidence.js +427 -0
- package/lib/stages/postgen/introspection/markers.js +227 -0
- package/lib/stages/postgen/introspection/reflect.js +1214 -0
- package/lib/stages/postgen/introspection/report.js +1208 -0
- package/lib/stages/postgen/introspection/score.js +1067 -0
- package/lib/stages/postgen/introspection/shapeCommand.js +304 -0
- package/lib/stages/postgen/parentEdge.js +156 -0
- package/lib/stages/postgen/postgen.js +115 -2
- package/lib/stages/postgen/ruleEngine.js +17 -0
- package/lib/stages/pregen/envAudit.js +42 -2
- package/lib/stages/pregen/pregen.js +1171 -6
- package/lib/validator/bomValidator.js +11 -2
- package/package.json +14 -14
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/audit/scoring.d.ts +2 -8
- package/types/lib/audit/scoring.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +14 -0
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +2 -1
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts +8 -0
- 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/buildLedger.d.ts +272 -0
- package/types/lib/core/buildLedger.d.ts.map +1 -0
- package/types/lib/core/deferredExit.d.ts +84 -0
- package/types/lib/core/deferredExit.d.ts.map +1 -0
- package/types/lib/core/env.d.ts +22 -1
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +21 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/logger.d.ts +14 -1
- package/types/lib/core/logger.d.ts.map +1 -1
- package/types/lib/core/severity.d.ts +11 -0
- package/types/lib/core/severity.d.ts.map +1 -0
- package/types/lib/core/syncFileWriter.d.ts +33 -0
- package/types/lib/core/syncFileWriter.d.ts.map +1 -0
- package/types/lib/core/ui.d.ts +1 -1
- package/types/lib/core/ui.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +33 -0
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
- 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/pypiClassifiers.d.ts +80 -0
- package/types/lib/ecosystems/pypiClassifiers.d.ts.map +1 -0
- package/types/lib/ecosystems/pythonutils.d.ts +20 -0
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/utils.d.ts +4 -4
- package/types/lib/ecosystems/utils.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +5 -1
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/helpers/remote/dependency-track.d.ts +45 -4
- package/types/lib/helpers/remote/dependency-track.d.ts.map +1 -1
- package/types/lib/inventory/auditCategories.d.ts +8 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -1
- package/types/lib/inventory/depsUtils.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +20 -0
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/fetchBatch.d.ts +9 -0
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +189 -0
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -0
- package/types/lib/inventory/osinfo.d.ts +83 -2
- package/types/lib/inventory/osinfo.d.ts.map +1 -1
- package/types/lib/inventory/table.d.ts +4 -1
- package/types/lib/inventory/table.d.ts.map +1 -1
- package/types/lib/inventory/toolRequirements.d.ts +216 -0
- package/types/lib/inventory/toolRequirements.d.ts.map +1 -0
- package/types/lib/managers/binary.d.ts +71 -0
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/stages/postgen/annotationBuilder.d.ts +53 -0
- package/types/lib/stages/postgen/annotationBuilder.d.ts.map +1 -0
- package/types/lib/stages/postgen/auditBom.d.ts.map +1 -1
- package/types/lib/stages/postgen/introspection/annotate.d.ts +81 -0
- package/types/lib/stages/postgen/introspection/annotate.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/commandFacts.d.ts +32 -0
- package/types/lib/stages/postgen/introspection/commandFacts.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/emit.d.ts +71 -0
- package/types/lib/stages/postgen/introspection/emit.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/formulationEvidence.d.ts +154 -0
- package/types/lib/stages/postgen/introspection/formulationEvidence.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/markers.d.ts +57 -0
- package/types/lib/stages/postgen/introspection/markers.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/reflect.d.ts +77 -0
- package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/report.d.ts +85 -0
- package/types/lib/stages/postgen/introspection/report.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/score.d.ts +149 -0
- package/types/lib/stages/postgen/introspection/score.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/shapeCommand.d.ts +79 -0
- package/types/lib/stages/postgen/introspection/shapeCommand.d.ts.map +1 -0
- package/types/lib/stages/postgen/parentEdge.d.ts +35 -0
- package/types/lib/stages/postgen/parentEdge.d.ts.map +1 -0
- package/types/lib/stages/postgen/postgen.d.ts +2 -2
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +131 -0
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
|
@@ -694,9 +694,18 @@ export const validatePurls = (bomJson) => {
|
|
|
694
694
|
errorList.push(`Invalid purl ${purl} at ${where}`);
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
|
|
697
|
+
// A flat cap of 20 was a proxy for "the framework heuristic has over-fired", but it
|
|
698
|
+
// scales with the size of the dependency tree rather than with any defect: a modern
|
|
699
|
+
// Python or JavaScript application legitimately depends on dozens of components that
|
|
700
|
+
// `data/frameworks-list.json` and the PyPI `Framework ::` classifiers correctly
|
|
701
|
+
// identify as frameworks. Comparing against a share of the tree keeps the check
|
|
702
|
+
// meaningful for small BOMs, where a high framework count really is suspicious, and
|
|
703
|
+
// stops it firing on large ones purely for being large.
|
|
704
|
+
const componentsCount = bomJson?.components?.length || 0;
|
|
705
|
+
const frameworksLimit = Math.max(20, Math.ceil(componentsCount * 0.25));
|
|
706
|
+
if (frameworksCount > frameworksLimit) {
|
|
698
707
|
warningsList.push(
|
|
699
|
-
`BOM
|
|
708
|
+
`BOM likely has too many framework components. Count: ${frameworksCount} of ${componentsCount} components.`,
|
|
700
709
|
);
|
|
701
710
|
}
|
|
702
711
|
if (DEBUG_MODE && warningsList.length !== 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdxgen/cdxgen",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.0",
|
|
4
4
|
"description": "Creates CycloneDX Software Bill of Materials (SBOM) from source or container image",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sbom",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"yargs": "18.1.0"
|
|
151
151
|
},
|
|
152
152
|
"devDependencies": {
|
|
153
|
-
"@biomejs/biome": "2.5.
|
|
153
|
+
"@biomejs/biome": "2.5.11",
|
|
154
154
|
"esmock": "2.7.6",
|
|
155
155
|
"poku": "4.5.0",
|
|
156
156
|
"sinon": "22.1.0",
|
|
@@ -162,17 +162,17 @@
|
|
|
162
162
|
"@bufbuild/protobuf": "2.13.0",
|
|
163
163
|
"@cdxgen/cdx-hbom": "0.5.1",
|
|
164
164
|
"@cdxgen/cdx-proto": "2.2.0",
|
|
165
|
-
"@cdxgen/cdxgen-plugins-bin": "3.0
|
|
166
|
-
"@cdxgen/cdxgen-plugins-bin-darwin-amd64": "3.0
|
|
167
|
-
"@cdxgen/cdxgen-plugins-bin-darwin-arm64": "3.0
|
|
168
|
-
"@cdxgen/cdxgen-plugins-bin-linux-amd64": "3.0
|
|
169
|
-
"@cdxgen/cdxgen-plugins-bin-linux-arm": "3.0
|
|
170
|
-
"@cdxgen/cdxgen-plugins-bin-linux-arm64": "3.0
|
|
171
|
-
"@cdxgen/cdxgen-plugins-bin-linux-ppc64": "3.0
|
|
172
|
-
"@cdxgen/cdxgen-plugins-bin-linuxmusl-amd64": "3.0
|
|
173
|
-
"@cdxgen/cdxgen-plugins-bin-linuxmusl-arm64": "3.0
|
|
174
|
-
"@cdxgen/cdxgen-plugins-bin-windows-amd64": "3.0
|
|
175
|
-
"@cdxgen/cdxgen-plugins-bin-windows-arm64": "3.0
|
|
165
|
+
"@cdxgen/cdxgen-plugins-bin": "3.1.0",
|
|
166
|
+
"@cdxgen/cdxgen-plugins-bin-darwin-amd64": "3.1.0",
|
|
167
|
+
"@cdxgen/cdxgen-plugins-bin-darwin-arm64": "3.1.0",
|
|
168
|
+
"@cdxgen/cdxgen-plugins-bin-linux-amd64": "3.1.0",
|
|
169
|
+
"@cdxgen/cdxgen-plugins-bin-linux-arm": "3.1.0",
|
|
170
|
+
"@cdxgen/cdxgen-plugins-bin-linux-arm64": "3.1.0",
|
|
171
|
+
"@cdxgen/cdxgen-plugins-bin-linux-ppc64": "3.1.0",
|
|
172
|
+
"@cdxgen/cdxgen-plugins-bin-linuxmusl-amd64": "3.1.0",
|
|
173
|
+
"@cdxgen/cdxgen-plugins-bin-linuxmusl-arm64": "3.1.0",
|
|
174
|
+
"@cdxgen/cdxgen-plugins-bin-windows-amd64": "3.1.0",
|
|
175
|
+
"@cdxgen/cdxgen-plugins-bin-windows-arm64": "3.1.0",
|
|
176
176
|
"@cdxgen/safer-exec": "0.15.0",
|
|
177
177
|
"body-parser": "2.3.0",
|
|
178
178
|
"compression": "1.8.1",
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
"name": "deno",
|
|
200
|
-
"version": "2.
|
|
200
|
+
"version": "2.9.6",
|
|
201
201
|
"onFail": "ignore"
|
|
202
202
|
}
|
|
203
203
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/audit/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/audit/index.js"],"names":[],"mappings":"AA6EA,yFAAyF;AACzF,eAAO,MAAM,wBAAwB,UAKpC,CAAC;AAuCF;;;;;GAKG;AACH,wBAAgB,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wQ3B;AAoVD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAH9B,MAAM,EAGwB,GAF5B,MAAM,EAAE,CAgDpB;AAoBD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,SAAS,EAJrC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAIE,EAAE,OAAO,EAH9C,MAG8C,GAF5C,OAAO,CAAC,MAAM,CAAC,CAiJ3B;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAH3B,MAG2B,GAFzB,OAAO,CAAC,MAAM,CAAC,CA0B3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EALnC,MAKmC,EAAE,SAAS,EAJ9C,MAAM,EAIwC,EAAE,MAAM,EAHtD,MAAM,GAAC,IAG+C,GAFpD,IAAI,CAwChB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAJ/B,MAI+B,EAAE,OAAO,EAHxC,MAGwC,GAFtC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAwChD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAH9B,MAG8B,GAF5B,MAAM,GAAG,SAAS,CAU9B"}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
none: number;
|
|
4
|
-
low: number;
|
|
5
|
-
medium: number;
|
|
6
|
-
high: number;
|
|
7
|
-
critical: number;
|
|
8
|
-
};
|
|
1
|
+
import { SEVERITY_ORDER } from "../core/severity.js";
|
|
2
|
+
export { SEVERITY_ORDER };
|
|
9
3
|
/**
|
|
10
4
|
* Convert a numeric confidence score into a human readable label.
|
|
11
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../lib/audit/scoring.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../lib/audit/scoring.js"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMrD,OAAO,EAAE,cAAc,EAAE,CAAC;AAwK1B;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAH/B,MAG+B,GAF7B,MAAM,CAUlB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAJpC,MAIoC,EAAE,SAAS,EAH/C,MAG+C,GAF7C,OAAO,CAMnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAL7B,MAAM,EAKuB,EAAE,MAAM,EAJrC,MAIqC,EAAE,OAAO,GAH9C,MAGmD,GAFjD,MAAM,CAoVlB"}
|
|
@@ -180,8 +180,22 @@ export declare function determinePackageType(pkg: any): any;
|
|
|
180
180
|
export declare function processHashes(pkg: any, component: any): void;
|
|
181
181
|
/**
|
|
182
182
|
* Adds a hash to component.
|
|
183
|
+
*
|
|
184
|
+
* Registries hand out digests in hex or in the base64 form npm uses for
|
|
185
|
+
* `integrity`, and both are accepted. A digest that is neither, or that decodes
|
|
186
|
+
* to the wrong length for its algorithm, is dropped rather than copied through:
|
|
187
|
+
* CycloneDX constrains `hash.content` to a hex digest, so emitting it anyway
|
|
188
|
+
* fails schema validation for the whole document over one bad package.
|
|
183
189
|
*/
|
|
184
190
|
export declare function addComponentHash(alg: any, digest: any, component: any): void;
|
|
191
|
+
/**
|
|
192
|
+
* Normalize a digest to the lower-case hex form CycloneDX requires.
|
|
193
|
+
*
|
|
194
|
+
* @param {string} alg Hash algorithm name
|
|
195
|
+
* @param {string} digest Digest in hex or base64
|
|
196
|
+
* @returns {string|undefined} Hex digest, or undefined when it cannot be trusted
|
|
197
|
+
*/
|
|
198
|
+
export declare function normalizeHashContent(alg: string, digest: string): string | undefined;
|
|
185
199
|
/**
|
|
186
200
|
* Return the BOM in json format including any namespace mapping
|
|
187
201
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bomAssembly.d.ts","sourceRoot":"","sources":["../../../lib/cli/bomAssembly.js"],"names":[],"mappings":"AA8DA;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,aAJ7B,MAAM,qBACN,MAAM,EAAE,KACN,OAsBZ,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAFf,MAG8E,CAAC;AAEzF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,0CAH9B,MAAM;;;;;CAwChB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,YAJ1B,MAAM,KACJ,MAAM,GAAC,SAyBnB,CAAC;
|
|
1
|
+
{"version":3,"file":"bomAssembly.d.ts","sourceRoot":"","sources":["../../../lib/cli/bomAssembly.js"],"names":[],"mappings":"AA8DA;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,aAJ7B,MAAM,qBACN,MAAM,EAAE,KACN,OAsBZ,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAFf,MAG8E,CAAC;AAEzF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,0CAH9B,MAAM;;;;;CAwChB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,YAJ1B,MAAM,KACJ,MAAM,GAAC,SAyBnB,CAAC;AAqFF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,YALjB,MAAM,YACN,MAAM,KACJ;IAAE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CA+CrD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,SAH3B,MAAM,KACJ,MAQZ,CAAC;AAEF;;;;;;;GAOG;AAGH,eAAO,MAAM,oBAAoB,SALtB,MAAM,KACJ,MAwBZ,CAA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GAAC,SAAS,CAS5B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,wBAAwB,EAHtD,MAAM,EAGgD,GAFpD,OAAO,CAInB;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EALvC,MAAM,EAKiC,EAAE,aAAa,EAJtD,MAIsD,EAAE,OAAO,EAH/D,GAAG,CAAC,MAAM,CAGqD,GAF7D,MAAM,EAAE,CAgBpB;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAH9C,MAAM,EAGwC,GAF5C,MAAM,EAAE,CAQpB;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EALvC,MAKuC,EAAE,KAAK,EAJ9C,MAI8C,EAAE,QAAQ,EAHxD,MAAM,EAGkD,GAFtD,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAJvC,MAIuC,EAAE,aAAa,EAHtD,MAGsD,GAFpD,IAAI,CAyDhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAPtB,MAOsB,EAAE,UAAU,OAAA,EAAE,eAAe,EALnD,MAKmD,EAAE,YAAY,OAAA,GAF/D,MAAM,CA8ClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,YAJjC,MAAM,mBACN,MAAM,KACJ,OAYZ,CAAC"}
|
|
@@ -50,7 +50,8 @@ export declare function isUserProvided(value: any, yaDefault: any): boolean;
|
|
|
50
50
|
* @returns {object} A shallow copy of args with alias-based defaults applied
|
|
51
51
|
*/
|
|
52
52
|
export declare function applyCommandNameDefaults(args: object, invokedCommandName: string): object;
|
|
53
|
-
export declare function buildInitialOptions(args: any, { filePath, isRemoteOrPurl }: {
|
|
53
|
+
export declare function buildInitialOptions(args: any, { filePath, isRemoteOrPurl, argv }: {
|
|
54
|
+
argv?: any;
|
|
54
55
|
filePath: any;
|
|
55
56
|
isRemoteOrPurl: any;
|
|
56
57
|
}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliOptions.d.ts","sourceRoot":"","sources":["../../../lib/cli/cliOptions.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"cliOptions.d.ts","sourceRoot":"","sources":["../../../lib/cli/cliOptions.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoBH;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAJpC,MAIoC,EAAE,WAAW,AAHzD,CACA,EADQ,MAG4D,GAF1D,MAAM,GAAC,IAAI,CAoBvB;AA4CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAJzB,GAIyB,EAAE,SAAS,EAHpC,GAGoC,GAFlC,OAAO,CAInB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAJlC,MAIkC,EAAE,kBAAkB,EAHtD,MAGsD,GAFpD,MAAM,CAoBlB;AAqED,wBAAgB,mBAAmB,CACjC,IAAI,KAAA,EACJ,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAmB,EAAE;;;;CAAA,OA8ClD;AAqBE,YAAkB,cAAc,GAChC;;;;IAAkC,KAAK,EAA5B,MAAM,GAAC,MAAM,GAAC,OAAO,CAChC;;;;IAAkC,OAAO,EAA9B,MAAM,CACnB;CAAA,CAAA;AAJD;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAR3C,MAQ2C,EAAE,OAAO,EAN5D;IAAwB,kBAAkB,EAAlC,MAAM,CACd;IAAyB,kBAAkB,EAAnC,OAAO,CAEf;IAA0B,QAAQ,AAAlC,CACA,EADQ,OAAO,CACf;CAE4D,GAFlD,cAAc,EAAE,CA6G5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EALjC,MAKiC,EAAE,OAAO,AAJlD,CAEA,EADA;IAA0B,YAAY,AAAtC,CACA,EADQ,OAAO,CACf;CAEuD,GAF7C,cAAc,EAAE,CAqI5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAX9B,MAW8B,EAAE,OAAO,EAT/C;IAAwB,kBAAkB,EAAlC,MAAM,CACd;IAAwB,QAAQ,EAAxB,MAAM,CACd;IAAyB,cAAc,EAA/B,OAAO,CACf;IAAyB,kBAAkB,EAAnC,OAAO,CAEf;IAA0B,QAAQ,AAAlC,CACA,EADQ,OAAO,CACf;IAA0B,YAAY,AAAtC,CACA,EADQ,OAAO,CACf;CAE+C,GAFrC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,cAAc,EAAE,CAAA;CAAE,CA6B3D"}
|
package/types/lib/cli/index.d.ts
CHANGED
|
@@ -92,6 +92,14 @@ export declare function createHBom(_path: string, options: Object): Promise<Obje
|
|
|
92
92
|
* @param {Object} options Parse options from the cli
|
|
93
93
|
* @returns {Promise<Object>} Promise resolving to BOM object
|
|
94
94
|
*/
|
|
95
|
+
/**
|
|
96
|
+
* Generate a BOM for one path, letting a deferred fail-on-error abort return
|
|
97
|
+
* the empty BOM the flag promises rather than unwinding past the reports.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} path Source path.
|
|
100
|
+
* @param {Object} options CLI options.
|
|
101
|
+
* @returns {Promise<Object>} BOM NS data.
|
|
102
|
+
*/
|
|
95
103
|
export declare function createBom(path: string, options: Object): Promise<Object>;
|
|
96
104
|
/**
|
|
97
105
|
* Method to submit the generated bom to dependency-track or cyclonedx server
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AAoEA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,OAAO,EAJ5C,MAI4C,GAH1C,OAAO,CAAC,MAAM,CAAC,CAqmC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAJhC,MAIgC,EAAE,OAAO,EAHzC,MAGyC,GAFvC,OAAO,CAAC,MAAM,CAAC,CAoD3B;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAJ1B,MAI0B,EAAE,OAAO,EAHnC,MAGmC,GAFjC,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CA4YrC;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAJ3B,MAI2B,EAAE,OAAO,EAHpC,MAGoC,GAFlC,OAAO,CAAC,MAAM,CAAC,CAsB3B;AAED;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAJzB,MAIyB,EAAE,OAAO,EAHlC,MAGkC,GAFhC,OAAO,CAAC,MAAM,CAAC,CAa3B;AAsVD;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,IAAI,EALzB,MAKyB,EAAE,WAAW,EAJtC,MAIsC,GAHrC,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,CA+FjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/jsBom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/jsBom.js"],"names":[],"mappings":"AAiGA;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAJlC,MAIkC,EAAE,OAAO,EAH3C,MAG2C,GAFzC,MAAM,GAAC,SAAS,CAwB5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAJ/B,MAI+B,EAAE,OAAO,EAHxC,MAGwC,GAFtC,OAAO,CAAC,MAA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.ts","sourceRoot":"","sources":["../../../lib/cli/jvmBom.js"],"names":[],"mappings":"AAgGA;;;;;GAKG;AACH,eAAO,IAAI,gBAAgB,EAFjB,MAIsD,CAAC;AAUjE;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,EAHrB,MAQT,CAAC;AAEF;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,EAHhB,MAIqE,CAAC;AAEhF;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAL5B,MAK4B,EAAE,OAAO,EAJrC,MAIqC,GAFnC,MAAM,CA8ElB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EALxC,MAKwC,EAAE,MAAM,EAJhD,MAIgD,EAAE,GAAG,EAHrD,MAGqD,GAFnD,MAAM,EAAE,CA8DpB;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAJ7B,MAI6B,EAAE,OAAO,EAHtC,MAGsC,GAFpC,OAAO,CAAC,MAAM,CAAC,CAmsD3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managedBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/managedBom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"managedBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/managedBom.js"],"names":[],"mappings":"AAyHA;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,QAJ5B,MAAM,YACN,MAAM,KACJ,OAMZ,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,QAJ1B,MAAM,YACN,MAAM,KACJ,OAeZ,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,QAAA,EAAE,OAAO,EAHhC,MAGgC,GAF9B,MAAM,GAAG,IAAI,CAsEzB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAJ/B,MAI+B,EAAE,OAAO,EAHxC,MAGwC,GAFtC,OAAO,CAAC,MAAM,CAAC,CA2pB3B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAJzB,MAIyB,EAAE,OAAO,EAHlC,MAGkC,GAFhC,MAAM,CAyBlB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAJ7B,MAI6B,EAAE,OAAO,EAHtC,MAGsC,GAFpC,MAAM,CAsBlB;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAJhC,MAIgC,EAAE,OAAO,EAHzC,MAGyC,GAFvC,OAAO,CAAC,MAAM,CAAC,CA2C3B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAJvB,MAIuB,EAAE,OAAO,EAHhC,MAGgC,GAF9B,MAAM,CA0BlB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAJtB,MAIsB,EAAE,OAAO,EAH/B,MAG+B,GAF7B,MAAM,CA+LlB;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAJ7B,MAI6B,EAAE,OAAO,EAHtC,MAGsC,GAFpC,OAAO,CAAC,MAAM,CAAC,CAkS3B;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAJ/B,MAI+B,EAAE,OAAO,EAHxC,MAGwC,GAFtC,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CAsfrC;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAJpC,MAIoC,EAAE,OAAO,EAH7C,MAG6C,GAF3C,OAAO,CAAC,MAAM,CAAC,CAmF3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/nativeBom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nativeBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/nativeBom.js"],"names":[],"mappings":"AAiJA;;;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gB,eAAe,CAAC,IAAI,EAJzB,MAIyB,EAAE,OAAO,EAHlC,MAGkC,GAFhC,MAAM,CAiClB;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAJ9B,MAI8B,EAAE,OAAO,EAHvC,MAGuC,GAFrC,OAAO,CAAC,MAAM,CAAC,CAwJ3B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAJ9B,MAI8B,EAAE,OAAO,EAHvC,MAGuC,GAFrC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuLvC;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAJ5B,MAI4B,EAAE,OAAO,EAHrC,MAGqC,GAFnC,OAAO,CAAC,MAAM,CAAC,CAkI3B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAJ5B,MAI4B,EAAE,OAAO,EAHrC,MAGqC,GAFnC,OAAO,CAAC,MAAM,CAAC,CA4D3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAJ9B,MAI8B,EAAE,OAAO,EAHvC,MAGuC,GAFrC,OAAO,CAAC,MAAM,CAAC,CAwD3B"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build ledger: an opt-in, worker-safe recorder of structured build-adequacy
|
|
3
|
+
* events.
|
|
4
|
+
*
|
|
5
|
+
* Producers record what a run did to its build environment — the tool versions
|
|
6
|
+
* a project expected, the tools that were actually found, the commands that
|
|
7
|
+
* failed, the fallback code paths that were taken — and the post-generation
|
|
8
|
+
* reflection turns those events into a fidelity verdict. The recorder follows
|
|
9
|
+
* the shape of `activity.js` but stays a separate stream: activity records
|
|
10
|
+
* describe security-relevant side effects consumed by the secure-mode
|
|
11
|
+
* machinery, while ledger events describe environment adequacy consumed by the
|
|
12
|
+
* introspection report.
|
|
13
|
+
*
|
|
14
|
+
* Two facts about workers shape the design:
|
|
15
|
+
*
|
|
16
|
+
* 1. A worker thread gets its own instance of this module, so events recorded
|
|
17
|
+
* inside a worker are invisible to the main thread's in-memory buffer.
|
|
18
|
+
* When `CDXGEN_INTROSPECT_LEDGER` is set, every instance appends its events
|
|
19
|
+
* to the same JSONL sidecar through an `O_APPEND` descriptor (only the main
|
|
20
|
+
* thread truncates, at open), which makes the sidecar the only complete
|
|
21
|
+
* record of a multi-worker run. Consumers must therefore prefer the sidecar
|
|
22
|
+
* when it exists and fall back to `getLedgerEvents()` only when it does not.
|
|
23
|
+
* 2. Every write reaches the descriptor synchronously at record time, so a
|
|
24
|
+
* lost tail is impossible; the descriptor is released when the process
|
|
25
|
+
* exits (`closeLogStreams` closes every shared writer) or earlier through
|
|
26
|
+
* {@link closeLedger}.
|
|
27
|
+
*
|
|
28
|
+
* Values that could carry credentials are scrubbed before they are stored or
|
|
29
|
+
* written: `command`, `path`, `detail`, `causeDetail` and `outputExcerpt` pass
|
|
30
|
+
* through sensitive-assignment redaction plus the BOM property sanitizer, so a
|
|
31
|
+
* leaked token can never reach a report file that agents upload.
|
|
32
|
+
*/
|
|
33
|
+
export type LedgerEvent = {
|
|
34
|
+
/**
|
|
35
|
+
* One of LEDGER_EVENT_KINDS.
|
|
36
|
+
*/
|
|
37
|
+
kind: string;
|
|
38
|
+
/**
|
|
39
|
+
* Canonical project type ("java", "npm", "python", …).
|
|
40
|
+
*/
|
|
41
|
+
ecosystem: string;
|
|
42
|
+
/**
|
|
43
|
+
* Tool identity ("maven", "gradle", "swift", "dotnet").
|
|
44
|
+
*/
|
|
45
|
+
tool?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Version or version range the project asked for.
|
|
48
|
+
*/
|
|
49
|
+
wanted?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Version actually resolved, or undefined when absent.
|
|
52
|
+
*/
|
|
53
|
+
found?: string;
|
|
54
|
+
/**
|
|
55
|
+
* How `found` was determined ("PATH", "wrapper", "sdkman", "env").
|
|
56
|
+
*/
|
|
57
|
+
source?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Absolute path of the resolved tool or the file that was read.
|
|
60
|
+
*/
|
|
61
|
+
path?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Command line, already redacted.
|
|
64
|
+
*/
|
|
65
|
+
command?: string;
|
|
66
|
+
exitCode?: number;
|
|
67
|
+
/**
|
|
68
|
+
* One sentence, present tense, no remediation text.
|
|
69
|
+
*/
|
|
70
|
+
detail?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Short diagnosed cause of a failure ("gradle cannot run on Java 21"), when the producer derived one.
|
|
73
|
+
*/
|
|
74
|
+
causeDetail?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Redacted, at most the last 2000 characters of the failed command's combined stdout and stderr, with interior newlines preserved. Suppressed entirely by `CDXGEN_INTROSPECT_NO_OUTPUT`.
|
|
77
|
+
*/
|
|
78
|
+
outputExcerpt?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Key into the remediation catalog (Deliverable 06).
|
|
81
|
+
*/
|
|
82
|
+
remediationId?: string;
|
|
83
|
+
/**
|
|
84
|
+
* One of LEDGER_EVENT_IMPACTS.
|
|
85
|
+
*/
|
|
86
|
+
impact?: string;
|
|
87
|
+
/**
|
|
88
|
+
* ISO 8601.
|
|
89
|
+
*/
|
|
90
|
+
timestamp: string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* A structured build-adequacy event.
|
|
94
|
+
*
|
|
95
|
+
* @typedef {Object} LedgerEvent
|
|
96
|
+
* @property {string} kind One of LEDGER_EVENT_KINDS.
|
|
97
|
+
* @property {string} ecosystem Canonical project type ("java", "npm", "python", …).
|
|
98
|
+
* @property {string} [tool] Tool identity ("maven", "gradle", "swift", "dotnet").
|
|
99
|
+
* @property {string} [wanted] Version or version range the project asked for.
|
|
100
|
+
* @property {string} [found] Version actually resolved, or undefined when absent.
|
|
101
|
+
* @property {string} [source] How `found` was determined ("PATH", "wrapper", "sdkman", "env").
|
|
102
|
+
* @property {string} [path] Absolute path of the resolved tool or the file that was read.
|
|
103
|
+
* @property {string} [command] Command line, already redacted.
|
|
104
|
+
* @property {number} [exitCode]
|
|
105
|
+
* @property {string} [detail] One sentence, present tense, no remediation text.
|
|
106
|
+
* @property {string} [causeDetail] Short diagnosed cause of a failure ("gradle cannot run on Java 21"), when the producer derived one.
|
|
107
|
+
* @property {string} [outputExcerpt] Redacted, at most the last 2000 characters of the failed command's combined stdout and stderr, with interior newlines preserved. Suppressed entirely by `CDXGEN_INTROSPECT_NO_OUTPUT`.
|
|
108
|
+
* @property {string} [remediationId] Key into the remediation catalog (Deliverable 06).
|
|
109
|
+
* @property {string} [impact] One of LEDGER_EVENT_IMPACTS.
|
|
110
|
+
* @property {string} timestamp ISO 8601.
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* The closed set of event kinds. `kind` is validated against this object: a
|
|
114
|
+
* kind that is not listed is dropped (with a think-log note) rather than
|
|
115
|
+
* recorded, so a producer bug can never fail a customer's SBOM run. Adding a
|
|
116
|
+
* kind here is a schema change; consumers must tolerate unknown kinds by
|
|
117
|
+
* ignoring them.
|
|
118
|
+
*
|
|
119
|
+
* @type {Readonly<Record<string, string>>}
|
|
120
|
+
*/
|
|
121
|
+
export declare const LEDGER_EVENT_KINDS: Readonly<Record<string, string>>;
|
|
122
|
+
/**
|
|
123
|
+
* The closed set of `impact` values, describing what a degraded outcome costs
|
|
124
|
+
* the fidelity of the generated BOM.
|
|
125
|
+
*
|
|
126
|
+
* @type {Readonly<Record<string, string>>}
|
|
127
|
+
*/
|
|
128
|
+
export declare const LEDGER_EVENT_IMPACTS: Readonly<Record<string, string>>;
|
|
129
|
+
/**
|
|
130
|
+
* Reserved `ecosystem` value for events that describe the recorder itself
|
|
131
|
+
* rather than a project ecosystem, such as the truncation marker. Consumers
|
|
132
|
+
* that group events by ecosystem must treat it as a global observation instead
|
|
133
|
+
* of creating an ecosystem entry for it.
|
|
134
|
+
*
|
|
135
|
+
* @type {string}
|
|
136
|
+
*/
|
|
137
|
+
export declare const LEDGER_TOOL_ECOSYSTEM: string;
|
|
138
|
+
/**
|
|
139
|
+
* Module-load snapshot of the build-introspection environment: `CDXGEN_INTROSPECT`
|
|
140
|
+
* is `true`/`1`, or `CDXGEN_INTROSPECT_LEDGER` names a sidecar file. Library
|
|
141
|
+
* callers that configure introspection before importing this module can read
|
|
142
|
+
* it directly; the CLI enables introspection after argument parsing, so every
|
|
143
|
+
* internal gate reads {@link isLedgerEnabled}, which resolves the same
|
|
144
|
+
* environment on each call.
|
|
145
|
+
*
|
|
146
|
+
* @type {boolean}
|
|
147
|
+
*/
|
|
148
|
+
export declare const LEDGER_ENABLED: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* True when build-introspection recording is enabled for this run: the same
|
|
151
|
+
* environment as {@link LEDGER_ENABLED}, read live. The CLI turns
|
|
152
|
+
* introspection on after argument parsing by setting `CDXGEN_INTROSPECT`, so
|
|
153
|
+
* a module-load snapshot would miss every event recorded after that point;
|
|
154
|
+
* the environment only ever flips in that one direction during a run.
|
|
155
|
+
*
|
|
156
|
+
* @returns {boolean} True when events should be recorded.
|
|
157
|
+
*/
|
|
158
|
+
/**
|
|
159
|
+
* Whether build introspection is enabled for this run. The flag decides when
|
|
160
|
+
* it was given; otherwise the environment speaks, which is how a run that
|
|
161
|
+
* enabled introspection through a profile reaches the recorders.
|
|
162
|
+
*
|
|
163
|
+
* @param {Object} [options] CLI options.
|
|
164
|
+
* @returns {boolean} True when the run records and reports a verdict.
|
|
165
|
+
*/
|
|
166
|
+
export declare function isIntrospectionEnabled(options?: Object): boolean;
|
|
167
|
+
export declare function isLedgerEnabled(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Redact a free-text introspection value with the ledger's own redactor. Both
|
|
170
|
+
* report renderers run their free text through this function so a field can
|
|
171
|
+
* never be redacted differently in the ledger, the JSON report and the
|
|
172
|
+
* markdown report.
|
|
173
|
+
*
|
|
174
|
+
* @param {string|undefined} value Free text of untrusted origin.
|
|
175
|
+
* @returns {string|undefined} Redacted text.
|
|
176
|
+
*/
|
|
177
|
+
export declare function redactIntrospectionText(value: string | undefined): string | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Combined stdout and stderr of a spawned command, as the raw material of an
|
|
180
|
+
* output excerpt. Producers that already hold a spawn result call this so the
|
|
181
|
+
* recorder, not the producer, owns truncation and redaction.
|
|
182
|
+
*
|
|
183
|
+
* @param {Object|undefined} spawnResult A spawnSync-style result.
|
|
184
|
+
* @returns {string|undefined} The combined output, or undefined when the command produced none.
|
|
185
|
+
*/
|
|
186
|
+
export declare function commandOutputText(spawnResult: Object | undefined): string | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Record one build-adequacy event. Returns immediately after a single boolean
|
|
189
|
+
* test when introspection is disabled, so producers may pass plain values
|
|
190
|
+
* without gating the call themselves.
|
|
191
|
+
*
|
|
192
|
+
* Events with a kind outside LEDGER_EVENT_KINDS, or without a non-empty
|
|
193
|
+
* `ecosystem`, are dropped with a think-log note instead of throwing: the
|
|
194
|
+
* ledger is instrumentation, and a producer bug must never fail an SBOM run.
|
|
195
|
+
*
|
|
196
|
+
* @param {string} kind Event kind; one of LEDGER_EVENT_KINDS.
|
|
197
|
+
* @param {Partial<LedgerEvent>} [fields] Event fields; `command`, `path`, `detail`, `causeDetail` and `outputExcerpt` are redacted before storage, and `outputExcerpt` is additionally bounded to its tail.
|
|
198
|
+
* @returns {LedgerEvent|undefined} The stored event, or undefined when recording is disabled or the event was dropped.
|
|
199
|
+
*/
|
|
200
|
+
export declare function recordLedgerEvent(kind: string, fields?: Partial<LedgerEvent>): LedgerEvent | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Resolve the event kind for a remediation id from the catalog.
|
|
203
|
+
*
|
|
204
|
+
* @param {string} remediationId Remediation id to look up.
|
|
205
|
+
* @returns {string|undefined} Default event kind, or undefined when the id is unknown or the catalog is unavailable.
|
|
206
|
+
*/
|
|
207
|
+
export declare function remediationKindFor(remediationId: string): string | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* The full remediation catalog, for consumers that need the extended entry
|
|
210
|
+
* fields (target tier, actions, verify clause) rather than a single resolved
|
|
211
|
+
* kind. Returns the cached parsed catalog; null when the data file is
|
|
212
|
+
* missing or unreadable.
|
|
213
|
+
*
|
|
214
|
+
* @returns {Record<string, Object>|null} Catalog keyed by remediation id, or null when unavailable.
|
|
215
|
+
*/
|
|
216
|
+
export declare function getRemediationCatalog(): Record<string, Object> | null;
|
|
217
|
+
/**
|
|
218
|
+
* Record a degraded outcome together with the remediation that would restore
|
|
219
|
+
* the lost evidence. The kind and the remediationId come from the catalog
|
|
220
|
+
* entry for `remediationId`, so a site only supplies the facts it observed;
|
|
221
|
+
* `ecosystem` and `impact` are required from the caller because only the site
|
|
222
|
+
* knows which scanned ecosystem paid the cost and how much. A site whose
|
|
223
|
+
* degradation differs in kind from the catalog default (a command that threw
|
|
224
|
+
* rather than a fallback that engaged) may pass an explicit `kind` in fields.
|
|
225
|
+
*
|
|
226
|
+
* Events for unknown ids are dropped with a think-log note: an id outside the
|
|
227
|
+
* catalog is a producer bug and the catalog is the contract.
|
|
228
|
+
*
|
|
229
|
+
* @param {string} remediationId Key into data/remediations.json.
|
|
230
|
+
* @param {Partial<LedgerEvent> & {kind?: string}} fields Event fields; `ecosystem` and `impact` are required, `kind` overrides the catalog default.
|
|
231
|
+
* @returns {LedgerEvent|undefined} The stored event, or undefined when recording is disabled or the event was dropped.
|
|
232
|
+
*/
|
|
233
|
+
export declare function recordDegradation(remediationId: string, fields?: Partial<LedgerEvent> & {
|
|
234
|
+
kind?: string;
|
|
235
|
+
}): LedgerEvent | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Snapshot of the events recorded by this thread. Each event and the array
|
|
238
|
+
* itself are frozen, so a consumer cannot mutate the recorder's state.
|
|
239
|
+
* In a multi-worker run this buffer is this thread's view only; the JSONL
|
|
240
|
+
* sidecar is the complete record.
|
|
241
|
+
*
|
|
242
|
+
* @returns {LedgerEvent[]} Frozen array of frozen events.
|
|
243
|
+
*/
|
|
244
|
+
export declare function getLedgerEvents(): LedgerEvent[];
|
|
245
|
+
/**
|
|
246
|
+
* Clear the in-memory buffer and the truncation state. Intended for tests; a
|
|
247
|
+
* production run never resets its own ledger. The sidecar file is append-only
|
|
248
|
+
* and is not touched.
|
|
249
|
+
*
|
|
250
|
+
* @returns {void}
|
|
251
|
+
*/
|
|
252
|
+
export declare function resetLedgerEvents(): void;
|
|
253
|
+
/**
|
|
254
|
+
* Parse a JSONL sidecar produced by `CDXGEN_INTROSPECT_LEDGER` back into
|
|
255
|
+
* events. Blank lines and lines that fail to parse — a torn final line from an
|
|
256
|
+
* interrupted run is expected — are skipped. Prefer this over the in-memory
|
|
257
|
+
* buffer whenever the sidecar exists: worker threads append to the same file,
|
|
258
|
+
* so it is the only complete record of a multi-worker run.
|
|
259
|
+
*
|
|
260
|
+
* @param {string} ledgerPath Path to the JSONL sidecar.
|
|
261
|
+
* @returns {LedgerEvent[]} Frozen array of frozen events, empty when the file is missing or unreadable.
|
|
262
|
+
*/
|
|
263
|
+
export declare function loadLedgerFile(ledgerPath: string): LedgerEvent[];
|
|
264
|
+
/**
|
|
265
|
+
* Close the sidecar descriptor held by this thread. Idempotent; further
|
|
266
|
+
* events stay in memory only. The descriptor is also released when the
|
|
267
|
+
* process exits through `closeLogStreams`.
|
|
268
|
+
*
|
|
269
|
+
* @returns {void}
|
|
270
|
+
*/
|
|
271
|
+
export declare function closeLedger(): void;
|
|
272
|
+
//# sourceMappingURL=buildLedger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildLedger.d.ts","sourceRoot":"","sources":["../../../lib/core/buildLedger.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AA0BA,YAAkB,WAAW,GAC7B;;;;IAAoB,IAAI,EAAb,MAAM,CACjB;;;;IAAoB,SAAS,EAAlB,MAAM,CACjB;;;;IAA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CAO5B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAHlC,MAAM,GAAC,SAG2B,GAFhC,MAAM,GAAC,SAAS,CAU5B;AA0JD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAJ3B,MAI2B,EAAE,MAAM,AAH3C,CACA,EADQ,OAAO,CAAC,WAAW,CAGqB,GAFtC,WAAW,GAAC,SAAS,CAmBjC;AAsCD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAHrC,MAGqC,GAFnC,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAFxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAC,IAAI,CAIvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAJpC,MAIoC,EAAE,MAAM,GAH5C,OAAO,CAAC,WAAW,CAAC,GAAG;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAGY,GAF/C,WAAW,GAAC,SAAS,CAkBjC;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAFlB,WAAW,EAAE,CAMzB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAFpB,IAAI,CAKhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAH9B,MAG8B,GAF5B,WAAW,EAAE,CAwBzB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,IAFd,IAAI,CAYhB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deferred `fail-on-error` exits for introspected runs.
|
|
3
|
+
*
|
|
4
|
+
* `--fail-on-error` promises an operator that a failing dependency extractor
|
|
5
|
+
* never produces a plausible-but-incomplete BOM, so the extractors exit the
|
|
6
|
+
* process the moment a build tool fails. Under `--introspect` that exit
|
|
7
|
+
* destroys the very evidence the run exists to produce: the ledger events
|
|
8
|
+
* recorded a statement earlier die with the process, `postProcess` never
|
|
9
|
+
* runs, and neither the BOM nor the fidelity report is written.
|
|
10
|
+
*
|
|
11
|
+
* On an introspected run the extractor instead records the failure here and
|
|
12
|
+
* throws {@link DeferredFailOnError}, which the extractor catches at its
|
|
13
|
+
* completion point so it still returns everything it collected before the
|
|
14
|
+
* failure — the incomplete-result fallbacks stay skipped, exactly as
|
|
15
|
+
* `fail-on-error` demands. The CLI then writes the BOM and both reports and
|
|
16
|
+
* exits with the dedicated {@link INTROSPECTION_FAILURE_EXIT_CODE} status, so
|
|
17
|
+
* the exit code still claims "an extractor failed", distinct from the
|
|
18
|
+
* fidelity gate's 4.
|
|
19
|
+
*
|
|
20
|
+
* Without introspection this module is a pass-through to `process.exit(1)`;
|
|
21
|
+
* the default contract of the flag is unchanged.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Exit status used when an introspected run completes its outputs despite a
|
|
25
|
+
* `--fail-on-error` extractor failure. Distinct from 1 (generic failure),
|
|
26
|
+
* 3 (TEA publish failure) and 4 (the introspection fidelity gate).
|
|
27
|
+
*
|
|
28
|
+
* @type {number}
|
|
29
|
+
*/
|
|
30
|
+
export declare const INTROSPECTION_FAILURE_EXIT_CODE: number;
|
|
31
|
+
/**
|
|
32
|
+
* Control-flow signal thrown by {@link deferFailOnError} on an introspected
|
|
33
|
+
* run. The extractor that called it must let it unwind to its completion
|
|
34
|
+
* point, keep everything it collected until then, and rethrow anything else.
|
|
35
|
+
*/
|
|
36
|
+
export declare class DeferredFailOnError extends Error {
|
|
37
|
+
/**
|
|
38
|
+
* @param {string} message Human-readable failure summary.
|
|
39
|
+
*/
|
|
40
|
+
constructor(message: string);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Test whether an error is the fail-on-error deferral signal.
|
|
44
|
+
*
|
|
45
|
+
* @param {unknown} err The caught error.
|
|
46
|
+
* @returns {boolean} True when the error unwinds a deferred fail-on-error abort.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isDeferredFailOnError(err: unknown): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Snapshot of the deferred failures recorded by this run.
|
|
51
|
+
*
|
|
52
|
+
* @returns {Array<Object>} Frozen copies of the recorded failures.
|
|
53
|
+
*/
|
|
54
|
+
export declare function getDeferredFailures(): Array<Object>;
|
|
55
|
+
/**
|
|
56
|
+
* Handle a failing extractor on behalf of a `options.failOnError &&
|
|
57
|
+
* process.exit(1)` site. Without `fail-on-error` the run continues exactly
|
|
58
|
+
* as it would have. With the flag and no introspection the process exits 1,
|
|
59
|
+
* unchanged. On an introspected run the failure is recorded — including one
|
|
60
|
+
* ledger observation on the ecosystem row the failure cost evidence — and
|
|
61
|
+
* the deferral signal is thrown so the extractor stops where it is without
|
|
62
|
+
* taking any incomplete-result fallback.
|
|
63
|
+
*
|
|
64
|
+
* @param {Object} options CLI options.
|
|
65
|
+
* @param {Object} failure What failed, for the operator message and the report.
|
|
66
|
+
* @param {string} failure.tool The build tool that failed.
|
|
67
|
+
* @param {string} [failure.ecosystem] The ecosystem the tool serves, so the
|
|
68
|
+
* observation lands on the row whose evidence the failure cost.
|
|
69
|
+
* @param {string} failure.detail One sentence, present tense.
|
|
70
|
+
* @param {number} [failure.exitCode] The tool's exit status, when known.
|
|
71
|
+
* @param {string} [failure.command] The redacted command that was attempted.
|
|
72
|
+
* @param {string} [failure.outputExcerpt] The failed command's combined output,
|
|
73
|
+
* when the caller already holds it; the recorder bounds and redacts it.
|
|
74
|
+
* @returns {void} Never returns on an introspected run; it throws.
|
|
75
|
+
*/
|
|
76
|
+
export declare function deferFailOnError(options: Object, failure: {
|
|
77
|
+
tool: string;
|
|
78
|
+
ecosystem?: string;
|
|
79
|
+
detail: string;
|
|
80
|
+
exitCode?: number;
|
|
81
|
+
command?: string;
|
|
82
|
+
outputExcerpt?: string;
|
|
83
|
+
}): void;
|
|
84
|
+
//# sourceMappingURL=deferredExit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferredExit.d.ts","sourceRoot":"","sources":["../../../lib/core/deferredExit.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AASH;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,EAFlC,MAEsC,CAAC;AAEjD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C;;OAEG;IACH,YAAY,OAAO,EAFR,MAEQ,EAGlB;CACF;AAWD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAH9B,OAG8B,GAF5B,OAAO,CAInB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAFtB,KAAK,CAAC,MAAM,CAAC,CAIzB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAZ7B,MAY6B,EAAE,OAAO,EAV9C;IAAwB,IAAI,EAApB,MAAM,CACd;IAAyB,SAAS,AAAlC,CAEA,EAFQ,MAAM,CAEd;IAAwB,MAAM,EAAtB,MAAM,CACd;IAAyB,QAAQ,AAAjC,CACA,EADQ,MAAM,CACd;IAAyB,OAAO,AAAhC,CACA,EADQ,MAAM,CACd;IAAyB,aAAa,AAAtC,CAEA,EAFQ,MAAM,CAEd;CAE8C,GAFpC,IAAI,CAuChB"}
|