@coana-tech/cli 14.12.126 → 14.12.128
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/cli.mjs +22 -37
- package/package.json +1 -1
- package/reachability-analyzers-cli.mjs +67 -55
- package/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
- package/repos/coana-tech/javap-service/javap-service.jar +0 -0
package/cli.mjs
CHANGED
|
@@ -73599,9 +73599,9 @@ var require_lockfile = __commonJS({
|
|
|
73599
73599
|
/* 85 */
|
|
73600
73600
|
/***/
|
|
73601
73601
|
function(module3, exports3) {
|
|
73602
|
-
module3.exports = function(
|
|
73602
|
+
module3.exports = function(exec4) {
|
|
73603
73603
|
try {
|
|
73604
|
-
return !!
|
|
73604
|
+
return !!exec4();
|
|
73605
73605
|
} catch (e) {
|
|
73606
73606
|
return true;
|
|
73607
73607
|
}
|
|
@@ -73733,9 +73733,9 @@ var require_lockfile = __commonJS({
|
|
|
73733
73733
|
/* 104 */
|
|
73734
73734
|
/***/
|
|
73735
73735
|
function(module3, exports3) {
|
|
73736
|
-
module3.exports = function(
|
|
73736
|
+
module3.exports = function(exec4) {
|
|
73737
73737
|
try {
|
|
73738
|
-
return { e: false, v:
|
|
73738
|
+
return { e: false, v: exec4() };
|
|
73739
73739
|
} catch (e) {
|
|
73740
73740
|
return { e: true, v: e };
|
|
73741
73741
|
}
|
|
@@ -75208,7 +75208,7 @@ ${indent3}`);
|
|
|
75208
75208
|
});
|
|
75209
75209
|
} catch (e) {
|
|
75210
75210
|
}
|
|
75211
|
-
module3.exports = function(
|
|
75211
|
+
module3.exports = function(exec4, skipClosing) {
|
|
75212
75212
|
if (!skipClosing && !SAFE_CLOSING) return false;
|
|
75213
75213
|
var safe = false;
|
|
75214
75214
|
try {
|
|
@@ -75220,7 +75220,7 @@ ${indent3}`);
|
|
|
75220
75220
|
arr[ITERATOR] = function() {
|
|
75221
75221
|
return iter;
|
|
75222
75222
|
};
|
|
75223
|
-
|
|
75223
|
+
exec4(arr);
|
|
75224
75224
|
} catch (e) {
|
|
75225
75225
|
}
|
|
75226
75226
|
return safe;
|
|
@@ -75543,8 +75543,8 @@ ${indent3}`);
|
|
|
75543
75543
|
var USE_NATIVE = !!function() {
|
|
75544
75544
|
try {
|
|
75545
75545
|
var promise = $Promise.resolve(1);
|
|
75546
|
-
var FakePromise = (promise.constructor = {})[__webpack_require__(13)("species")] = function(
|
|
75547
|
-
|
|
75546
|
+
var FakePromise = (promise.constructor = {})[__webpack_require__(13)("species")] = function(exec4) {
|
|
75547
|
+
exec4(empty2, empty2);
|
|
75548
75548
|
};
|
|
75549
75549
|
return (isNode2 || typeof PromiseRejectionEvent == "function") && promise.then(empty2) instanceof FakePromise && v8.indexOf("6.6") !== 0 && userAgent.indexOf("Chrome/66") === -1;
|
|
75550
75550
|
} catch (e) {
|
|
@@ -206687,13 +206687,6 @@ async function execNeverFail(cmd, dir, options) {
|
|
|
206687
206687
|
childProcess.stdin?.end();
|
|
206688
206688
|
});
|
|
206689
206689
|
}
|
|
206690
|
-
async function exec(cmd, dir, options) {
|
|
206691
|
-
const { error, stdout, stderr } = await execNeverFail(cmd, dir, options);
|
|
206692
|
-
if (!error) return { stdout, stderr };
|
|
206693
|
-
error.stdout = stdout;
|
|
206694
|
-
error.stderr = stderr;
|
|
206695
|
-
throw error;
|
|
206696
|
-
}
|
|
206697
206690
|
async function runCommandResolveStdOut(cmd, dir, options) {
|
|
206698
206691
|
const { stdout, error } = await execNeverFail(cmd, dir, options);
|
|
206699
206692
|
if (error) throw error;
|
|
@@ -213312,17 +213305,6 @@ async function execNeverFail2(cmd, dir, options) {
|
|
|
213312
213305
|
logger.debug(`Command ${formatCmd(cmd, dir)} finished ${result.error ? "with error" : "successfully"}`);
|
|
213313
213306
|
return result;
|
|
213314
213307
|
}
|
|
213315
|
-
async function exec2(cmd, dir, options) {
|
|
213316
|
-
logger.debug(`Running command: ${formatCmd(cmd, dir)}`);
|
|
213317
|
-
try {
|
|
213318
|
-
const result = await exec(cmd, dir, options);
|
|
213319
|
-
logger.debug(`Command ${formatCmd(cmd, dir)} finished successfully`);
|
|
213320
|
-
return result;
|
|
213321
|
-
} catch (error) {
|
|
213322
|
-
logger.debug(`Command ${formatCmd(cmd, dir)} finished with error`);
|
|
213323
|
-
throw error;
|
|
213324
|
-
}
|
|
213325
|
-
}
|
|
213326
213308
|
async function runCommandResolveStdOut2(cmd, dir, options) {
|
|
213327
213309
|
logger.debug(`Running command: ${formatCmd(cmd, dir)}`);
|
|
213328
213310
|
try {
|
|
@@ -213469,13 +213451,13 @@ var Diff = class {
|
|
|
213469
213451
|
editLength++;
|
|
213470
213452
|
};
|
|
213471
213453
|
if (callback) {
|
|
213472
|
-
(function
|
|
213454
|
+
(function exec4() {
|
|
213473
213455
|
setTimeout(function() {
|
|
213474
213456
|
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
|
213475
213457
|
return callback(void 0);
|
|
213476
213458
|
}
|
|
213477
213459
|
if (!execEditLength()) {
|
|
213478
|
-
|
|
213460
|
+
exec4();
|
|
213479
213461
|
}
|
|
213480
213462
|
}, 0);
|
|
213481
213463
|
})();
|
|
@@ -225731,8 +225713,8 @@ var getNpmBin = once(async () => {
|
|
|
225731
225713
|
async function actuallyRunInstall(specificPackagesArgs = [], dir) {
|
|
225732
225714
|
const installationCommand = cmdt2`${await getNpmBin()} install -f --ignore-scripts --no-fund --no-audit --no-progress ${specificPackagesArgs}`;
|
|
225733
225715
|
logger.debug(`Running installation command: "${installationCommand}" in ${dir}`);
|
|
225734
|
-
const result = execAndLogOnFailure4(installationCommand, dir);
|
|
225735
|
-
logger.info(`Installation completed.`);
|
|
225716
|
+
const result = await execAndLogOnFailure4(installationCommand, dir);
|
|
225717
|
+
logger.info(`Installation ${result ? "completed" : "failed"}.`);
|
|
225736
225718
|
return result;
|
|
225737
225719
|
}
|
|
225738
225720
|
async function getWorkspacePathsFromPackageJSON(projectFolder, useDotWhenNoWorkspaces = false) {
|
|
@@ -225926,7 +225908,7 @@ var PnpmFixingManager = class extends NpmEcosystemFixingManager {
|
|
|
225926
225908
|
const installationCommand = cmdt`pnpm install --ignore-scripts${await this.getPnpmMajorVersion() >= 9 && specificPackagesCmd.length === 0 ? "--no-frozen-lockfile" : ""} --config.confirmModulesPurge=false ${specificPackagesCmd}`;
|
|
225927
225909
|
const installDir = resolve22(this.rootDir, this.subprojectPath, workspacePath);
|
|
225928
225910
|
logger.info(`Running installation command: "${installationCommand}" in ${installDir}`);
|
|
225929
|
-
await
|
|
225911
|
+
await execAndLogOnFailure2(installationCommand, installDir);
|
|
225930
225912
|
logger.info(`Installation completed.`);
|
|
225931
225913
|
}
|
|
225932
225914
|
async getLockFileYaml() {
|
|
@@ -226026,7 +226008,10 @@ var PnpmFixingManager = class extends NpmEcosystemFixingManager {
|
|
|
226026
226008
|
async finalizeFixes() {
|
|
226027
226009
|
const cmd = cmdt`pnpm install --ignore-scripts --fix-lockfile --config.confirmModulesPurge=false `;
|
|
226028
226010
|
logger.info(`Adjusting lock file changes by running '${cmd}'`);
|
|
226029
|
-
await
|
|
226011
|
+
const result = await execAndLogOnFailure2(cmd, resolve22(this.rootDir, this.subprojectPath));
|
|
226012
|
+
if (!result) {
|
|
226013
|
+
throw new Error(`Failed to install packages`);
|
|
226014
|
+
}
|
|
226030
226015
|
}
|
|
226031
226016
|
};
|
|
226032
226017
|
function getVersionNumber(version4) {
|
|
@@ -236242,7 +236227,7 @@ function getMongoClient() {
|
|
|
236242
236227
|
}
|
|
236243
236228
|
|
|
236244
236229
|
// ../security-auditor/security-auditor-api/src/vulnerability-patterns-helper/get-interesting-urls-for-vulnerability.ts
|
|
236245
|
-
import { exec as
|
|
236230
|
+
import { exec as exec3 } from "child_process";
|
|
236246
236231
|
import { promisify } from "util";
|
|
236247
236232
|
|
|
236248
236233
|
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/options.js
|
|
@@ -249838,7 +249823,7 @@ async function getInterestingURLsForVulnerability(vulnerability, packageMetadata
|
|
|
249838
249823
|
}
|
|
249839
249824
|
async function computeComparisonURLs(scmUrl, vulnAndFixVersionsArr) {
|
|
249840
249825
|
try {
|
|
249841
|
-
const gitTags = (await promisify(
|
|
249826
|
+
const gitTags = (await promisify(exec3)(`git ls-remote ${scmUrl} | grep -F "refs/tags"`)).stdout.split("\n");
|
|
249842
249827
|
logger3.debug("gitTags", gitTags);
|
|
249843
249828
|
logger3.debug("vulnAndFixVersionsArr", vulnAndFixVersionsArr);
|
|
249844
249829
|
const versionToSha = {};
|
|
@@ -249873,7 +249858,7 @@ async function computeInterestingCommitURLs(text3, scmUrl) {
|
|
|
249873
249858
|
const repo = scmUrl.split("/").slice(-2).join("/");
|
|
249874
249859
|
const cmd = `gh search commits ${text3} --repo ${repo}`;
|
|
249875
249860
|
logger3.debug(`Finding issue or PR url for text ${text3}`, cmd);
|
|
249876
|
-
const { stdout } = await promisify(
|
|
249861
|
+
const { stdout } = await promisify(exec3)(cmd, { shell: "/bin/zsh" });
|
|
249877
249862
|
return stdout.split("\n").filter((line) => line).map((line) => {
|
|
249878
249863
|
const [repo2, sha] = line.split(" ");
|
|
249879
249864
|
return `https://www.github.com/${repo2}/commit/${sha}`;
|
|
@@ -249887,7 +249872,7 @@ async function computeInterestingIssueAndPRUrlsWithText(text3, scmUrl) {
|
|
|
249887
249872
|
const repo = scmUrl.split("/").slice(-2).join("/");
|
|
249888
249873
|
const cmd = `gh search issues ${text3} in:title,body,comment --repo ${repo} --include-prs`;
|
|
249889
249874
|
console.log(`Finding issue or PR url for text ${text3}`, cmd);
|
|
249890
|
-
const { stdout } = await promisify(
|
|
249875
|
+
const { stdout } = await promisify(exec3)(cmd, { shell: "/bin/zsh" });
|
|
249891
249876
|
return stdout.split("\n").filter((line) => line).map((line) => {
|
|
249892
249877
|
const [issueOrPr, repo2, id] = line.split(" ");
|
|
249893
249878
|
const issueOrPrUrlPart = issueOrPr === "issue" ? "issues" : "pull";
|
|
@@ -251116,7 +251101,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
|
|
|
251116
251101
|
}
|
|
251117
251102
|
|
|
251118
251103
|
// dist/version.js
|
|
251119
|
-
var version3 = "14.12.
|
|
251104
|
+
var version3 = "14.12.128";
|
|
251120
251105
|
|
|
251121
251106
|
// dist/cli-core.js
|
|
251122
251107
|
var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
|
package/package.json
CHANGED
|
@@ -80232,7 +80232,7 @@ async function sendRegressionsToDashboard(regressions, subprojectPath, workspace
|
|
|
80232
80232
|
);
|
|
80233
80233
|
} catch (e) {
|
|
80234
80234
|
sendWarningToDashboard(
|
|
80235
|
-
"Unable to
|
|
80235
|
+
"Unable to send regressions from experimental runs",
|
|
80236
80236
|
{ subprojectPath, workspacePath, reportId },
|
|
80237
80237
|
void 0,
|
|
80238
80238
|
reportId,
|
|
@@ -95833,7 +95833,7 @@ var DotnetCodeAwareVulnerabilityScanner = class _DotnetCodeAwareVulnerabilitySca
|
|
|
95833
95833
|
const outputFile = resolve10(tmpDir, "output.json");
|
|
95834
95834
|
await writeFile4(inputFile, JSON.stringify(options));
|
|
95835
95835
|
const timeoutMs = Math.max(timeoutInSeconds * 1.5, timeoutInSeconds + 30) * 1e3;
|
|
95836
|
-
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runDotnetDirectDependencyAnalysis -i ${inputFile} -o ${outputFile} --cocoa ${getCocoaPath()} --tree-sitter-c-sharp ${getTreeSitterCSharpPath()}`, void 0, { timeout: timeoutMs });
|
|
95836
|
+
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runDotnetDirectDependencyAnalysis -i ${inputFile} -o ${outputFile} --cocoa ${getCocoaPath()} --tree-sitter-c-sharp ${getTreeSitterCSharpPath()}`, void 0, { timeout: timeoutMs, killSignal: "SIGKILL" });
|
|
95837
95837
|
if (result.error)
|
|
95838
95838
|
return void 0;
|
|
95839
95839
|
const packageIds = JSON.parse(await readFile6(outputFile, "utf-8")).result;
|
|
@@ -95872,7 +95872,7 @@ var DotnetCodeAwareVulnerabilityScanner = class _DotnetCodeAwareVulnerabilitySca
|
|
|
95872
95872
|
const outputFile = resolve10(tmpDir, "output.json");
|
|
95873
95873
|
await writeFile4(inputFile, JSON.stringify(options));
|
|
95874
95874
|
const timeoutMs = Math.max(timeoutInSeconds * 1.5, timeoutInSeconds + 30) * 1e3;
|
|
95875
|
-
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runDotnetReachabilityAnalysis -i ${inputFile} -o ${outputFile} --cocoa ${getCocoaPath()} --tree-sitter-c-sharp ${getTreeSitterCSharpPath()}`, void 0, { timeout: timeoutMs });
|
|
95875
|
+
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runDotnetReachabilityAnalysis -i ${inputFile} -o ${outputFile} --cocoa ${getCocoaPath()} --tree-sitter-c-sharp ${getTreeSitterCSharpPath()}`, void 0, { timeout: timeoutMs, killSignal: "SIGKILL" });
|
|
95876
95876
|
if (result.error)
|
|
95877
95877
|
return { type: "error", message: result.error.message ?? "unknown error" };
|
|
95878
95878
|
const { success, error, analysisDiagnostics: diagnostics, vulnerablePaths, reachablePackageIds } = JSON.parse(await readFile6(outputFile, "utf-8")).result;
|
|
@@ -109809,7 +109809,7 @@ var JavaCodeAwareVulnerabilityScanner = class _JavaCodeAwareVulnerabilityScanner
|
|
|
109809
109809
|
const outputFile = resolve11(tmpDir, "output.json");
|
|
109810
109810
|
await writeFile5(inputFile, JSON.stringify(options));
|
|
109811
109811
|
const timeoutMs = Math.max(timeoutInSeconds * 1.5, timeoutInSeconds + 30) * 1e3;
|
|
109812
|
-
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runJvmDirectDependencyAnalysis -i ${inputFile} -o ${outputFile} --javap-service ${getJavapServicePath()} --tree-sitter-java ${getTreeSitterJavaPath()} --tree-sitter-kotlin ${getTreeSitterKotlinPath()} --tree-sitter-scala ${getTreeSitterScalaPath()}`, void 0, { timeout: timeoutMs });
|
|
109812
|
+
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runJvmDirectDependencyAnalysis -i ${inputFile} -o ${outputFile} --javap-service ${getJavapServicePath()} --tree-sitter-java ${getTreeSitterJavaPath()} --tree-sitter-kotlin ${getTreeSitterKotlinPath()} --tree-sitter-scala ${getTreeSitterScalaPath()}`, void 0, { timeout: timeoutMs, killSignal: "SIGKILL" });
|
|
109813
109813
|
if (result.error)
|
|
109814
109814
|
return void 0;
|
|
109815
109815
|
const packageIds = JSON.parse(await readFile7(outputFile, "utf-8")).result;
|
|
@@ -109848,7 +109848,7 @@ var JavaCodeAwareVulnerabilityScanner = class _JavaCodeAwareVulnerabilityScanner
|
|
|
109848
109848
|
const outputFile = resolve11(tmpDir, "output.json");
|
|
109849
109849
|
await writeFile5(inputFile, JSON.stringify(options));
|
|
109850
109850
|
const timeoutMs = Math.max(timeoutInSeconds * 1.5, timeoutInSeconds + 30) * 1e3;
|
|
109851
|
-
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runJvmReachabilityAnalysis -i ${inputFile} -o ${outputFile} --javap-service ${getJavapServicePath()} --tree-sitter-java ${getTreeSitterJavaPath()} --tree-sitter-kotlin ${getTreeSitterKotlinPath()} --tree-sitter-scala ${getTreeSitterScalaPath()}`, void 0, { timeout: timeoutMs });
|
|
109851
|
+
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runJvmReachabilityAnalysis -i ${inputFile} -o ${outputFile} --javap-service ${getJavapServicePath()} --tree-sitter-java ${getTreeSitterJavaPath()} --tree-sitter-kotlin ${getTreeSitterKotlinPath()} --tree-sitter-scala ${getTreeSitterScalaPath()}`, void 0, { timeout: timeoutMs, killSignal: "SIGKILL" });
|
|
109852
109852
|
if (result.error)
|
|
109853
109853
|
return { type: "error", message: result.error.message ?? "unknown error" };
|
|
109854
109854
|
const { success, error, analysisDiagnostics: diagnostics, vulnerablePaths, reachablePackageIds } = JSON.parse(await readFile7(outputFile, "utf-8")).result;
|
|
@@ -110479,9 +110479,8 @@ async function runJellyAnalysis(mainProjectRoot, projectRoot, jellyOptions, reac
|
|
|
110479
110479
|
void 0,
|
|
110480
110480
|
// If experiment is enabled, fail if Jelly exceeds 1.5x the timeout.
|
|
110481
110481
|
// Otherwise, fail if Jelly exceeds 3x the timeout.
|
|
110482
|
-
//
|
|
110483
|
-
|
|
110484
|
-
{ timeout: timeoutInSeconds * 1e3 * (experiment ? 1.5 : 3) }
|
|
110482
|
+
// Use SIGKILL to ensure termination even if the process is unresponsive (e.g., due to GC pressure).
|
|
110483
|
+
{ timeout: timeoutInSeconds * 1e3 * (experiment ? 1.5 : 3), killSignal: "SIGKILL" }
|
|
110485
110484
|
);
|
|
110486
110485
|
if (reachabilityAnalysisOptions.printLogFile)
|
|
110487
110486
|
logger.info("JS analysis log file:", await readFile8(logFile, "utf-8"));
|
|
@@ -110522,7 +110521,10 @@ async function runJellyPhantomDependencyAnalysis(projectRoot, options) {
|
|
|
110522
110521
|
const jellyCmd = cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} --max-old-space-size=${options.memoryLimitInMB}
|
|
110523
110522
|
${jellyExecutable} --basedir ${projectRoot} --modules-only --ignore-dependencies
|
|
110524
110523
|
--reachable-json ${reachablePackagesFile} ${projectRoot}`;
|
|
110525
|
-
await runCommandResolveStdOut2(jellyCmd, void 0, {
|
|
110524
|
+
await runCommandResolveStdOut2(jellyCmd, void 0, {
|
|
110525
|
+
timeout: options.timeoutSeconds.allVulnRuns * 1e3,
|
|
110526
|
+
killSignal: "SIGKILL"
|
|
110527
|
+
});
|
|
110526
110528
|
return JSON.parse(await readFile8(reachablePackagesFile, "utf-8")).packages;
|
|
110527
110529
|
} finally {
|
|
110528
110530
|
await rm2(tmpFolder, { recursive: true });
|
|
@@ -110539,7 +110541,10 @@ async function runJellyImportReachabilityAnalysis(mainProjectRoot, projectRoot,
|
|
|
110539
110541
|
${getExcludes(mainProjectRoot, projectRoot, options)}
|
|
110540
110542
|
--reachable-json ${reachableModulesFile}
|
|
110541
110543
|
${options.entryPoints ?? projectRoot}`;
|
|
110542
|
-
await runCommandResolveStdOut2(jellyCmd, void 0, {
|
|
110544
|
+
await runCommandResolveStdOut2(jellyCmd, void 0, {
|
|
110545
|
+
timeout: options.timeoutSeconds.allVulnRuns * 1e3,
|
|
110546
|
+
killSignal: "SIGKILL"
|
|
110547
|
+
});
|
|
110543
110548
|
return JSON.parse(await readFile8(reachableModulesFile, "utf-8"));
|
|
110544
110549
|
} finally {
|
|
110545
110550
|
await rm2(tmpFolder, { recursive: true });
|
|
@@ -110798,6 +110803,7 @@ var GoCodeAwareVulnerabilityScanner = class {
|
|
|
110798
110803
|
-topk=4 ${heuristic.includeTests && "-tests"}
|
|
110799
110804
|
${this.projectDir} ${vulnAccPaths}`, void 0, {
|
|
110800
110805
|
timeout: timeoutInSeconds * 1e3,
|
|
110806
|
+
killSignal: "SIGKILL",
|
|
110801
110807
|
env: memoryLimitInMB ? { ...process.env, GOMEMLIMIT: `${memoryLimitInMB}MiB` } : void 0
|
|
110802
110808
|
});
|
|
110803
110809
|
if (error) {
|
|
@@ -111197,7 +111203,7 @@ var RustCodeAwareVulnerabilityScanner = class _RustCodeAwareVulnerabilityScanner
|
|
|
111197
111203
|
const outputFile = resolve16(tmpDir, "output.json");
|
|
111198
111204
|
await writeFile8(inputFile, JSON.stringify(options));
|
|
111199
111205
|
const timeoutMs = Math.max(timeoutInSeconds * 1.5, timeoutInSeconds + 30) * 1e3;
|
|
111200
|
-
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runRustDirectDependencyAnalysis -i ${inputFile} -o ${outputFile} --tree-sitter-rust ${getTreeSitterRustPath()}`, void 0, { timeout: timeoutMs });
|
|
111206
|
+
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runRustDirectDependencyAnalysis -i ${inputFile} -o ${outputFile} --tree-sitter-rust ${getTreeSitterRustPath()}`, void 0, { timeout: timeoutMs, killSignal: "SIGKILL" });
|
|
111201
111207
|
if (result.error)
|
|
111202
111208
|
return void 0;
|
|
111203
111209
|
const packageIds = JSON.parse(await readFile10(outputFile, "utf-8")).result;
|
|
@@ -111233,7 +111239,7 @@ var RustCodeAwareVulnerabilityScanner = class _RustCodeAwareVulnerabilityScanner
|
|
|
111233
111239
|
const outputFile = resolve16(tmpDir, "output.json");
|
|
111234
111240
|
await writeFile8(inputFile, JSON.stringify(options));
|
|
111235
111241
|
const timeoutMs = Math.max(effectiveTimeout * 1.5, effectiveTimeout + 30) * 1e3;
|
|
111236
|
-
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runRustReachabilityAnalysis -i ${inputFile} -o ${outputFile} --tree-sitter-rust ${getTreeSitterRustPath()}`, void 0, { timeout: timeoutMs });
|
|
111242
|
+
const result = await execNeverFail2(cmdt`${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} ${getClassGraphAnalysisCliPath()} runRustReachabilityAnalysis -i ${inputFile} -o ${outputFile} --tree-sitter-rust ${getTreeSitterRustPath()}`, void 0, { timeout: timeoutMs, killSignal: "SIGKILL" });
|
|
111237
111243
|
if (result.error)
|
|
111238
111244
|
return { type: "error", message: result.error.message ?? "unknown error" };
|
|
111239
111245
|
const { success, error, analysisDiagnostics: diagnostics, vulnerablePaths, reachablePackageIds } = JSON.parse(await readFile10(outputFile, "utf-8")).result;
|
|
@@ -111760,8 +111766,10 @@ ${vulnAccPaths.join("\n")}`);
|
|
|
111760
111766
|
...process.env,
|
|
111761
111767
|
PYPY_GC_MAX: `${reachabilityAnalysisOptions.memoryLimitInMB ?? 0}MB`
|
|
111762
111768
|
},
|
|
111763
|
-
// Forcefully kill the process if the internal timeout mechanism fails
|
|
111764
|
-
|
|
111769
|
+
// Forcefully kill the process if the internal timeout mechanism fails.
|
|
111770
|
+
// Use SIGKILL to ensure termination even if the process is unresponsive.
|
|
111771
|
+
timeout: (timeoutInSeconds * 1.5 + 15) * 1e3,
|
|
111772
|
+
killSignal: "SIGKILL"
|
|
111765
111773
|
});
|
|
111766
111774
|
logger.debug("Done running mambalade");
|
|
111767
111775
|
const errors = stderr.split("\n").filter((line) => line.startsWith("ERROR:") && !/^ERROR: Excluded distribution/.test(line));
|
|
@@ -112420,23 +112428,22 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
112420
112428
|
const experimentalUrlToReachability = transformVulnsToUrlToReachability(experimentalRes.augmentedVulnerabilities);
|
|
112421
112429
|
const vulnUrlsWithPotentialRegressions = experimentalRes.augmentedVulnerabilities.filter((v) => previousAnalysisResults.reachabilityResults[v.url] && // If the vulnerability is new we do not have a previous reachability result
|
|
112422
112430
|
getVulnReachability(v.results) !== previousAnalysisResults.reachabilityResults[v.url]).map((v) => v.url);
|
|
112423
|
-
const bucketsToRecompute = experimentalRes.analysisMetadata
|
|
112424
|
-
|
|
112425
|
-
|
|
112426
|
-
|
|
112427
|
-
});
|
|
112428
|
-
bucketsNotToRecompute.forEach((b) => {
|
|
112431
|
+
const [bucketsToRecompute, bucketsNotToRecompute] = import_lodash17.default.partition(experimentalRes.analysisMetadata, (am) => am.vulnUrls.some((v) => vulnUrlsWithPotentialRegressions.includes(v)));
|
|
112432
|
+
for (const b of bucketsToRecompute)
|
|
112433
|
+
analysisMetadataCollector?.({ ...b, finalResult: false });
|
|
112434
|
+
for (const b of bucketsNotToRecompute)
|
|
112429
112435
|
analysisMetadataCollector?.(b);
|
|
112430
|
-
|
|
112431
|
-
sendTimeRegressionsToDashboard(expHeuristicName, previousAnalysisResults.analysisMetadata, bucketsNotToRecompute);
|
|
112436
|
+
await sendTimeRegressionsToDashboard(expHeuristicName, previousAnalysisResults.analysisMetadata, bucketsNotToRecompute);
|
|
112432
112437
|
let resWithoutExperimentalHeuristic;
|
|
112433
112438
|
if (bucketsToRecompute.length > 0) {
|
|
112434
112439
|
resWithoutExperimentalHeuristic = await analyzeAndAugmentVulns(bucketsToRecompute.map((b) => ({
|
|
112435
112440
|
heuristic: getHeuristicFromName(state, b.heuristicName, ecosystem),
|
|
112436
112441
|
vulnerabilities: b.vulnUrls.map((vUrl) => vulnerabilities.find((v) => v.url === vUrl))
|
|
112437
112442
|
})), analysisMetadataCollector, true);
|
|
112438
|
-
|
|
112439
|
-
|
|
112443
|
+
await Promise.all([
|
|
112444
|
+
sendTimeRegressionsToDashboard(expHeuristicName, resWithoutExperimentalHeuristic.analysisMetadata, bucketsToRecompute),
|
|
112445
|
+
sendReachabilityRegressionsToDashboard(resWithoutExperimentalHeuristic.analysisMetadata[0].heuristicName, expHeuristicName, transformVulnsToUrlToReachability(resWithoutExperimentalHeuristic.augmentedVulnerabilities), experimentalUrlToReachability)
|
|
112446
|
+
]);
|
|
112440
112447
|
}
|
|
112441
112448
|
const vulnsToGetFromExperimental = bucketsNotToRecompute.flatMap((b) => b.vulnUrls);
|
|
112442
112449
|
return {
|
|
@@ -112610,52 +112617,51 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
112610
112617
|
return false;
|
|
112611
112618
|
return oldDiagnostics.timings?.totalTime * 1.3 < newDiagnostics.timings?.totalTime && oldDiagnostics.timings?.totalTime + 5e3 < newDiagnostics.timings?.totalTime;
|
|
112612
112619
|
}
|
|
112613
|
-
function sendTimeRegressionsToDashboard(experimentName, oldAnalysisMetadata, newAnalysisMetadata) {
|
|
112620
|
+
async function sendTimeRegressionsToDashboard(experimentName, oldAnalysisMetadata, newAnalysisMetadata) {
|
|
112614
112621
|
const regressions = [];
|
|
112615
|
-
|
|
112622
|
+
for (const newMd of newAnalysisMetadata) {
|
|
112616
112623
|
const oldMd = oldAnalysisMetadata.find((oldMd2) => newMd.vulnUrls.some((vulnUrl) => oldMd2.vulnUrls.includes(vulnUrl)));
|
|
112617
112624
|
if (!oldMd) {
|
|
112618
|
-
sendWarningToDashboard("Could not find corresponding analysis metadata to compare time regressions with", {
|
|
112625
|
+
await sendWarningToDashboard("Could not find corresponding analysis metadata to compare time regressions with", {
|
|
112619
112626
|
subprojectPath: relative8(state.rootWorkingDir, state.subprojectDir) || ".",
|
|
112620
112627
|
workspacePath: state.workspacePath
|
|
112621
112628
|
}, void 0, COANA_REPORT_ID, apiKey);
|
|
112622
|
-
|
|
112629
|
+
continue;
|
|
112623
112630
|
}
|
|
112624
|
-
if (
|
|
112625
|
-
|
|
112626
|
-
|
|
112627
|
-
|
|
112628
|
-
|
|
112629
|
-
|
|
112630
|
-
|
|
112631
|
-
|
|
112632
|
-
|
|
112633
|
-
|
|
112634
|
-
|
|
112635
|
-
|
|
112636
|
-
|
|
112637
|
-
|
|
112638
|
-
|
|
112639
|
-
|
|
112640
|
-
|
|
112641
|
-
}
|
|
112642
|
-
|
|
112643
|
-
});
|
|
112631
|
+
if (hasTimeRegression(oldMd.analysisDiagnostics, newMd.analysisDiagnostics))
|
|
112632
|
+
regressions.push({
|
|
112633
|
+
type: "ANALYSIS_TIME",
|
|
112634
|
+
heuristicName: oldMd.heuristicName,
|
|
112635
|
+
experimentName,
|
|
112636
|
+
vulnUrls: oldMd.vulnUrls,
|
|
112637
|
+
analyzerName: codeAwareScanner.name,
|
|
112638
|
+
originalResult: {
|
|
112639
|
+
timedOut: oldMd.analysisDiagnostics.timeout,
|
|
112640
|
+
aborted: oldMd.analysisDiagnostics.aborted,
|
|
112641
|
+
totalTime: oldMd.analysisDiagnostics.timings.totalTime
|
|
112642
|
+
},
|
|
112643
|
+
experimentResult: {
|
|
112644
|
+
timedOut: newMd.analysisDiagnostics.timeout,
|
|
112645
|
+
aborted: newMd.analysisDiagnostics.aborted,
|
|
112646
|
+
totalTime: newMd.analysisDiagnostics.timings.totalTime
|
|
112647
|
+
}
|
|
112648
|
+
});
|
|
112649
|
+
}
|
|
112644
112650
|
if (regressions.length === 0)
|
|
112645
112651
|
return;
|
|
112646
|
-
sendRegressionsToDashboard(regressions, relative8(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, COANA_REPORT_ID, apiKey);
|
|
112652
|
+
await sendRegressionsToDashboard(regressions, relative8(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, COANA_REPORT_ID, apiKey);
|
|
112647
112653
|
}
|
|
112648
|
-
function sendReachabilityRegressionsToDashboard(heuristicName, experimentName, origRes, experimentRes) {
|
|
112649
|
-
const regressions = Object.
|
|
112654
|
+
async function sendReachabilityRegressionsToDashboard(heuristicName, experimentName, origRes, experimentRes) {
|
|
112655
|
+
const regressions = Object.entries(origRes).filter(([vulnUrl, oRes]) => experimentRes[vulnUrl] && oRes.reachability !== experimentRes[vulnUrl].reachability).map(([vulnUrl, originalResult]) => ({
|
|
112650
112656
|
type: "REACHABILITY",
|
|
112651
112657
|
heuristicName,
|
|
112652
112658
|
experimentName,
|
|
112653
112659
|
analyzerName: codeAwareScanner.name,
|
|
112654
112660
|
vulnUrl,
|
|
112655
|
-
originalResult
|
|
112661
|
+
originalResult,
|
|
112656
112662
|
experimentResult: experimentRes[vulnUrl]
|
|
112657
112663
|
}));
|
|
112658
|
-
sendRegressionsToDashboard(regressions, relative8(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, COANA_REPORT_ID, apiKey);
|
|
112664
|
+
await sendRegressionsToDashboard(regressions, relative8(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, COANA_REPORT_ID, apiKey);
|
|
112659
112665
|
}
|
|
112660
112666
|
}
|
|
112661
112667
|
function getHeuristicFromName(state, heuristicName, ecosystem) {
|
|
@@ -112738,7 +112744,10 @@ function findDuplicateVulnsInBuckets(bucketsFromLastAnalysis) {
|
|
|
112738
112744
|
return duplicateUrls;
|
|
112739
112745
|
}
|
|
112740
112746
|
function transformVulnsToUrlToReachability(oldHeuristicAugmentedVulnerabilities) {
|
|
112741
|
-
return Object.fromEntries(oldHeuristicAugmentedVulnerabilities.map((v) => [
|
|
112747
|
+
return Object.fromEntries(oldHeuristicAugmentedVulnerabilities.map((v) => [
|
|
112748
|
+
v.url,
|
|
112749
|
+
{ reachability: getVulnReachability(v.results), terminatedEarly: v.results.type === "success" && v.results.terminatedEarly }
|
|
112750
|
+
]));
|
|
112742
112751
|
}
|
|
112743
112752
|
|
|
112744
112753
|
// dist/analyzers/go-analyzer.js
|
|
@@ -116504,7 +116513,10 @@ var RubyCodeAwareVulnerabilityScanner = class {
|
|
|
116504
116513
|
logger.info("Ruby analysis command:", cmd.join(" "));
|
|
116505
116514
|
try {
|
|
116506
116515
|
this.numberAnalysesRun++;
|
|
116507
|
-
await exec2(cmd, this.projectDir, {
|
|
116516
|
+
await exec2(cmd, this.projectDir, {
|
|
116517
|
+
timeout: (timeoutInSeconds * 1.5 + 10) * 1e3,
|
|
116518
|
+
killSignal: "SIGKILL"
|
|
116519
|
+
});
|
|
116508
116520
|
const result = JSON.parse(await readFile12(vulnsOutputFile, "utf-8"));
|
|
116509
116521
|
const relativeLoadPathsToPackageNames = new Map([...loadPathsToPackageNames.entries()].map(([k, v]) => [join17("vendor", relative9(this.vendorDir, k)), v]));
|
|
116510
116522
|
const { timedOut, ...diagnostics } = JSON.parse(await readFile12(diagnosticsOutputFile, "utf-8"));
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|