@cyclonedx/cdxgen 12.1.5 → 12.2.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 +47 -39
- package/bin/cdxgen.js +175 -96
- package/bin/evinse.js +4 -4
- package/bin/repl.js +1 -1
- package/bin/sign.js +102 -0
- package/bin/validate.js +233 -0
- package/bin/verify.js +69 -28
- package/data/queries.json +1 -1
- package/data/rules/ci-permissions.yaml +186 -0
- package/data/rules/dependency-sources.yaml +123 -0
- package/data/rules/package-integrity.yaml +135 -0
- package/data/rules/vscode-extensions.yaml +228 -0
- package/lib/cli/index.js +327 -372
- package/lib/evinser/db.js +137 -0
- package/lib/{helpers → evinser}/db.poku.js +2 -6
- package/lib/evinser/evinser.js +2 -14
- package/lib/helpers/bomSigner.js +312 -0
- package/lib/helpers/bomSigner.poku.js +156 -0
- package/lib/helpers/ciParsers/azurePipelines.js +295 -0
- package/lib/helpers/ciParsers/azurePipelines.poku.js +253 -0
- package/lib/helpers/ciParsers/circleCi.js +286 -0
- package/lib/helpers/ciParsers/circleCi.poku.js +230 -0
- package/lib/helpers/ciParsers/common.js +24 -0
- package/lib/helpers/ciParsers/githubActions.js +636 -0
- package/lib/helpers/ciParsers/githubActions.poku.js +802 -0
- package/lib/helpers/ciParsers/gitlabCi.js +213 -0
- package/lib/helpers/ciParsers/gitlabCi.poku.js +247 -0
- package/lib/helpers/ciParsers/jenkins.js +181 -0
- package/lib/helpers/ciParsers/jenkins.poku.js +197 -0
- package/lib/helpers/depsUtils.js +203 -0
- package/lib/helpers/depsUtils.poku.js +150 -0
- package/lib/helpers/display.js +423 -4
- package/lib/helpers/envcontext.js +18 -3
- package/lib/helpers/formulationParsers.js +351 -0
- package/lib/helpers/logger.js +14 -0
- package/lib/helpers/protobom.js +9 -9
- package/lib/helpers/pythonutils.js +9 -0
- package/lib/helpers/utils.js +681 -406
- package/lib/helpers/utils.poku.js +55 -255
- package/lib/helpers/versutils.js +202 -0
- package/lib/helpers/versutils.poku.js +315 -0
- package/lib/helpers/vsixutils.js +1061 -0
- package/lib/helpers/vsixutils.poku.js +2247 -0
- package/lib/managers/binary.js +19 -19
- package/lib/managers/docker.js +108 -1
- package/lib/managers/oci.js +10 -0
- package/lib/managers/piptree.js +3 -9
- package/lib/parsers/npmrc.js +17 -13
- package/lib/parsers/npmrc.poku.js +41 -5
- package/lib/server/openapi.yaml +1 -1
- package/lib/server/server.js +40 -11
- package/lib/server/server.poku.js +123 -144
- package/lib/stages/postgen/annotator.js +1 -1
- package/lib/stages/postgen/auditBom.js +197 -0
- package/lib/stages/postgen/auditBom.poku.js +378 -0
- package/lib/stages/postgen/postgen.js +54 -1
- package/lib/stages/postgen/postgen.poku.js +90 -1
- package/lib/stages/postgen/ruleEngine.js +369 -0
- package/lib/stages/pregen/envAudit.js +299 -0
- package/lib/stages/pregen/envAudit.poku.js +572 -0
- package/lib/stages/pregen/pregen.js +12 -8
- package/lib/{helpers/validator.js → validator/bomValidator.js} +107 -47
- package/lib/validator/complianceEngine.js +241 -0
- package/lib/validator/complianceEngine.poku.js +168 -0
- package/lib/validator/complianceRules.js +1610 -0
- package/lib/validator/complianceRules.poku.js +328 -0
- package/lib/validator/index.js +222 -0
- package/lib/validator/index.poku.js +144 -0
- package/lib/validator/reporters/annotations.js +121 -0
- package/lib/validator/reporters/console.js +149 -0
- package/lib/validator/reporters/index.js +41 -0
- package/lib/validator/reporters/json.js +37 -0
- package/lib/validator/reporters/sarif.js +184 -0
- package/lib/validator/reporters.poku.js +150 -0
- package/package.json +8 -8
- package/types/bin/sign.d.ts +3 -0
- package/types/bin/sign.d.ts.map +1 -0
- package/types/bin/validate.d.ts +3 -0
- package/types/bin/validate.d.ts.map +1 -0
- package/types/helpers/utils.d.ts +0 -1
- package/types/lib/cli/index.d.ts +49 -52
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/evinser/db.d.ts +34 -0
- package/types/lib/evinser/db.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +63 -16
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +27 -0
- package/types/lib/helpers/bomSigner.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/azurePipelines.d.ts +17 -0
- package/types/lib/helpers/ciParsers/azurePipelines.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/circleCi.d.ts +17 -0
- package/types/lib/helpers/ciParsers/circleCi.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/common.d.ts +11 -0
- package/types/lib/helpers/ciParsers/common.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/githubActions.d.ts +34 -0
- package/types/lib/helpers/ciParsers/githubActions.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/gitlabCi.d.ts +17 -0
- package/types/lib/helpers/ciParsers/gitlabCi.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/jenkins.d.ts +17 -0
- package/types/lib/helpers/ciParsers/jenkins.d.ts.map +1 -0
- package/types/lib/helpers/depsUtils.d.ts +21 -0
- package/types/lib/helpers/depsUtils.d.ts.map +1 -0
- package/types/lib/helpers/display.d.ts +111 -11
- package/types/lib/helpers/display.d.ts.map +1 -1
- package/types/lib/helpers/envcontext.d.ts +19 -7
- package/types/lib/helpers/envcontext.d.ts.map +1 -1
- package/types/lib/helpers/formulationParsers.d.ts +50 -0
- package/types/lib/helpers/formulationParsers.d.ts.map +1 -0
- package/types/lib/helpers/logger.d.ts +15 -1
- package/types/lib/helpers/logger.d.ts.map +1 -1
- package/types/lib/helpers/protobom.d.ts +2 -2
- package/types/lib/helpers/pythonutils.d.ts +10 -1
- package/types/lib/helpers/pythonutils.d.ts.map +1 -1
- package/types/lib/helpers/utils.d.ts +532 -128
- package/types/lib/helpers/utils.d.ts.map +1 -1
- package/types/lib/helpers/versutils.d.ts +8 -0
- package/types/lib/helpers/versutils.d.ts.map +1 -0
- package/types/lib/helpers/vsixutils.d.ts +130 -0
- package/types/lib/helpers/vsixutils.d.ts.map +1 -0
- package/types/lib/managers/docker.d.ts +12 -31
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/managers/oci.d.ts +11 -1
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/managers/piptree.d.ts.map +1 -1
- package/types/lib/parsers/npmrc.d.ts +4 -1
- package/types/lib/parsers/npmrc.d.ts.map +1 -1
- package/types/lib/server/server.d.ts +21 -2
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/auditBom.d.ts +20 -0
- package/types/lib/stages/postgen/auditBom.d.ts.map +1 -0
- package/types/lib/stages/postgen/postgen.d.ts +8 -1
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts +18 -0
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -0
- package/types/lib/stages/pregen/envAudit.d.ts +8 -0
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -0
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/{helpers/validator.d.ts → validator/bomValidator.d.ts} +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -0
- package/types/lib/validator/complianceEngine.d.ts +66 -0
- package/types/lib/validator/complianceEngine.d.ts.map +1 -0
- package/types/lib/validator/complianceRules.d.ts +70 -0
- package/types/lib/validator/complianceRules.d.ts.map +1 -0
- package/types/lib/validator/index.d.ts +70 -0
- package/types/lib/validator/index.d.ts.map +1 -0
- package/types/lib/validator/reporters/annotations.d.ts +31 -0
- package/types/lib/validator/reporters/annotations.d.ts.map +1 -0
- package/types/lib/validator/reporters/console.d.ts +30 -0
- package/types/lib/validator/reporters/console.d.ts.map +1 -0
- package/types/lib/validator/reporters/index.d.ts +21 -0
- package/types/lib/validator/reporters/index.d.ts.map +1 -0
- package/types/lib/validator/reporters/json.d.ts +11 -0
- package/types/lib/validator/reporters/json.d.ts.map +1 -0
- package/types/lib/validator/reporters/sarif.d.ts +16 -0
- package/types/lib/validator/reporters/sarif.d.ts.map +1 -0
- package/lib/helpers/db.js +0 -162
- package/lib/stages/pregen/env-audit.js +0 -34
- package/lib/stages/pregen/env-audit.poku.js +0 -290
- package/types/helpers/db.d.ts +0 -35
- package/types/helpers/db.d.ts.map +0 -1
- package/types/lib/helpers/db.d.ts +0 -35
- package/types/lib/helpers/db.d.ts.map +0 -1
- package/types/lib/helpers/validator.d.ts.map +0 -1
- package/types/lib/stages/pregen/env-audit.d.ts +0 -2
- package/types/lib/stages/pregen/env-audit.d.ts.map +0 -1
- package/types/managers/binary.d.ts +0 -37
- package/types/managers/binary.d.ts.map +0 -1
- package/types/managers/docker.d.ts +0 -56
- package/types/managers/docker.d.ts.map +0 -1
- package/types/managers/oci.d.ts +0 -2
- package/types/managers/oci.d.ts.map +0 -1
- package/types/managers/piptree.d.ts +0 -2
- package/types/managers/piptree.d.ts.map +0 -1
- package/types/server/server.d.ts +0 -34
- package/types/server/server.d.ts.map +0 -1
- package/types/stages/postgen/annotator.d.ts +0 -27
- package/types/stages/postgen/annotator.d.ts.map +0 -1
- package/types/stages/postgen/postgen.d.ts +0 -51
- package/types/stages/postgen/postgen.d.ts.map +0 -1
- package/types/stages/pregen/pregen.d.ts +0 -59
- package/types/stages/pregen/pregen.d.ts.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a single GitHub Actions workflow file and return formulation-shaped data.
|
|
3
|
+
*
|
|
4
|
+
* Reads and parses the YAML, then walks every job and step to produce:
|
|
5
|
+
* - **workflows** – CycloneDX formulation workflow objects with tasks
|
|
6
|
+
* - **components** – action references (`pkg:github/…`) and run-step processes
|
|
7
|
+
* - **dependencies** – workflow→job and job→action/step edges
|
|
8
|
+
*
|
|
9
|
+
* @param {string} f - Absolute path to a workflow YAML file.
|
|
10
|
+
* @param {Object} options - CLI options
|
|
11
|
+
* @returns {{ workflows: Object[], components: Object[], dependencies: Object[] }}
|
|
12
|
+
*/
|
|
13
|
+
export function parseWorkflowFile(f: string, options: Object): {
|
|
14
|
+
workflows: Object[];
|
|
15
|
+
components: Object[];
|
|
16
|
+
dependencies: Object[];
|
|
17
|
+
};
|
|
18
|
+
export namespace githubActionsParser {
|
|
19
|
+
let id: string;
|
|
20
|
+
let patterns: string[];
|
|
21
|
+
/**
|
|
22
|
+
* @param {string[]} files Matched workflow file paths
|
|
23
|
+
* @param {Object} options CLI options
|
|
24
|
+
* @returns {{ workflows: Object[], components: Object[], services: Object[], properties: Object[], dependencies: Object[] }}
|
|
25
|
+
*/
|
|
26
|
+
function parse(files: string[], options: Object): {
|
|
27
|
+
workflows: Object[];
|
|
28
|
+
components: Object[];
|
|
29
|
+
services: Object[];
|
|
30
|
+
properties: Object[];
|
|
31
|
+
dependencies: Object[];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=githubActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"githubActions.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/ciParsers/githubActions.js"],"names":[],"mappings":"AA0QA;;;;;;;;;;;GAWG;AACH,qCAJW,MAAM,WACN,MAAM,GACJ;IAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAgUjF;;;;IAeC;;;;OAIG;IACH,sBAJW,MAAM,EAAE,WACR,MAAM,GACJ;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,YAAY,EAAE,MAAM,EAAE,CAAA;KAAE,CAoB3H"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export namespace gitlabCiParser {
|
|
2
|
+
let id: string;
|
|
3
|
+
let patterns: string[];
|
|
4
|
+
/**
|
|
5
|
+
* @param {string[]} files Matched CI config file paths
|
|
6
|
+
* @param {Object} options CLI options
|
|
7
|
+
* @returns {{ workflows: Object[], components: Object[], services: Object[], properties: Object[], dependencies: Object[] }}
|
|
8
|
+
*/
|
|
9
|
+
function parse(files: string[], options: Object): {
|
|
10
|
+
workflows: Object[];
|
|
11
|
+
components: Object[];
|
|
12
|
+
services: Object[];
|
|
13
|
+
properties: Object[];
|
|
14
|
+
dependencies: Object[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=gitlabCi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabCi.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/ciParsers/gitlabCi.js"],"names":[],"mappings":";;;IA+LE;;;;OAIG;IACH,sBAJW,MAAM,EAAE,WACR,MAAM,GACJ;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,YAAY,EAAE,MAAM,EAAE,CAAA;KAAE,CAiB3H"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export namespace jenkinsParser {
|
|
2
|
+
let id: string;
|
|
3
|
+
let patterns: string[];
|
|
4
|
+
/**
|
|
5
|
+
* @param {string[]} files Matched Jenkinsfile paths
|
|
6
|
+
* @param {Object} options CLI options
|
|
7
|
+
* @returns {{ workflows: Object[], components: Object[], services: Object[], properties: Object[], dependencies: Object[] }}
|
|
8
|
+
*/
|
|
9
|
+
function parse(files: string[], options: Object): {
|
|
10
|
+
workflows: Object[];
|
|
11
|
+
components: Object[];
|
|
12
|
+
services: Object[];
|
|
13
|
+
properties: Object[];
|
|
14
|
+
dependencies: Object[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=jenkins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jenkins.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/ciParsers/jenkins.js"],"names":[],"mappings":";;;IA2JE;;;;OAIG;IACH,sBAJW,MAAM,EAAE,WACR,MAAM,GACJ;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,YAAY,EAAE,MAAM,EAAE,CAAA;KAAE,CAqB3H"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges two CycloneDX dependency arrays into a single deduplicated list.
|
|
3
|
+
* For each unique ref, the dependsOn and provides sets from both arrays are
|
|
4
|
+
* combined. Self-referential entries pointing to the parent component are
|
|
5
|
+
* removed from all dependsOn and provides lists.
|
|
6
|
+
*
|
|
7
|
+
* @param {Object[]} dependencies First array of dependency objects
|
|
8
|
+
* @param {Object[]} newDependencies Second array of dependency objects to merge
|
|
9
|
+
* @param {Object} parentComponent Parent component whose bom-ref is used to filter self-references
|
|
10
|
+
* @returns {Object[]} Merged and deduplicated array of dependency objects
|
|
11
|
+
*/
|
|
12
|
+
export function mergeDependencies(dependencies: Object[], newDependencies: Object[], parentComponent?: Object): Object[];
|
|
13
|
+
/**
|
|
14
|
+
* Trim duplicate components by retaining all the properties
|
|
15
|
+
*
|
|
16
|
+
* @param {Array} components Components
|
|
17
|
+
*
|
|
18
|
+
* @returns {Array} Filtered components
|
|
19
|
+
*/
|
|
20
|
+
export function trimComponents(components: any[]): any[];
|
|
21
|
+
//# sourceMappingURL=depsUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"depsUtils.d.ts","sourceRoot":"","sources":["../../../lib/helpers/depsUtils.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,gDALW,MAAM,EAAE,mBACR,MAAM,EAAE,oBACR,MAAM,GACJ,MAAM,EAAE,CAuEpB;AAED;;;;;;GAMG;AACH,yDA+GC"}
|
|
@@ -1,12 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export function
|
|
1
|
+
/**
|
|
2
|
+
* Prints the BOM components as a streaming table to the console.
|
|
3
|
+
* Delegates to {@link printOSTable} automatically when the BOM metadata indicates
|
|
4
|
+
* an operating-system or platform component type.
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} bomJson CycloneDX BOM JSON object
|
|
7
|
+
* @param {string[]} [filterTypes] Optional list of component types to include; all types shown when omitted
|
|
8
|
+
* @param {string} [highlight] Optional string to highlight in the output
|
|
9
|
+
* @returns {void}
|
|
10
|
+
*/
|
|
11
|
+
export function printTable(bomJson: Object, filterTypes?: string[], highlight?: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Prints OS package components from the BOM as a formatted streaming table.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} bomJson CycloneDX BOM JSON object
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
export function printOSTable(bomJson: Object): void;
|
|
19
|
+
/**
|
|
20
|
+
* Prints the services listed in the BOM as a formatted table.
|
|
21
|
+
* Includes endpoint URLs, authentication flag, and cross-trust-boundary flag.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} bomJson CycloneDX BOM JSON object
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
export function printServices(bomJson: Object): void;
|
|
27
|
+
/**
|
|
28
|
+
* Prints the formulation components from the BOM as a formatted table.
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} bomJson CycloneDX BOM JSON object
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
33
|
+
export function printFormulation(bomJson: Object): void;
|
|
34
|
+
/**
|
|
35
|
+
* Prints component evidence occurrences (file locations) as a streaming table.
|
|
36
|
+
* Only components that have `evidence.occurrences` are included.
|
|
37
|
+
*
|
|
38
|
+
* @param {Object} bomJson CycloneDX BOM JSON object
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
41
|
+
export function printOccurrences(bomJson: Object): void;
|
|
42
|
+
/**
|
|
43
|
+
* Prints the call stack evidence for each component in the BOM as a formatted table.
|
|
44
|
+
* Only components that have `evidence.callstack.frames` are included.
|
|
45
|
+
*
|
|
46
|
+
* @param {Object} bomJson CycloneDX BOM JSON object
|
|
47
|
+
* @returns {void}
|
|
48
|
+
*/
|
|
49
|
+
export function printCallStack(bomJson: Object): void;
|
|
50
|
+
/**
|
|
51
|
+
* Prints the dependency tree from the BOM as an ASCII tree diagram.
|
|
52
|
+
* Uses the `table` library for small trees and plain console output for larger ones.
|
|
53
|
+
*
|
|
54
|
+
* @param {Object} bomJson CycloneDX BOM JSON object containing a `dependencies` array
|
|
55
|
+
* @param {string} [mode="dependsOn"] Dependency relation to traverse (`"dependsOn"` or `"provides"`)
|
|
56
|
+
* @param {string} [highlight] Optional string to highlight in the tree output
|
|
57
|
+
* @returns {void}
|
|
58
|
+
*/
|
|
59
|
+
export function printDependencyTree(bomJson: Object, mode?: string, highlight?: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Prints a table of reachable components derived from a reachability slices file.
|
|
62
|
+
* Aggregates per-purl reachable-flow counts and sorts them descending.
|
|
63
|
+
*
|
|
64
|
+
* @param {Object} sliceArtefacts Slice artefact paths, must include `reachablesSlicesFile`
|
|
65
|
+
* @returns {void}
|
|
66
|
+
*/
|
|
67
|
+
export function printReachables(sliceArtefacts: Object): void;
|
|
68
|
+
/**
|
|
69
|
+
* Prints a formatted table of CycloneDX vulnerability objects.
|
|
70
|
+
*
|
|
71
|
+
* @param {Object[]} vulnerabilities Array of CycloneDX vulnerability objects
|
|
72
|
+
* @returns {void}
|
|
73
|
+
*/
|
|
74
|
+
export function printVulnerabilities(vulnerabilities: Object[]): void;
|
|
75
|
+
/**
|
|
76
|
+
* Prints an OWASP donation banner when running in a CI environment.
|
|
77
|
+
* The banner is suppressed when `options.noBanner` is set or the repository
|
|
78
|
+
* belongs to the cdxgen project itself.
|
|
79
|
+
*
|
|
80
|
+
* @param {Object} options CLI options
|
|
81
|
+
* @returns {void}
|
|
82
|
+
*/
|
|
83
|
+
export function printSponsorBanner(options: Object): void;
|
|
84
|
+
/**
|
|
85
|
+
* Prints a BOM summary table including generator tool names, component package types,
|
|
86
|
+
* and component namespaces extracted from BOM metadata properties.
|
|
87
|
+
*
|
|
88
|
+
* @param {Object} bomJson CycloneDX BOM JSON object
|
|
89
|
+
* @returns {void}
|
|
90
|
+
*/
|
|
91
|
+
export function printSummary(bomJson: Object): void;
|
|
92
|
+
/**
|
|
93
|
+
* @typedef {{type: string, variable: string, severity: string, message: string, mitigation: string}} EnvAuditFinding
|
|
94
|
+
*/
|
|
95
|
+
/**
|
|
96
|
+
* Runs the pre-generation environment audit and renders the results as formatted
|
|
97
|
+
* tables to the console. Called when the --env-audit CLI flag is set.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} filePath Project path being scanned
|
|
100
|
+
* @param {Object} config Loaded .cdxgenrc / config-file values
|
|
101
|
+
* @param {Object} options Effective CLI options
|
|
102
|
+
* @param {EnvAuditFinding[]} envAuditFindings Audit findings to display
|
|
103
|
+
*/
|
|
104
|
+
export function displaySelfThreatModel(filePath: string, config: Object, options: Object, envAuditFindings: EnvAuditFinding[]): void;
|
|
105
|
+
export type EnvAuditFinding = {
|
|
106
|
+
type: string;
|
|
107
|
+
variable: string;
|
|
108
|
+
severity: string;
|
|
109
|
+
message: string;
|
|
110
|
+
mitigation: string;
|
|
111
|
+
};
|
|
12
112
|
//# sourceMappingURL=display.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../lib/helpers/display.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../lib/helpers/display.js"],"names":[],"mappings":"AAwBA;;;;;;;;;GASG;AACH,oCALW,MAAM,gBACN,MAAM,EAAE,cACR,MAAM,GACJ,IAAI,CAyEhB;AAQD;;;;;GAKG;AACH,sCAHW,MAAM,GACJ,IAAI,CAqBhB;AACD;;;;;;GAMG;AACH,uCAHW,MAAM,GACJ,IAAI,CAwBhB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACJ,IAAI,CAuBhB;AAeD;;;;;;GAMG;AACH,0CAHW,MAAM,GACJ,IAAI,CAuChB;AAED;;;;;;GAMG;AACH,wCAHW,MAAM,GACJ,IAAI,CA4ChB;AACD;;;;;;;;GAQG;AACH,6CALW,MAAM,SACN,MAAM,cACN,MAAM,GACJ,IAAI,CA4ChB;AA4DD;;;;;;GAMG;AACH,gDAHW,MAAM,GACJ,IAAI,CAoChB;AAED;;;;;GAKG;AACH,sDAHW,MAAM,EAAE,GACN,IAAI,CA4BhB;AAED;;;;;;;GAOG;AACH,4CAHW,MAAM,GACJ,IAAI,CAsBhB;AAED;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,IAAI,CAkDhB;AAED;;GAEG;AAEH;;;;;;;;GAQG;AACH,iDALW,MAAM,UACN,MAAM,WACN,MAAM,oBACN,eAAe,EAAE,QAmU3B;8BA7UY;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC"}
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @returns Output from git config or undefined
|
|
7
7
|
*/
|
|
8
|
-
export function getGitConfig(configKey: string, dir: string): string;
|
|
8
|
+
export function getGitConfig(configKey: string, dir: string): string | undefined;
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves the git origin url
|
|
11
11
|
* @param {string} dir repo directory
|
|
12
12
|
*
|
|
13
13
|
* @returns Output from git config or undefined
|
|
14
14
|
*/
|
|
15
|
-
export function getOriginUrl(dir: string): string;
|
|
15
|
+
export function getOriginUrl(dir: string): string | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* Retrieves the git branch name
|
|
18
18
|
* @param {string} configKey Git config key
|
|
@@ -20,7 +20,7 @@ export function getOriginUrl(dir: string): string;
|
|
|
20
20
|
*
|
|
21
21
|
* @returns Output from git config or undefined
|
|
22
22
|
*/
|
|
23
|
-
export function getBranch(_configKey: any, dir: string): string;
|
|
23
|
+
export function getBranch(_configKey: any, dir: string): string | undefined;
|
|
24
24
|
/**
|
|
25
25
|
* Retrieves the tree and parent hash for a git repo
|
|
26
26
|
* @param {string} dir repo directory
|
|
@@ -43,7 +43,7 @@ export function listFiles(dir: string): any[];
|
|
|
43
43
|
*
|
|
44
44
|
* @returns Output from the git command
|
|
45
45
|
*/
|
|
46
|
-
export function execGitCommand(dir: string, args: any[]): string;
|
|
46
|
+
export function execGitCommand(dir: string, args: any[]): string | undefined;
|
|
47
47
|
/**
|
|
48
48
|
* Collect Java version and installed modules
|
|
49
49
|
*
|
|
@@ -155,7 +155,7 @@ export function collectRubyInfo(dir: string): {
|
|
|
155
155
|
* @param {Array} args Command arguments
|
|
156
156
|
* @returns Object containing swift details
|
|
157
157
|
*/
|
|
158
|
-
export function runSwiftCommand(dir: string, args: any[]): string;
|
|
158
|
+
export function runSwiftCommand(dir: string, args: any[]): string | undefined;
|
|
159
159
|
export function collectEnvInfo(dir: any): {
|
|
160
160
|
type: string;
|
|
161
161
|
name: string;
|
|
@@ -214,7 +214,15 @@ export function getOrInstallNvmTool(toolVersion: string): string;
|
|
|
214
214
|
* @returns {Boolean} true if rbenv is available. false otherwise.
|
|
215
215
|
*/
|
|
216
216
|
export function isRbenvAvailable(): boolean;
|
|
217
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Returns the rbenv binary directory for the given Ruby version.
|
|
219
|
+
* Respects the `RBENV_ROOT` environment variable when set; otherwise falls back
|
|
220
|
+
* to `~/.rbenv/versions/<rubyVersion>/bin`.
|
|
221
|
+
*
|
|
222
|
+
* @param {string} rubyVersion Ruby version string (e.g. `"3.2.2"`)
|
|
223
|
+
* @returns {string} Absolute path to the rbenv bin directory for that version
|
|
224
|
+
*/
|
|
225
|
+
export function rubyVersionDir(rubyVersion: string): string;
|
|
218
226
|
/**
|
|
219
227
|
* Perform bundle install using Ruby container images. Not working cleanly yet.
|
|
220
228
|
*
|
|
@@ -230,7 +238,10 @@ export function bundleInstallWithDocker(rubyVersion: any, cdxgenGemHome: any, fi
|
|
|
230
238
|
* @param filePath File path
|
|
231
239
|
*/
|
|
232
240
|
export function installRubyVersion(rubyVersion: any, filePath: any): {
|
|
233
|
-
fullToolBinDir:
|
|
241
|
+
fullToolBinDir: undefined;
|
|
242
|
+
status: boolean;
|
|
243
|
+
} | {
|
|
244
|
+
fullToolBinDir: string;
|
|
234
245
|
status: boolean;
|
|
235
246
|
};
|
|
236
247
|
/**
|
|
@@ -261,5 +272,6 @@ export namespace SDKMAN_JAVA_TOOL_ALIASES {
|
|
|
261
272
|
let java23: any;
|
|
262
273
|
let java24: any;
|
|
263
274
|
let java25: any;
|
|
275
|
+
let java26: any;
|
|
264
276
|
}
|
|
265
277
|
//# sourceMappingURL=envcontext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envcontext.d.ts","sourceRoot":"","sources":["../../../lib/helpers/envcontext.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"envcontext.d.ts","sourceRoot":"","sources":["../../../lib/helpers/envcontext.js"],"names":[],"mappings":"AA0CA;;;;;;GAMG;AACH,wCALW,MAAM,OACN,MAAM,sBAMhB;AAED;;;;;GAKG;AACH,kCAJW,MAAM,sBAMhB;AAED;;;;;;GAMG;AACH,gDAJW,MAAM,sBAMhB;AAED;;;;;GAKG;AACH,mCAJW,MAAM,MAsBhB;AAED;;;;;GAKG;AACH,+BAJW,MAAM,SAgChB;AAED;;;;;;;GAOG;AACH,oCALW,MAAM,mCAOhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;;;;;;cAsBhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;;cAgBhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;;cAwBhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM,GACJ,MAAM,CAelB;AAED;;;;;GAKG;AACH,oCAHW,MAAM;;;;;cAehB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;;cAehB;AAED;;;;;GAKG;AACH,mCAHW,MAAM;;;;cAahB;AAED;;;;;GAKG;AACH,sCAHW,MAAM;;;;cAahB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;cAahB;AAED;;;;;;GAMG;AACH,8EAEC;AAED;;;;;;;;;IAmCC;AA2CD;;GAEG;AACH,6CAeC;AAED;;GAEG;AACH,0CASC;AAED;;;;;;;GAOG;AACH,mFAqBC;AAED;;;;;;;GAOG;AACH,+EA+FC;AAED;;;;;;GAMG;AACH,8DAqBC;AAED;;;;;;GAMG;AACH,iEAiCC;AASD;;;;GAIG;AACH,4CAcC;AAED;;;;;;;GAOG;AACH,4CAHW,MAAM,GACJ,MAAM,CAMlB;AAED;;;;;;GAMG;AACH,sGAoCC;AAED;;;;;GAKG;AACH;;;;;;EAqFC;AAED;;;;;GAKG;AACH,mFA2DC;AAED;;;;;;;;;GASG;AACH,+GAFa,OAAO,CA8KnB;AAjjCD,8BAAwD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register an external formulation parser.
|
|
3
|
+
*
|
|
4
|
+
* The parser is appended to the registry and will be invoked by
|
|
5
|
+
* {@link addFormulationSection} on the next call.
|
|
6
|
+
*
|
|
7
|
+
* @param {{ id: string, patterns: string[], parse: Function }} parser
|
|
8
|
+
*/
|
|
9
|
+
export function registerParser(parser: {
|
|
10
|
+
id: string;
|
|
11
|
+
patterns: string[];
|
|
12
|
+
parse: Function;
|
|
13
|
+
}): void;
|
|
14
|
+
/**
|
|
15
|
+
* Return a shallow copy of the currently registered parsers.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Array<{ id: string, patterns: string[], parse: Function }>}
|
|
18
|
+
*/
|
|
19
|
+
export function getParsers(): Array<{
|
|
20
|
+
id: string;
|
|
21
|
+
patterns: string[];
|
|
22
|
+
parse: Function;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Build the formulation section for a CycloneDX BOM.
|
|
26
|
+
*
|
|
27
|
+
* This function is the top-level aggregator: it collects git metadata,
|
|
28
|
+
* invokes every registered CI parser, and merges the results into a single
|
|
29
|
+
* CycloneDX formulation entry.
|
|
30
|
+
*
|
|
31
|
+
* The function falls back to a minimal stub workflow when no CI config files
|
|
32
|
+
* are detected at the given path.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} filePath File path
|
|
35
|
+
* @param {Object} options CLI options; `options.path` is used as the
|
|
36
|
+
* project root for file discovery.
|
|
37
|
+
* @param {Object} [context={}] Optional context object. If it contains a
|
|
38
|
+
* non-empty `formulationList` array those
|
|
39
|
+
* components are merged into the result.
|
|
40
|
+
*
|
|
41
|
+
* @returns {{ formulation: Object[], dependencies: Object[] }}
|
|
42
|
+
* `formulation` – array to be placed at `bomJson.formulation`
|
|
43
|
+
* `dependencies` – dependency objects to be merged into
|
|
44
|
+
* `bomJson.dependencies` via `mergeDependencies`
|
|
45
|
+
*/
|
|
46
|
+
export function addFormulationSection(filePath: string, options: Object, context?: Object): {
|
|
47
|
+
formulation: Object[];
|
|
48
|
+
dependencies: Object[];
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=formulationParsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formulationParsers.d.ts","sourceRoot":"","sources":["../../../lib/helpers/formulationParsers.js"],"names":[],"mappings":"AA2CA;;;;;;;GAOG;AACH,uCAFW;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,WAAU;CAAE,QAoB7D;AAED;;;;GAIG;AACH,8BAFa,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,WAAU;CAAE,CAAC,CAItE;AAgDD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,gDAZW,MAAM,WACN,MAAM,YAEN,MAAM,GAIJ;IAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CA+M7D"}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Logs a thought message to the think logger if THINK_MODE is enabled.
|
|
3
|
+
* Automatically appends a period to the message if it lacks terminal punctuation.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} s The thought message to log
|
|
6
|
+
* @param {Object} [args] Optional additional arguments to log alongside the message
|
|
7
|
+
* @returns {void}
|
|
8
|
+
*/
|
|
9
|
+
export function thoughtLog(s: string, args?: Object): void;
|
|
10
|
+
/**
|
|
11
|
+
* Closes the think log group by emitting the closing `</think>` marker.
|
|
12
|
+
* Has no effect if THINK_MODE is not enabled.
|
|
13
|
+
*
|
|
14
|
+
* @returns {void}
|
|
15
|
+
*/
|
|
2
16
|
export function thoughtEnd(): void;
|
|
3
17
|
/**
|
|
4
18
|
* Log trace messages
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../lib/helpers/logger.js"],"names":[],"mappings":"AA8CA,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../lib/helpers/logger.js"],"names":[],"mappings":"AA8CA;;;;;;;GAOG;AACH,8BAJW,MAAM,SACN,MAAM,GACJ,IAAI,CAehB;AACD;;;;;GAKG;AACH,8BAFa,IAAI,CAOhB;AAUD;;;;;GAKG;AACH,kDAFW,MAAM,QAgChB;AAtHD,6BAG8C;AAe9C,6BAI8C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function writeBinary(bomJson: string | Object, binFile: string): void;
|
|
2
|
-
export function readBinary(binFile: string, asJson?: boolean, specVersion?: number):
|
|
2
|
+
export function readBinary(binFile: string, asJson?: boolean, specVersion?: number): cdx_17.Bom | cdx_16.Bom | import("@bufbuild/protobuf").JsonValue | undefined;
|
|
3
|
+
import { cdx_17 } from "@appthreat/cdx-proto";
|
|
3
4
|
import { cdx_16 } from "@appthreat/cdx-proto";
|
|
4
|
-
import { cdx_15 } from "@appthreat/cdx-proto";
|
|
5
5
|
//# sourceMappingURL=protobom.d.ts.map
|
|
@@ -5,5 +5,14 @@
|
|
|
5
5
|
* @returns {Object} Structured environment metadata
|
|
6
6
|
*/
|
|
7
7
|
export function getVenvMetadata(env?: Object, explicitPath?: string): Object;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Determines the appropriate Python executable path from a virtual environment.
|
|
10
|
+
* Inspects the virtual environment metadata to detect the Python type (system,
|
|
11
|
+
* conda, pyenv, etc.) and returns the most specific executable found, falling
|
|
12
|
+
* back to the global `PYTHON_CMD` constant when no executable is detected.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} env Path to the Python virtual environment directory
|
|
15
|
+
* @returns {string} Path to the Python executable or the fallback command name
|
|
16
|
+
*/
|
|
17
|
+
export function get_python_command_from_env(env: string): string;
|
|
9
18
|
//# sourceMappingURL=pythonutils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythonutils.d.ts","sourceRoot":"","sources":["../../../lib/helpers/pythonutils.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,sCAJW,MAAM,iBACN,MAAM,GACJ,MAAM,CAyLlB;AAyED,
|
|
1
|
+
{"version":3,"file":"pythonutils.d.ts","sourceRoot":"","sources":["../../../lib/helpers/pythonutils.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,sCAJW,MAAM,iBACN,MAAM,GACJ,MAAM,CAyLlB;AAyED;;;;;;;;GAQG;AACH,iDAHW,MAAM,GACJ,MAAM,CA6BlB"}
|