@cyclonedx/cdxgen 12.1.3 → 12.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/cli/index.js +7 -3
- package/lib/helpers/utils.js +41 -0
- package/package.json +5 -5
- package/types/lib/cli/index.d.ts +39 -39
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +19 -19
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/swiftsem.d.ts +14 -14
- package/types/lib/evinser/swiftsem.d.ts.map +1 -1
- package/types/lib/helpers/cbomutils.d.ts +1 -1
- package/types/lib/helpers/cbomutils.d.ts.map +1 -1
- package/types/lib/helpers/db.d.ts +2 -2
- package/types/lib/helpers/db.d.ts.map +1 -1
- package/types/lib/helpers/display.d.ts +2 -2
- package/types/lib/helpers/display.d.ts.map +1 -1
- package/types/lib/helpers/envcontext.d.ts +14 -14
- package/types/lib/helpers/envcontext.d.ts.map +1 -1
- package/types/lib/helpers/logger.d.ts +1 -1
- package/types/lib/helpers/logger.d.ts.map +1 -1
- package/types/lib/helpers/protobom.d.ts +4 -2
- package/types/lib/helpers/protobom.d.ts.map +1 -1
- package/types/lib/helpers/utils.d.ts +103 -88
- package/types/lib/helpers/utils.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts +2 -2
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +2 -2
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/managers/oci.d.ts +1 -1
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/managers/piptree.d.ts +1 -1
- package/types/lib/managers/piptree.d.ts.map +1 -1
- package/types/lib/parsers/iri.d.ts +6 -6
- package/types/lib/parsers/iri.d.ts.map +1 -1
- package/types/lib/server/server.d.ts +1 -1
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/annotator.d.ts +3 -3
- package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +5 -5
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +6 -6
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/arborist/index.d.ts +4 -3
- package/types/lib/third-party/arborist/lib/arborist/index.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/can-place-dep.d.ts +5 -5
- package/types/lib/third-party/arborist/lib/can-place-dep.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/case-insensitive-map.d.ts +4 -4
- package/types/lib/third-party/arborist/lib/case-insensitive-map.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/diff.d.ts +3 -3
- package/types/lib/third-party/arborist/lib/diff.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/edge.d.ts +2 -2
- package/types/lib/third-party/arborist/lib/edge.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/gather-dep-set.d.ts +1 -1
- package/types/lib/third-party/arborist/lib/gather-dep-set.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/inventory.d.ts +3 -2
- package/types/lib/third-party/arborist/lib/inventory.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/link.d.ts +10 -7
- package/types/lib/third-party/arborist/lib/link.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/node.d.ts +8 -8
- package/types/lib/third-party/arborist/lib/node.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/optional-set.d.ts +1 -1
- package/types/lib/third-party/arborist/lib/optional-set.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/override-set.d.ts +3 -3
- package/types/lib/third-party/arborist/lib/override-set.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/peer-entry-sets.d.ts +1 -1
- package/types/lib/third-party/arborist/lib/peer-entry-sets.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/place-dep.d.ts +3 -3
- package/types/lib/third-party/arborist/lib/place-dep.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/shrinkwrap.d.ts +7 -7
- package/types/lib/third-party/arborist/lib/shrinkwrap.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/version-from-tgz.d.ts +1 -1
- package/types/lib/third-party/arborist/lib/version-from-tgz.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/yarn-lock.d.ts +4 -3
- package/types/lib/third-party/arborist/lib/yarn-lock.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/arborist/load-actual.d.ts +0 -34
- package/types/lib/third-party/arborist/lib/arborist/load-actual.d.ts.map +0 -1
- package/types/lib/third-party/arborist/lib/arborist/load-virtual.d.ts +0 -24
- package/types/lib/third-party/arborist/lib/arborist/load-virtual.d.ts.map +0 -1
- package/types/lib/third-party/arborist/lib/tracker.d.ts +0 -13
- package/types/lib/third-party/arborist/lib/tracker.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ docker run --rm -e CDXGEN_DEBUG_MODE=debug -v /tmp:/tmp -v $(pwd):/app:rw -t ghc
|
|
|
104
104
|
In deno applications, cdxgen could be directly imported without any conversion. Please see the section on [integration as a library](#integration-as-library)
|
|
105
105
|
|
|
106
106
|
```ts
|
|
107
|
-
import { createBom, submitBom } from "npm:@cyclonedx/cdxgen@^
|
|
107
|
+
import { createBom, submitBom } from "npm:@cyclonedx/cdxgen@^12.1.0";
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
## Getting Help
|
package/lib/cli/index.js
CHANGED
|
@@ -2883,7 +2883,7 @@ export async function createNodejsBom(path, options) {
|
|
|
2883
2883
|
// Only perform npm install for smaller projects (< 2 package.json) without the correct number of lock files
|
|
2884
2884
|
if (
|
|
2885
2885
|
(pkgJsonLockFiles?.length === 0 ||
|
|
2886
|
-
pkgJsonLockFiles?.length < pkgJsonFiles?.length) &&
|
|
2886
|
+
pkgJsonLockFiles?.length < pkgJsonFiles?.length - 1) &&
|
|
2887
2887
|
yarnLockFiles?.length === 0 &&
|
|
2888
2888
|
pnpmLockFiles?.length === 0 &&
|
|
2889
2889
|
pkgJsonFiles?.length <= npmInstallCount &&
|
|
@@ -2930,11 +2930,15 @@ export async function createNodejsBom(path, options) {
|
|
|
2930
2930
|
process.env[`${pkgMgr.toUpperCase()}_INSTALL_ARGS`].split(" ");
|
|
2931
2931
|
installArgs = installArgs.concat(addArgs);
|
|
2932
2932
|
}
|
|
2933
|
-
|
|
2933
|
+
// Always invoke the install command with ignore-scripts to guard against version spoofing
|
|
2934
|
+
if (["npm", "pnpm", "yarn"].includes(pkgMgr)) {
|
|
2934
2935
|
if (!installArgs.includes("--ignore-scripts")) {
|
|
2935
2936
|
installArgs.push("--ignore-scripts");
|
|
2936
2937
|
}
|
|
2937
|
-
if (
|
|
2938
|
+
if (pkgMgr === "pnpm") {
|
|
2939
|
+
installArgs.push("--ignore-pnpmfile");
|
|
2940
|
+
}
|
|
2941
|
+
if (pkgMgr === "npm" && !installArgs.includes("--no-audit")) {
|
|
2938
2942
|
installArgs.push("--no-audit");
|
|
2939
2943
|
}
|
|
2940
2944
|
}
|
package/lib/helpers/utils.js
CHANGED
|
@@ -1462,6 +1462,40 @@ export async function parsePkgLock(pkgLockFile, options = {}) {
|
|
|
1462
1462
|
value: "true",
|
|
1463
1463
|
});
|
|
1464
1464
|
}
|
|
1465
|
+
// Detect version spoofing by comparing the version in the lockfile with the version in package.json
|
|
1466
|
+
if (node.path && safeExistsSync(join(node.path, "package.json"))) {
|
|
1467
|
+
try {
|
|
1468
|
+
const diskPkgStr = readFileSync(
|
|
1469
|
+
join(node.path, "package.json"),
|
|
1470
|
+
"utf8",
|
|
1471
|
+
);
|
|
1472
|
+
const diskPkg = JSON.parse(diskPkgStr);
|
|
1473
|
+
if (!diskPkg.name || diskPkg.name !== node.packageName) {
|
|
1474
|
+
console.warn(
|
|
1475
|
+
`\x1b[1;35mWARNING: Package name spoofing detected for ${node.packageName}! Lockfile says ${node.packageName}, but disk says ${diskPkg.name}.\x1b[0m`,
|
|
1476
|
+
);
|
|
1477
|
+
if (diskPkg.name) {
|
|
1478
|
+
pkg.properties.push({
|
|
1479
|
+
name: "cdx:npm:nameMismatchError",
|
|
1480
|
+
value: `${diskPkg.name} used instead of ${node.packageName}`,
|
|
1481
|
+
});
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
if (!diskPkg.version || diskPkg.version !== node.version) {
|
|
1485
|
+
console.warn(
|
|
1486
|
+
`\x1b[1;35mWARNING: Package version spoofing detected for ${node.packageName}! Lockfile says ${node.version}, but disk says ${diskPkg.version}.\x1b[0m`,
|
|
1487
|
+
);
|
|
1488
|
+
if (diskPkg.version) {
|
|
1489
|
+
pkg.properties.push({
|
|
1490
|
+
name: "cdx:npm:versionMismatchError",
|
|
1491
|
+
value: `${diskPkg.version} used instead of ${node.version}`,
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
} catch (_err) {
|
|
1496
|
+
// ignore
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1465
1499
|
if (node?.inBundle) {
|
|
1466
1500
|
pkg.properties.push({
|
|
1467
1501
|
name: "cdx:npm:inBundle",
|
|
@@ -16048,6 +16082,7 @@ export async function addEvidenceForImports(
|
|
|
16048
16082
|
const aliases = group?.length
|
|
16049
16083
|
? [name, `${group}/${name}`, `@${group}/${name}`]
|
|
16050
16084
|
: [name];
|
|
16085
|
+
let isImported = false;
|
|
16051
16086
|
for (const alias of aliases) {
|
|
16052
16087
|
const all_includes = impPkgs.filter(
|
|
16053
16088
|
(find_pkg) =>
|
|
@@ -16096,6 +16131,7 @@ export async function addEvidenceForImports(
|
|
|
16096
16131
|
}
|
|
16097
16132
|
// Identify all the imported modules of a component
|
|
16098
16133
|
if (impPkgs.includes(alias) || all_includes.length) {
|
|
16134
|
+
isImported = true;
|
|
16099
16135
|
let importedModules = new Set();
|
|
16100
16136
|
pkg.scope = "required";
|
|
16101
16137
|
for (const subevidence of all_includes) {
|
|
@@ -16133,6 +16169,11 @@ export async function addEvidenceForImports(
|
|
|
16133
16169
|
}
|
|
16134
16170
|
break;
|
|
16135
16171
|
}
|
|
16172
|
+
if (impPkgs?.length > 0 && !isImported && DEBUG_MODE) {
|
|
16173
|
+
console.debug(
|
|
16174
|
+
`\x1b[1;35mNotice: Package ${pkg.name} has no usage in code. Check if it is needed.\x1b[0m`,
|
|
16175
|
+
);
|
|
16176
|
+
}
|
|
16136
16177
|
// Capture metadata such as description from local node_modules in deep mode
|
|
16137
16178
|
if (deep && !pkg.description && pkg.properties) {
|
|
16138
16179
|
let localNodeModulesPath;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyclonedx/cdxgen",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.4",
|
|
4
4
|
"description": "Creates CycloneDX Software Bill of Materials (SBOM) from source or container image",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sbom",
|
|
@@ -129,21 +129,21 @@
|
|
|
129
129
|
"semver": "7.7.4",
|
|
130
130
|
"ssri": "13.0.1",
|
|
131
131
|
"table": "6.9.0",
|
|
132
|
-
"tar": "7.5.
|
|
132
|
+
"tar": "7.5.13",
|
|
133
133
|
"treeverse": "3.0.0",
|
|
134
134
|
"uuid": "13.0.0",
|
|
135
135
|
"walk-up-path": "4.0.0",
|
|
136
136
|
"xml-js": "1.6.11",
|
|
137
|
-
"yaml": "2.8.
|
|
137
|
+
"yaml": "2.8.3",
|
|
138
138
|
"yargs": "18.0.0",
|
|
139
139
|
"yoctocolors": "2.1.2"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
|
-
"@biomejs/biome": "2.4.
|
|
142
|
+
"@biomejs/biome": "2.4.8",
|
|
143
143
|
"esmock": "2.7.3",
|
|
144
144
|
"poku": "4.1.0",
|
|
145
145
|
"sinon": "21.0.3",
|
|
146
|
-
"typescript": "
|
|
146
|
+
"typescript": "6.0.2"
|
|
147
147
|
},
|
|
148
148
|
"optionalDependencies": {
|
|
149
149
|
"@appthreat/atom": "2.5.2",
|
package/types/lib/cli/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @param {Object} pkg Package object
|
|
8
8
|
* @param {string} ptype Package type
|
|
9
9
|
*/
|
|
10
|
-
export function listComponents(options:
|
|
10
|
+
export function listComponents(options: Object, allImports: Object, pkg: Object, ptype?: string): any[];
|
|
11
11
|
/**
|
|
12
12
|
* Function to create bom string for Java jars
|
|
13
13
|
*
|
|
@@ -16,43 +16,43 @@ export function listComponents(options: any, allImports: any, pkg: any, ptype?:
|
|
|
16
16
|
*
|
|
17
17
|
* @returns {Object} BOM with namespace mapping
|
|
18
18
|
*/
|
|
19
|
-
export function createJarBom(path: string, options:
|
|
19
|
+
export function createJarBom(path: string, options: Object): Object;
|
|
20
20
|
/**
|
|
21
21
|
* Function to create bom string for Android apps using blint
|
|
22
22
|
*
|
|
23
23
|
* @param {string} path to the project
|
|
24
24
|
* @param {Object} options Parse options from the cli
|
|
25
25
|
*/
|
|
26
|
-
export function createAndroidBom(path: string, options:
|
|
26
|
+
export function createAndroidBom(path: string, options: Object): {
|
|
27
27
|
bomJson: any;
|
|
28
28
|
dependencies: any;
|
|
29
29
|
parentComponent: any;
|
|
30
|
-
};
|
|
30
|
+
} | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* Function to create bom string for binaries using blint
|
|
33
33
|
*
|
|
34
34
|
* @param {string} path to the project
|
|
35
35
|
* @param {Object} options Parse options from the cli
|
|
36
36
|
*/
|
|
37
|
-
export function createBinaryBom(path: string, options:
|
|
37
|
+
export function createBinaryBom(path: string, options: Object): {
|
|
38
38
|
bomJson: any;
|
|
39
39
|
dependencies: any;
|
|
40
40
|
parentComponent: any;
|
|
41
|
-
};
|
|
41
|
+
} | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Function to create bom string for Java projects
|
|
44
44
|
*
|
|
45
45
|
* @param {string} path to the project
|
|
46
46
|
* @param {Object} options Parse options from the cli
|
|
47
47
|
*/
|
|
48
|
-
export function createJavaBom(path: string, options:
|
|
48
|
+
export function createJavaBom(path: string, options: Object): Promise<Object>;
|
|
49
49
|
/**
|
|
50
50
|
* Function to create bom string for Node.js projects
|
|
51
51
|
*
|
|
52
52
|
* @param {string} path to the project
|
|
53
53
|
* @param {Object} options Parse options from the cli
|
|
54
54
|
*/
|
|
55
|
-
export function createNodejsBom(path: string, options:
|
|
55
|
+
export function createNodejsBom(path: string, options: Object): Promise<Object>;
|
|
56
56
|
/**
|
|
57
57
|
* Function to create bom string for Projects that use Pixi package manager.
|
|
58
58
|
* createPixiBom is based on createPythonBom.
|
|
@@ -64,161 +64,161 @@ export function createNodejsBom(path: string, options: any): Promise<any>;
|
|
|
64
64
|
* @param {String} path
|
|
65
65
|
* @param {Object} options
|
|
66
66
|
*/
|
|
67
|
-
export function createPixiBom(path: string, options:
|
|
67
|
+
export function createPixiBom(path: string, options: Object): Object | null;
|
|
68
68
|
/**
|
|
69
69
|
* Function to create bom string for Python projects
|
|
70
70
|
*
|
|
71
71
|
* @param {string} path to the project
|
|
72
72
|
* @param {Object} options Parse options from the cli
|
|
73
73
|
*/
|
|
74
|
-
export function createPythonBom(path: string, options:
|
|
74
|
+
export function createPythonBom(path: string, options: Object): Promise<Object>;
|
|
75
75
|
/**
|
|
76
76
|
* Function to create bom string for Go projects
|
|
77
77
|
*
|
|
78
78
|
* @param {string} path to the project
|
|
79
79
|
* @param {Object} options Parse options from the cli
|
|
80
80
|
*/
|
|
81
|
-
export function createGoBom(path: string, options:
|
|
81
|
+
export function createGoBom(path: string, options: Object): Promise<Object | undefined>;
|
|
82
82
|
/**
|
|
83
83
|
* Function to create bom string for Rust projects
|
|
84
84
|
*
|
|
85
85
|
* @param {string} path to the project
|
|
86
86
|
* @param {Object} options Parse options from the cli
|
|
87
87
|
*/
|
|
88
|
-
export function createRustBom(path: string, options:
|
|
88
|
+
export function createRustBom(path: string, options: Object): Promise<Object | undefined>;
|
|
89
89
|
/**
|
|
90
90
|
* Function to create bom string for Dart projects
|
|
91
91
|
*
|
|
92
92
|
* @param {string} path to the project
|
|
93
93
|
* @param {Object} options Parse options from the cli
|
|
94
94
|
*/
|
|
95
|
-
export function createDartBom(path: string, options:
|
|
95
|
+
export function createDartBom(path: string, options: Object): Promise<Object>;
|
|
96
96
|
/**
|
|
97
97
|
* Function to create bom string for cpp projects
|
|
98
98
|
*
|
|
99
99
|
* @param {string} path to the project
|
|
100
100
|
* @param {Object} options Parse options from the cli
|
|
101
101
|
*/
|
|
102
|
-
export function createCppBom(path: string, options:
|
|
102
|
+
export function createCppBom(path: string, options: Object): Object;
|
|
103
103
|
/**
|
|
104
104
|
* Function to create bom string for clojure projects
|
|
105
105
|
*
|
|
106
106
|
* @param {string} path to the project
|
|
107
107
|
* @param {Object} options Parse options from the cli
|
|
108
108
|
*/
|
|
109
|
-
export function createClojureBom(path: string, options:
|
|
109
|
+
export function createClojureBom(path: string, options: Object): Object;
|
|
110
110
|
/**
|
|
111
111
|
* Function to create bom string for Haskell projects
|
|
112
112
|
*
|
|
113
113
|
* @param {string} path to the project
|
|
114
114
|
* @param {Object} options Parse options from the cli
|
|
115
115
|
*/
|
|
116
|
-
export function createHaskellBom(path: string, options:
|
|
116
|
+
export function createHaskellBom(path: string, options: Object): Object;
|
|
117
117
|
/**
|
|
118
118
|
* Function to create bom string for Elixir projects
|
|
119
119
|
*
|
|
120
120
|
* @param {string} path to the project
|
|
121
121
|
* @param {Object} options Parse options from the cli
|
|
122
122
|
*/
|
|
123
|
-
export function createElixirBom(path: string, options:
|
|
123
|
+
export function createElixirBom(path: string, options: Object): Object;
|
|
124
124
|
/**
|
|
125
125
|
* Function to create bom string for GitHub action workflows
|
|
126
126
|
*
|
|
127
127
|
* @param {string} path to the project
|
|
128
128
|
* @param {Object} options Parse options from the cli
|
|
129
129
|
*/
|
|
130
|
-
export function createGitHubBom(path: string, options:
|
|
130
|
+
export function createGitHubBom(path: string, options: Object): Object;
|
|
131
131
|
/**
|
|
132
132
|
* Function to create bom string for cloudbuild yaml
|
|
133
133
|
*
|
|
134
134
|
* @param {string} path to the project
|
|
135
135
|
* @param {Object} options Parse options from the cli
|
|
136
136
|
*/
|
|
137
|
-
export function createCloudBuildBom(path: string, options:
|
|
137
|
+
export function createCloudBuildBom(path: string, options: Object): Object;
|
|
138
138
|
/**
|
|
139
139
|
* Function to create obom string for the current OS using osquery
|
|
140
140
|
*
|
|
141
141
|
* @param {string} _path to the project
|
|
142
142
|
* @param {Object} options Parse options from the cli
|
|
143
143
|
*/
|
|
144
|
-
export function createOSBom(_path: string, options:
|
|
144
|
+
export function createOSBom(_path: string, options: Object): Promise<Object>;
|
|
145
145
|
/**
|
|
146
146
|
* Function to create bom string for Jenkins plugins
|
|
147
147
|
*
|
|
148
148
|
* @param {string} path to the project
|
|
149
149
|
* @param {Object} options Parse options from the cli
|
|
150
150
|
*/
|
|
151
|
-
export function createJenkinsBom(path: string, options:
|
|
151
|
+
export function createJenkinsBom(path: string, options: Object): Promise<Object>;
|
|
152
152
|
/**
|
|
153
153
|
* Function to create bom string for Helm charts
|
|
154
154
|
*
|
|
155
155
|
* @param {string} path to the project
|
|
156
156
|
* @param {Object} options Parse options from the cli
|
|
157
157
|
*/
|
|
158
|
-
export function createHelmBom(path: string, options:
|
|
158
|
+
export function createHelmBom(path: string, options: Object): Object;
|
|
159
159
|
/**
|
|
160
160
|
* Function to create bom string for swift projects
|
|
161
161
|
*
|
|
162
162
|
* @param {string} path to the project
|
|
163
163
|
* @param {Object} options Parse options from the cli
|
|
164
164
|
*/
|
|
165
|
-
export function createSwiftBom(path: string, options:
|
|
165
|
+
export function createSwiftBom(path: string, options: Object): Promise<Object>;
|
|
166
166
|
/**
|
|
167
167
|
* Function to create bom string for cocoa projects
|
|
168
168
|
*
|
|
169
169
|
* @param {string} path to the project
|
|
170
170
|
* @param {Object} options Parse options from the cli
|
|
171
171
|
*/
|
|
172
|
-
export function createCocoaBom(path: string, options:
|
|
172
|
+
export function createCocoaBom(path: string, options: Object): Promise<Object | undefined>;
|
|
173
173
|
/**
|
|
174
174
|
* Function to create bom string for Nix flakes
|
|
175
175
|
*
|
|
176
176
|
* @param {string} path to the project
|
|
177
177
|
* @param {Object} options Parse options from the cli
|
|
178
178
|
*/
|
|
179
|
-
export function createNixBom(path: string, options:
|
|
179
|
+
export function createNixBom(path: string, options: Object): Promise<Object>;
|
|
180
180
|
/**
|
|
181
181
|
* Function to create bom string for caxa SEA binaries
|
|
182
182
|
*
|
|
183
183
|
* @param {string} path to the project
|
|
184
184
|
* @param {Object} options Parse options from the cli
|
|
185
185
|
*/
|
|
186
|
-
export function createCaxaBom(path: string, options:
|
|
186
|
+
export function createCaxaBom(path: string, options: Object): Promise<Object>;
|
|
187
187
|
/**
|
|
188
188
|
* Function to create bom string for docker compose
|
|
189
189
|
*
|
|
190
190
|
* @param {string} path to the project
|
|
191
191
|
* @param {Object} options Parse options from the cli
|
|
192
192
|
*/
|
|
193
|
-
export function createContainerSpecLikeBom(path: string, options:
|
|
193
|
+
export function createContainerSpecLikeBom(path: string, options: Object): any;
|
|
194
194
|
/**
|
|
195
195
|
* Function to create bom string for php projects
|
|
196
196
|
*
|
|
197
197
|
* @param {string} path to the project
|
|
198
198
|
* @param {Object} options Parse options from the cli
|
|
199
199
|
*/
|
|
200
|
-
export function createPHPBom(path: string, options:
|
|
200
|
+
export function createPHPBom(path: string, options: Object): Object;
|
|
201
201
|
/**
|
|
202
202
|
* Function to create bom string for ruby projects
|
|
203
203
|
*
|
|
204
204
|
* @param {string} path to the project
|
|
205
205
|
* @param {Object} options Parse options from the cli
|
|
206
206
|
*/
|
|
207
|
-
export function createRubyBom(path: string, options:
|
|
207
|
+
export function createRubyBom(path: string, options: Object): Promise<Object>;
|
|
208
208
|
/**
|
|
209
209
|
* Function to create bom string for csharp projects
|
|
210
210
|
*
|
|
211
211
|
* @param {string} path to the project
|
|
212
212
|
* @param {Object} options Parse options from the cli
|
|
213
213
|
*/
|
|
214
|
-
export function createCsharpBom(path: string, options:
|
|
214
|
+
export function createCsharpBom(path: string, options: Object): Promise<Object | undefined>;
|
|
215
215
|
/**
|
|
216
216
|
* Function to create bom object for cryptographic certificate files
|
|
217
217
|
*
|
|
218
218
|
* @param {string} path to the project
|
|
219
219
|
* @param {Object} options Parse options from the cli
|
|
220
220
|
*/
|
|
221
|
-
export function createCryptoCertsBom(path: string, options:
|
|
221
|
+
export function createCryptoCertsBom(path: string, options: Object): Promise<{
|
|
222
222
|
bomJson: {
|
|
223
223
|
components: {
|
|
224
224
|
name: any;
|
|
@@ -241,11 +241,11 @@ export function createCryptoCertsBom(path: string, options: any): Promise<{
|
|
|
241
241
|
}>;
|
|
242
242
|
export function mergeDependencies(dependencies: any, newDependencies: any, parentComponent?: {}): ({
|
|
243
243
|
ref: string;
|
|
244
|
-
dependsOn: any;
|
|
245
|
-
provides: any;
|
|
244
|
+
dependsOn: any[];
|
|
245
|
+
provides: any[];
|
|
246
246
|
} | {
|
|
247
247
|
ref: string;
|
|
248
|
-
dependsOn: any;
|
|
248
|
+
dependsOn: any[];
|
|
249
249
|
provides?: undefined;
|
|
250
250
|
})[];
|
|
251
251
|
/**
|
|
@@ -266,28 +266,28 @@ export function trimComponents(components: any[]): any[];
|
|
|
266
266
|
*
|
|
267
267
|
* @returns {Object} Object including BOM Json
|
|
268
268
|
*/
|
|
269
|
-
export function dedupeBom(options:
|
|
269
|
+
export function dedupeBom(options: Object, components: any[], parentComponent: Object, dependencies: any[]): Object;
|
|
270
270
|
/**
|
|
271
271
|
* Function to create bom string for all languages
|
|
272
272
|
*
|
|
273
273
|
* @param {string[]} pathList list of to the project
|
|
274
274
|
* @param {Object} options Parse options from the cli
|
|
275
275
|
*/
|
|
276
|
-
export function createMultiXBom(pathList: string[], options:
|
|
276
|
+
export function createMultiXBom(pathList: string[], options: Object): Promise<Object>;
|
|
277
277
|
/**
|
|
278
278
|
* Function to create bom string for various languages
|
|
279
279
|
*
|
|
280
280
|
* @param {string} path to the project
|
|
281
281
|
* @param {Object} options Parse options from the cli
|
|
282
282
|
*/
|
|
283
|
-
export function createXBom(path: string, options:
|
|
283
|
+
export function createXBom(path: string, options: Object): Promise<any>;
|
|
284
284
|
/**
|
|
285
285
|
* Function to create bom string for various languages
|
|
286
286
|
*
|
|
287
287
|
* @param {string} path to the project
|
|
288
288
|
* @param {Object} options Parse options from the cli
|
|
289
289
|
*/
|
|
290
|
-
export function createBom(path: string, options:
|
|
290
|
+
export function createBom(path: string, options: Object): any;
|
|
291
291
|
/**
|
|
292
292
|
* Method to submit the generated bom to dependency-track or cyclonedx server
|
|
293
293
|
*
|
|
@@ -296,7 +296,7 @@ export function createBom(path: string, options: any): any;
|
|
|
296
296
|
* @return {Promise<{ token: string } | undefined>} a promise with a token (if request was successful) or undefined (in case of invalid arguments)
|
|
297
297
|
* @throws {Error} if the request fails
|
|
298
298
|
*/
|
|
299
|
-
export function submitBom(args:
|
|
299
|
+
export function submitBom(args: Object, bomContents: Object): Promise<{
|
|
300
300
|
token: string;
|
|
301
301
|
} | undefined>;
|
|
302
302
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AAg+BA;;;;;;;;GAQG;AACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AAg+BA;;;;;;;;GAQG;AACH,wCALW,MAAM,cACN,MAAM,OACN,MAAM,UACN,MAAM,SAchB;AAqYD;;;;;;;GAOG;AACH,mCALW,MAAM,WACN,MAAM,GAEJ,MAAM,CA0ElB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,WACN,MAAM;;;;cAIhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,WACN,MAAM;;;;cAiBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,WACN,MAAM,mBAytChB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,WACN,MAAM,mBAk2BhB;AAED;;;;;;;;;;GAUG;AACH,qDAFW,MAAM,iBAwEhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,WACN,MAAM,mBAyehB;AAED;;;;;GAKG;AACH,kCAHW,MAAM,WACN,MAAM,+BAoahB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,WACN,MAAM,+BAqIhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,WACN,MAAM,mBAiEhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,WACN,MAAM,UA6MhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,WACN,MAAM,UA+GhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,WACN,MAAM,UA0BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,WACN,MAAM,UA0BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,WACN,MAAM,UAyBhB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,WACN,MAAM,UAsBhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,WACN,MAAM,mBAoDhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,WACN,MAAM,mBA2ChB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,WACN,MAAM,UA0BhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM,WACN,MAAM,mBA0IhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM,WACN,MAAM,+BAoJhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,WACN,MAAM,mBAoHhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,WACN,MAAM,mBA6ChB;AAED;;;;;GAKG;AACH,iDAHW,MAAM,WACN,MAAM,OAkUhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,WACN,MAAM,UA0JhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,WACN,MAAM,mBAuPhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,WACN,MAAM,+BAkbhB;AAED;;;;;GAKG;AACH,2CAHW,MAAM,WACN,MAAM;;;;;;;;;;;;;;;;;;;;GAmChB;AAED;;;;;;;;KA+DC;AAED;;;;;;GAMG;AACH,yDA+GC;AAED;;;;;;;;;GASG;AACH,mCAPW,MAAM,sCAEN,MAAM,wBAGJ,MAAM,CAyClB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,EAAE,WACR,MAAM,mBAuyBhB;AAED;;;;;GAKG;AACH,iCAHW,MAAM,WACN,MAAM,gBAmVhB;AAED;;;;;GAKG;AACH,gCAHW,MAAM,WACN,MAAM,OAgRhB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,eACN,MAAM,GACL,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,CA0IjD"}
|
|
@@ -3,33 +3,33 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {Object} options Command line options
|
|
5
5
|
*/
|
|
6
|
-
export function prepareDB(options:
|
|
6
|
+
export function prepareDB(options: Object): Promise<{
|
|
7
7
|
sequelize: any;
|
|
8
8
|
Namespaces: {
|
|
9
9
|
db: any;
|
|
10
10
|
tableName: any;
|
|
11
11
|
init(): Promise<any>;
|
|
12
12
|
findByPk(purl: any): Promise<any>;
|
|
13
|
-
findOrCreate(options:
|
|
14
|
-
findAll(options:
|
|
13
|
+
findOrCreate(options: Object): Promise<any>;
|
|
14
|
+
findAll(options: Object): Promise<any>;
|
|
15
15
|
};
|
|
16
16
|
Usages: {
|
|
17
17
|
db: any;
|
|
18
18
|
tableName: any;
|
|
19
19
|
init(): Promise<any>;
|
|
20
20
|
findByPk(purl: any): Promise<any>;
|
|
21
|
-
findOrCreate(options:
|
|
22
|
-
findAll(options:
|
|
21
|
+
findOrCreate(options: Object): Promise<any>;
|
|
22
|
+
findAll(options: Object): Promise<any>;
|
|
23
23
|
};
|
|
24
24
|
DataFlows: {
|
|
25
25
|
db: any;
|
|
26
26
|
tableName: any;
|
|
27
27
|
init(): Promise<any>;
|
|
28
28
|
findByPk(purl: any): Promise<any>;
|
|
29
|
-
findOrCreate(options:
|
|
30
|
-
findAll(options:
|
|
29
|
+
findOrCreate(options: Object): Promise<any>;
|
|
30
|
+
findAll(options: Object): Promise<any>;
|
|
31
31
|
};
|
|
32
|
-
}>;
|
|
32
|
+
} | undefined>;
|
|
33
33
|
export function catalogMavenDeps(dirPath: any, purlsJars: any, Namespaces: any, options?: {}): Promise<void>;
|
|
34
34
|
export function catalogGradleDeps(dirPath: any, purlsJars: any, Namespaces: any): Promise<void>;
|
|
35
35
|
export function createAndStoreSlice(purl: any, purlsJars: any, Usages: any, options?: {}): Promise<any>;
|
|
@@ -52,7 +52,7 @@ export function createSlice(purlOrLanguages: any, filePath: any, sliceType?: str
|
|
|
52
52
|
openapiSpecFile: any;
|
|
53
53
|
semanticsSlicesFile: any;
|
|
54
54
|
}>;
|
|
55
|
-
export function purlToLanguage(purl: any, filePath: any): string;
|
|
55
|
+
export function purlToLanguage(purl: any, filePath: any): string | undefined;
|
|
56
56
|
export function initFromSbom(components: any, language: any): {
|
|
57
57
|
purlLocationMap: {};
|
|
58
58
|
purlImportsMap: {};
|
|
@@ -63,7 +63,7 @@ export function initFromSbom(components: any, language: any): {
|
|
|
63
63
|
* @param {Object} dbObjMap DB and model instances
|
|
64
64
|
* @param {Object} options Command line options
|
|
65
65
|
*/
|
|
66
|
-
export function analyzeProject(dbObjMap:
|
|
66
|
+
export function analyzeProject(dbObjMap: Object, options: Object): Promise<{
|
|
67
67
|
atomFile: any;
|
|
68
68
|
usagesSlicesFile: any;
|
|
69
69
|
dataFlowSlicesFile: any;
|
|
@@ -78,7 +78,7 @@ export function analyzeProject(dbObjMap: any, options: any): Promise<{
|
|
|
78
78
|
cryptoGeneratePurls: {};
|
|
79
79
|
openapiSpecFile: any;
|
|
80
80
|
}>;
|
|
81
|
-
export function parseObjectSlices(language: any, usageSlice: any, dbObjMap: any, servicesMap?: {}, purlLocationMap?: {}, purlImportsMap?: {}, openapiSpecFile?:
|
|
81
|
+
export function parseObjectSlices(language: any, usageSlice: any, dbObjMap: any, servicesMap?: {}, purlLocationMap?: {}, purlImportsMap?: {}, openapiSpecFile?: undefined): Promise<{}>;
|
|
82
82
|
/**
|
|
83
83
|
* The implementation of this function is based on the logic proposed in the atom slices specification
|
|
84
84
|
* https://github.com/AppThreat/atom/blob/main/specification/docs/slices.md#use
|
|
@@ -91,7 +91,7 @@ export function parseObjectSlices(language: any, usageSlice: any, dbObjMap: any,
|
|
|
91
91
|
* @param {Object} purlImportsMap Object to track package urls and their import aliases
|
|
92
92
|
* @returns
|
|
93
93
|
*/
|
|
94
|
-
export function parseSliceUsages(language: string, userDefinedTypesMap:
|
|
94
|
+
export function parseSliceUsages(language: string, userDefinedTypesMap: Object, slice: any[], dbObjMap: Object, purlLocationMap: Object, purlImportsMap: Object): Promise<void>;
|
|
95
95
|
/**
|
|
96
96
|
* Method to parse semantic slice data. Currently supported for swift and scala languages.
|
|
97
97
|
*
|
|
@@ -100,7 +100,7 @@ export function parseSliceUsages(language: string, userDefinedTypesMap: any, sli
|
|
|
100
100
|
* @param {Object} semanticsSlice Semantic slice data
|
|
101
101
|
* @returns {Object} Parsed metadata
|
|
102
102
|
*/
|
|
103
|
-
export function parseSemanticSlices(language: string, components: any[], semanticsSlice:
|
|
103
|
+
export function parseSemanticSlices(language: string, components: any[], semanticsSlice: Object): Object;
|
|
104
104
|
export function isFilterableType(language: any, userDefinedTypesMap: any, typeFullName: any): boolean;
|
|
105
105
|
export function detectServicesFromOpenAPI(_language: any, openapiSpecFile: any, servicesMap: any): void;
|
|
106
106
|
/**
|
|
@@ -110,7 +110,7 @@ export function detectServicesFromOpenAPI(_language: any, openapiSpecFile: any,
|
|
|
110
110
|
* @param {Array} slice Usages array for each objectSlice
|
|
111
111
|
* @param {Object} servicesMap Existing service map
|
|
112
112
|
*/
|
|
113
|
-
export function detectServicesFromUsages(language: string, slice: any[], servicesMap?:
|
|
113
|
+
export function detectServicesFromUsages(language: string, slice: any[], servicesMap?: Object): never[] | undefined;
|
|
114
114
|
/**
|
|
115
115
|
* Method to detect services from user defined types in the usage slice
|
|
116
116
|
*
|
|
@@ -118,7 +118,7 @@ export function detectServicesFromUsages(language: string, slice: any[], service
|
|
|
118
118
|
* @param {Array} userDefinedTypes User defined types
|
|
119
119
|
* @param {Object} servicesMap Existing service map
|
|
120
120
|
*/
|
|
121
|
-
export function detectServicesFromUDT(language: string, userDefinedTypes: any[], servicesMap:
|
|
121
|
+
export function detectServicesFromUDT(language: string, userDefinedTypes: any[], servicesMap: Object): void;
|
|
122
122
|
export function constructServiceName(_language: any, slice: any): string;
|
|
123
123
|
export function extractEndpoints(language: any, code: any): any;
|
|
124
124
|
/**
|
|
@@ -128,7 +128,7 @@ export function extractEndpoints(language: any, code: any): any;
|
|
|
128
128
|
* @param {Object} options Command line options
|
|
129
129
|
* @returns
|
|
130
130
|
*/
|
|
131
|
-
export function createEvinseFile(sliceArtefacts:
|
|
131
|
+
export function createEvinseFile(sliceArtefacts: Object, options: Object): any;
|
|
132
132
|
/**
|
|
133
133
|
* Method to convert dataflow slice into usable callstack frames
|
|
134
134
|
* Implemented based on the logic proposed here - https://github.com/AppThreat/atom/blob/main/specification/docs/slices.md#data-flow-slice
|
|
@@ -140,7 +140,7 @@ export function createEvinseFile(sliceArtefacts: any, options: any): any;
|
|
|
140
140
|
* @param {Object} _purlLocationMap Object to track locations where purls are used
|
|
141
141
|
* @param {Object} purlImportsMap Object to track package urls and their import aliases
|
|
142
142
|
*/
|
|
143
|
-
export function collectDataFlowFrames(language: string, userDefinedTypesMap:
|
|
143
|
+
export function collectDataFlowFrames(language: string, userDefinedTypesMap: Object, dataFlowSlice: Object, dbObjMap: Object, _purlLocationMap: Object, purlImportsMap: Object): Promise<{}>;
|
|
144
144
|
/**
|
|
145
145
|
* Method to convert reachable slice into usable callstack frames and crypto components
|
|
146
146
|
*
|
|
@@ -149,7 +149,7 @@ export function collectDataFlowFrames(language: string, userDefinedTypesMap: any
|
|
|
149
149
|
* @param {string} _language Application language
|
|
150
150
|
* @param {Object} reachablesSlice Reachables slice object from atom
|
|
151
151
|
*/
|
|
152
|
-
export function collectReachableFrames(_language: string, reachablesSlice:
|
|
152
|
+
export function collectReachableFrames(_language: string, reachablesSlice: Object): {
|
|
153
153
|
dataFlowFrames: {};
|
|
154
154
|
cryptoComponents: {
|
|
155
155
|
type: string;
|
|
@@ -177,5 +177,5 @@ export function framePicker(dfFrames: any[]): any;
|
|
|
177
177
|
* @returns Simplified type string
|
|
178
178
|
*/
|
|
179
179
|
export function simplifyType(typeFullName: string): string;
|
|
180
|
-
export function getClassTypeFromSignature(language: any, typeFullName: any): string;
|
|
180
|
+
export function getClassTypeFromSignature(language: any, typeFullName: any): string | undefined;
|
|
181
181
|
//# sourceMappingURL=evinser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evinser.d.ts","sourceRoot":"","sources":["../../../lib/evinser/evinser.js"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"evinser.d.ts","sourceRoot":"","sources":["../../../lib/evinser/evinser.js"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH,mCAFW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;eAmEhB;AAED,6GAiDC;AAED,gGAkCC;AAED,wGAqBC;AAED;;;;;;;;;;;;;;;;;;GAuKC;AAED,6EAuBC;AAED;;;EA8BC;AAcD;;;;;GAKG;AACH,yCAHW,MAAM,WACN,MAAM;;;;;;;;;;;;;;GA4KhB;AAED,wLA+DC;AAED;;;;;;;;;;;GAWG;AACH,2CARW,MAAM,uBACN,MAAM,0BAEN,MAAM,mBACN,MAAM,kBACN,MAAM,iBAqOhB;AAED;;;;;;;GAOG;AACH,yFAHW,MAAM,GACJ,MAAM,CAiGlB;AAyBD,sGAyEC;AAED,wGAmCC;AAED;;;;;;GAMG;AACH,mDAJW,MAAM,8BAEN,MAAM,uBA6DhB;AAED;;;;;;GAMG;AACH,gDAJW,MAAM,wCAEN,MAAM,QAkDhB;AAED,yEAWC;AAED,gEAsFC;AAED;;;;;;GAMG;AACH,iDAJW,MAAM,WACN,MAAM,OA2KhB;AAED;;;;;;;;;;GAUG;AACH,gDAPW,MAAM,uBACN,MAAM,iBACN,MAAM,YACN,MAAM,oBACN,MAAM,kBACN,MAAM,eAoHhB;AAED;;;;;;;GAOG;AACH,kDAHW,MAAM,mBACN,MAAM;;;;;;;;;;;;;EA4FhB;AAED;;;;;GAKG;AACH,kDAaC;AAED;;;;;GAKG;AACH,2CAHW,MAAM,UAKhB;AAED,gGAiDC"}
|