@coana-tech/cli 14.9.33 → 14.10.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/cli.mjs +21 -10
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -188577,8 +188577,8 @@ var ecosystemToSupport = {
|
|
|
188577
188577
|
packageManagers: {
|
|
188578
188578
|
CARGO: {
|
|
188579
188579
|
supportsFindingProjects: true,
|
|
188580
|
-
supportsTraditionalSCA:
|
|
188581
|
-
supportsApplyingFixes:
|
|
188580
|
+
supportsTraditionalSCA: false,
|
|
188581
|
+
supportsApplyingFixes: false
|
|
188582
188582
|
}
|
|
188583
188583
|
}
|
|
188584
188584
|
},
|
|
@@ -204467,8 +204467,8 @@ var ecosystemToSupport2 = {
|
|
|
204467
204467
|
packageManagers: {
|
|
204468
204468
|
CARGO: {
|
|
204469
204469
|
supportsFindingProjects: true,
|
|
204470
|
-
supportsTraditionalSCA:
|
|
204471
|
-
supportsApplyingFixes:
|
|
204470
|
+
supportsTraditionalSCA: false,
|
|
204471
|
+
supportsApplyingFixes: false
|
|
204472
204472
|
}
|
|
204473
204473
|
}
|
|
204474
204474
|
},
|
|
@@ -221973,7 +221973,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
|
|
|
221973
221973
|
}
|
|
221974
221974
|
|
|
221975
221975
|
// dist/version.js
|
|
221976
|
-
var version2 = "14.
|
|
221976
|
+
var version2 = "14.10.0";
|
|
221977
221977
|
|
|
221978
221978
|
// ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/bind.js
|
|
221979
221979
|
function bind2(fn2, thisArg) {
|
|
@@ -226497,9 +226497,21 @@ async function computeFixesAndUpgradePurls(path2, options) {
|
|
|
226497
226497
|
...vulnerableArtifactIdsPerVulnerability.get(ghsa)?.values() ?? []
|
|
226498
226498
|
]);
|
|
226499
226499
|
const computedFix = await useSocketComputeFixEndpoint(artifacts, vulnerableArtifactIdsForGhsas);
|
|
226500
|
-
if (computedFix.type !== "
|
|
226500
|
+
if (computedFix.type !== "success") {
|
|
226501
226501
|
throw new Error(`No fix found for the given vulnerabilities`);
|
|
226502
226502
|
}
|
|
226503
|
+
if (computedFix.failedArtifacts) {
|
|
226504
|
+
const ghsasFailedToFix = options.applyFixesTo.filter((ghsa) => {
|
|
226505
|
+
const artifactIds = vulnerableArtifactIdsPerVulnerability.get(ghsa);
|
|
226506
|
+
if (!artifactIds)
|
|
226507
|
+
return false;
|
|
226508
|
+
return Array.from(artifactIds).some((vuln) => computedFix.failedArtifacts?.includes(vuln));
|
|
226509
|
+
});
|
|
226510
|
+
logger.info("Failed to compute fixes for the following vulnerabilities:");
|
|
226511
|
+
for (const ghsa of ghsasFailedToFix) {
|
|
226512
|
+
logger.info(` - ${ghsa} (${Array.from(vulnerableArtifactIdsPerVulnerability.get(ghsa)).map((id) => simplePurl(artifacts[id].type, artifacts[id].namespace ?? null, artifacts[id].name, artifacts[id].version ?? null)).join(", ")})`);
|
|
226513
|
+
}
|
|
226514
|
+
}
|
|
226503
226515
|
if (options.dryRun) {
|
|
226504
226516
|
logger.info("Fixes found:");
|
|
226505
226517
|
for (const fix of computedFix.fixes) {
|
|
@@ -226608,9 +226620,8 @@ async function useSocketComputeFixEndpoint(artifacts, vulnerableArtifactIdsForGh
|
|
|
226608
226620
|
} catch (error) {
|
|
226609
226621
|
logger.error("Request to compute fixes failed:", error);
|
|
226610
226622
|
return {
|
|
226611
|
-
type: "error
|
|
226612
|
-
message: "Error during computation"
|
|
226613
|
-
fixes: []
|
|
226623
|
+
type: "error",
|
|
226624
|
+
message: "Error during computation"
|
|
226614
226625
|
};
|
|
226615
226626
|
}
|
|
226616
226627
|
}
|
|
@@ -226618,7 +226629,7 @@ async function useSocketComputeFixEndpoint(artifacts, vulnerableArtifactIdsForGh
|
|
|
226618
226629
|
// dist/index.js
|
|
226619
226630
|
var program2 = new Command();
|
|
226620
226631
|
var run2 = new Command();
|
|
226621
|
-
run2.name("run").argument("<path>", "File system path to folder containing the project").option("-o, --output-dir <path>", "Write json report to <path>/coana-report.json").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-p, --print-report", "Print the report to the console", false).option("--offline-database <path>", "Path to a coana-offline-db.json file for running the CLI without internet connectivity", void 0).option("-t, --timeout <timeout>", "Set API <timeout> in milliseconds to Coana backend.", "300000").option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available.", "1").option("--api-key <key>", "Set the Coana dashboard API key. By setting you also enable the dashboard integration.").addOption(new Option("--write-report-to-file", "Write the report dashboard-compatible report to dashboard-report.json. This report may help the Coana team debug issues with the report insertion mechanism.").default(false).hideHelp()).option("--project-name <repoName>", "Set the name of the repository. Used for dashboard integration.").option("--repo-url <repoUrl>", "Set the URL of the repository. Used for dashboard integration.").option("--include-dirs <
|
|
226632
|
+
run2.name("run").argument("<path>", "File system path to folder containing the project").option("-o, --output-dir <path>", "Write json report to <path>/coana-report.json").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-p, --print-report", "Print the report to the console", false).option("--offline-database <path>", "Path to a coana-offline-db.json file for running the CLI without internet connectivity", void 0).option("-t, --timeout <timeout>", "Set API <timeout> in milliseconds to Coana backend.", "300000").option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available.", "1").option("--api-key <key>", "Set the Coana dashboard API key. By setting you also enable the dashboard integration.").addOption(new Option("--write-report-to-file", "Write the report dashboard-compatible report to dashboard-report.json. This report may help the Coana team debug issues with the report insertion mechanism.").default(false).hideHelp()).option("--project-name <repoName>", "Set the name of the repository. Used for dashboard integration.").option("--repo-url <repoUrl>", "Set the URL of the repository. Used for dashboard integration.").option("--include-dirs <relativeDirs...>", "globs for directories to include from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, projects that are not included may still be scanned if they are referenced from included projects.").option("--exclude-dirs <relativeDirs...>", "globs for directories to exclude from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, excluded projects may still be scanned if they are referenced from non-excluded projects.").option("--disable-analysis-splitting", "Limits Coana to at most 1 reachability analysis run per workspace").option("--print-analysis-log-file", "Store log output from the JavaScript/TypeScript reachability analysis in the file js-analysis.log file in the root of each workspace", false).option("--entry-points <entryPoints...>", "List of files to analyze for root workspace. The reachability analysis automatically analyzes all files used by the entry points. If not provided, all JavaScript and TypeScript files are considered entry points. For non-root workspaces, all JavaScript and TypeScript files are analyzed as well.").option("--include-projects-with-no-reachability-support", "Also runs Coana on projects where we support traditional SCA, but does not yet support reachability analysis.", false).option("--ecosystems <ecosystems...>", "List of ecosystems to analyze (space-separated). Currently NPM, PIP, MAVEN and GO are supported. Default is all supported ecosystems.", (ecosystems) => ecosystems.split(" ").map((e) => e.toUpperCase())).option("--changed-files <files...>", "List of files that have changed. If provided, Coana only analyzes workspaces and modules that contain changed files.").option("--disable-report-submission", "Disable the submission of the report to the Coana dashboard. Used by the pipeline blocking feature.", false).option("--provider-project <path>", "File system path to folder containing the provider project (Only supported for Maven, Gradle, and SBT)").option("--provider-workspaces <dirs...>", "List of workspaces that build the provided runtime environment (Only supported for Maven, Gradle, and SBT)", (paths) => paths.split(" ")).option("--lightweight-reachability", "Runs Coana in lightweight mode. This increases analysis speed but also raises the risk of Coana misclassifying the reachability of certain complex vulnerabilities. Recommended only for use with Coana Guardrail mode.", false).addOption(new Option("--run-without-docker", "Run package managers and reachability analyzers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--run-env <env>", "Specifies the environment in which the CLI is run. So far only MANAGED_SCAN and UNKNOWN are supported.").default("UNKNOWN").choices(["UNKNOWN", "MANAGED_SCAN"]).hideHelp()).addOption(new Option("--guardrail-mode", "Run Coana in guardrail mode. This mode is used to prevent new reachable vulnerabilities from being introduced into the codebase. Usually run as a CI check when pushing new commits to a pull request.")).addOption(new Option("--socket-mode <output-file>", "Run Coana in socket mode and write report to <output-file>").hideHelp()).addOption(new Option("--manifests-tar-hash <hash>", "Hash of the tarball containing all manifest files already uploaded to Socket. If provided, Socket will be used for computing dependency trees.").hideHelp()).version(version2).configureHelp({ sortOptions: true }).action(async (path2, options) => {
|
|
226622
226633
|
process.env.DOCKER_IMAGE_TAG ??= version2;
|
|
226623
226634
|
await new CliCore(path2, options).main();
|
|
226624
226635
|
});
|