@socketsecurity/cli-with-sentry 1.0.97 → 1.0.99
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/dist/cli.js +795 -369
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/shadow-npm-inject.js +2 -2
- package/dist/shadow-npm-inject.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/pull-request.d.mts +28 -1
- package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
- package/dist/types/commands/patch/cmd-patch.d.mts +11 -0
- package/dist/types/commands/patch/cmd-patch.d.mts.map +1 -0
- package/dist/types/commands/patch/handle-patch.d.mts +10 -0
- package/dist/types/commands/patch/handle-patch.d.mts.map +1 -0
- package/dist/types/commands/patch/output-patch-result.d.mts +5 -0
- package/dist/types/commands/patch/output-patch-result.d.mts.map +1 -0
- package/dist/types/commands.d.mts +7 -0
- package/dist/types/commands.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/utils.js +40 -38
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +4621 -4613
- package/external/@coana-tech/cli/cli.mjs +61 -52
- package/external/@coana-tech/cli/repos/coana-tech/alucard/alucard.jar +0 -0
- package/external/@coana-tech/cli/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
- package/external/@coana-tech/cli/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
- package/external/@coana-tech/cli/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
- package/external/@coana-tech/cli/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
- package/package.json +5 -5
- package/dist/types/commands/scan/suggest-repo-slug.d.mts +0 -9
- package/dist/types/commands/scan/suggest-repo-slug.d.mts.map +0 -1
|
@@ -6151,7 +6151,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
6151
6151
|
return circularValue;
|
|
6152
6152
|
}
|
|
6153
6153
|
let res = "";
|
|
6154
|
-
let
|
|
6154
|
+
let join28 = ",";
|
|
6155
6155
|
const originalIndentation = indentation;
|
|
6156
6156
|
if (Array.isArray(value)) {
|
|
6157
6157
|
if (value.length === 0) {
|
|
@@ -6165,7 +6165,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
6165
6165
|
indentation += spacer;
|
|
6166
6166
|
res += `
|
|
6167
6167
|
${indentation}`;
|
|
6168
|
-
|
|
6168
|
+
join28 = `,
|
|
6169
6169
|
${indentation}`;
|
|
6170
6170
|
}
|
|
6171
6171
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -6173,13 +6173,13 @@ ${indentation}`;
|
|
|
6173
6173
|
for (; i6 < maximumValuesToStringify - 1; i6++) {
|
|
6174
6174
|
const tmp2 = stringifyFnReplacer(String(i6), value, stack2, replacer, spacer, indentation);
|
|
6175
6175
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
6176
|
-
res +=
|
|
6176
|
+
res += join28;
|
|
6177
6177
|
}
|
|
6178
6178
|
const tmp = stringifyFnReplacer(String(i6), value, stack2, replacer, spacer, indentation);
|
|
6179
6179
|
res += tmp !== void 0 ? tmp : "null";
|
|
6180
6180
|
if (value.length - 1 > maximumBreadth) {
|
|
6181
6181
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
6182
|
-
res += `${
|
|
6182
|
+
res += `${join28}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
6183
6183
|
}
|
|
6184
6184
|
if (spacer !== "") {
|
|
6185
6185
|
res += `
|
|
@@ -6200,7 +6200,7 @@ ${originalIndentation}`;
|
|
|
6200
6200
|
let separator = "";
|
|
6201
6201
|
if (spacer !== "") {
|
|
6202
6202
|
indentation += spacer;
|
|
6203
|
-
|
|
6203
|
+
join28 = `,
|
|
6204
6204
|
${indentation}`;
|
|
6205
6205
|
whitespace2 = " ";
|
|
6206
6206
|
}
|
|
@@ -6214,13 +6214,13 @@ ${indentation}`;
|
|
|
6214
6214
|
const tmp = stringifyFnReplacer(key2, value, stack2, replacer, spacer, indentation);
|
|
6215
6215
|
if (tmp !== void 0) {
|
|
6216
6216
|
res += `${separator}${strEscape(key2)}:${whitespace2}${tmp}`;
|
|
6217
|
-
separator =
|
|
6217
|
+
separator = join28;
|
|
6218
6218
|
}
|
|
6219
6219
|
}
|
|
6220
6220
|
if (keyLength > maximumBreadth) {
|
|
6221
6221
|
const removedKeys = keyLength - maximumBreadth;
|
|
6222
6222
|
res += `${separator}"...":${whitespace2}"${getItemCount(removedKeys)} not stringified"`;
|
|
6223
|
-
separator =
|
|
6223
|
+
separator = join28;
|
|
6224
6224
|
}
|
|
6225
6225
|
if (spacer !== "" && separator.length > 1) {
|
|
6226
6226
|
res = `
|
|
@@ -6261,7 +6261,7 @@ ${originalIndentation}`;
|
|
|
6261
6261
|
}
|
|
6262
6262
|
const originalIndentation = indentation;
|
|
6263
6263
|
let res = "";
|
|
6264
|
-
let
|
|
6264
|
+
let join28 = ",";
|
|
6265
6265
|
if (Array.isArray(value)) {
|
|
6266
6266
|
if (value.length === 0) {
|
|
6267
6267
|
return "[]";
|
|
@@ -6274,7 +6274,7 @@ ${originalIndentation}`;
|
|
|
6274
6274
|
indentation += spacer;
|
|
6275
6275
|
res += `
|
|
6276
6276
|
${indentation}`;
|
|
6277
|
-
|
|
6277
|
+
join28 = `,
|
|
6278
6278
|
${indentation}`;
|
|
6279
6279
|
}
|
|
6280
6280
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -6282,13 +6282,13 @@ ${indentation}`;
|
|
|
6282
6282
|
for (; i6 < maximumValuesToStringify - 1; i6++) {
|
|
6283
6283
|
const tmp2 = stringifyArrayReplacer(String(i6), value[i6], stack2, replacer, spacer, indentation);
|
|
6284
6284
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
6285
|
-
res +=
|
|
6285
|
+
res += join28;
|
|
6286
6286
|
}
|
|
6287
6287
|
const tmp = stringifyArrayReplacer(String(i6), value[i6], stack2, replacer, spacer, indentation);
|
|
6288
6288
|
res += tmp !== void 0 ? tmp : "null";
|
|
6289
6289
|
if (value.length - 1 > maximumBreadth) {
|
|
6290
6290
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
6291
|
-
res += `${
|
|
6291
|
+
res += `${join28}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
6292
6292
|
}
|
|
6293
6293
|
if (spacer !== "") {
|
|
6294
6294
|
res += `
|
|
@@ -6301,7 +6301,7 @@ ${originalIndentation}`;
|
|
|
6301
6301
|
let whitespace2 = "";
|
|
6302
6302
|
if (spacer !== "") {
|
|
6303
6303
|
indentation += spacer;
|
|
6304
|
-
|
|
6304
|
+
join28 = `,
|
|
6305
6305
|
${indentation}`;
|
|
6306
6306
|
whitespace2 = " ";
|
|
6307
6307
|
}
|
|
@@ -6310,7 +6310,7 @@ ${indentation}`;
|
|
|
6310
6310
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack2, replacer, spacer, indentation);
|
|
6311
6311
|
if (tmp !== void 0) {
|
|
6312
6312
|
res += `${separator}${strEscape(key2)}:${whitespace2}${tmp}`;
|
|
6313
|
-
separator =
|
|
6313
|
+
separator = join28;
|
|
6314
6314
|
}
|
|
6315
6315
|
}
|
|
6316
6316
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -6368,20 +6368,20 @@ ${originalIndentation}`;
|
|
|
6368
6368
|
indentation += spacer;
|
|
6369
6369
|
let res2 = `
|
|
6370
6370
|
${indentation}`;
|
|
6371
|
-
const
|
|
6371
|
+
const join29 = `,
|
|
6372
6372
|
${indentation}`;
|
|
6373
6373
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
6374
6374
|
let i6 = 0;
|
|
6375
6375
|
for (; i6 < maximumValuesToStringify - 1; i6++) {
|
|
6376
6376
|
const tmp2 = stringifyIndent(String(i6), value[i6], stack2, spacer, indentation);
|
|
6377
6377
|
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
6378
|
-
res2 +=
|
|
6378
|
+
res2 += join29;
|
|
6379
6379
|
}
|
|
6380
6380
|
const tmp = stringifyIndent(String(i6), value[i6], stack2, spacer, indentation);
|
|
6381
6381
|
res2 += tmp !== void 0 ? tmp : "null";
|
|
6382
6382
|
if (value.length - 1 > maximumBreadth) {
|
|
6383
6383
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
6384
|
-
res2 += `${
|
|
6384
|
+
res2 += `${join29}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
6385
6385
|
}
|
|
6386
6386
|
res2 += `
|
|
6387
6387
|
${originalIndentation}`;
|
|
@@ -6397,16 +6397,16 @@ ${originalIndentation}`;
|
|
|
6397
6397
|
return '"[Object]"';
|
|
6398
6398
|
}
|
|
6399
6399
|
indentation += spacer;
|
|
6400
|
-
const
|
|
6400
|
+
const join28 = `,
|
|
6401
6401
|
${indentation}`;
|
|
6402
6402
|
let res = "";
|
|
6403
6403
|
let separator = "";
|
|
6404
6404
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
6405
6405
|
if (isTypedArrayWithEntries(value)) {
|
|
6406
|
-
res += stringifyTypedArray(value,
|
|
6406
|
+
res += stringifyTypedArray(value, join28, maximumBreadth);
|
|
6407
6407
|
keys = keys.slice(value.length);
|
|
6408
6408
|
maximumPropertiesToStringify -= value.length;
|
|
6409
|
-
separator =
|
|
6409
|
+
separator = join28;
|
|
6410
6410
|
}
|
|
6411
6411
|
if (deterministic) {
|
|
6412
6412
|
keys = insertSort(keys);
|
|
@@ -6417,13 +6417,13 @@ ${indentation}`;
|
|
|
6417
6417
|
const tmp = stringifyIndent(key2, value[key2], stack2, spacer, indentation);
|
|
6418
6418
|
if (tmp !== void 0) {
|
|
6419
6419
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
6420
|
-
separator =
|
|
6420
|
+
separator = join28;
|
|
6421
6421
|
}
|
|
6422
6422
|
}
|
|
6423
6423
|
if (keyLength > maximumBreadth) {
|
|
6424
6424
|
const removedKeys = keyLength - maximumBreadth;
|
|
6425
6425
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
6426
|
-
separator =
|
|
6426
|
+
separator = join28;
|
|
6427
6427
|
}
|
|
6428
6428
|
if (separator !== "") {
|
|
6429
6429
|
res = `
|
|
@@ -7990,7 +7990,7 @@ var require_buffer_list = __commonJS({
|
|
|
7990
7990
|
}
|
|
7991
7991
|
}, {
|
|
7992
7992
|
key: "join",
|
|
7993
|
-
value: function
|
|
7993
|
+
value: function join28(s4) {
|
|
7994
7994
|
if (this.length === 0) return "";
|
|
7995
7995
|
var p3 = this.head;
|
|
7996
7996
|
var ret = "" + p3.data;
|
|
@@ -19073,7 +19073,7 @@ var require_lodash = __commonJS({
|
|
|
19073
19073
|
}
|
|
19074
19074
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
19075
19075
|
});
|
|
19076
|
-
function
|
|
19076
|
+
function join28(array, separator) {
|
|
19077
19077
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
19078
19078
|
}
|
|
19079
19079
|
function last2(array) {
|
|
@@ -20992,7 +20992,7 @@ var require_lodash = __commonJS({
|
|
|
20992
20992
|
lodash16.isUndefined = isUndefined2;
|
|
20993
20993
|
lodash16.isWeakMap = isWeakMap;
|
|
20994
20994
|
lodash16.isWeakSet = isWeakSet;
|
|
20995
|
-
lodash16.join =
|
|
20995
|
+
lodash16.join = join28;
|
|
20996
20996
|
lodash16.kebabCase = kebabCase;
|
|
20997
20997
|
lodash16.last = last2;
|
|
20998
20998
|
lodash16.lastIndexOf = lastIndexOf;
|
|
@@ -29988,7 +29988,7 @@ var require_builder = __commonJS({
|
|
|
29988
29988
|
}
|
|
29989
29989
|
};
|
|
29990
29990
|
exports2.SeqBuilder = SeqBuilder;
|
|
29991
|
-
function
|
|
29991
|
+
function join28(first2, second, ...others) {
|
|
29992
29992
|
const seq = new SeqBuilder(first2, second);
|
|
29993
29993
|
if (!others.length) {
|
|
29994
29994
|
return seq;
|
|
@@ -29997,7 +29997,7 @@ var require_builder = __commonJS({
|
|
|
29997
29997
|
return res.join(query);
|
|
29998
29998
|
}, seq);
|
|
29999
29999
|
}
|
|
30000
|
-
exports2.join =
|
|
30000
|
+
exports2.join = join28;
|
|
30001
30001
|
var SymBuilder = class extends AbstractBuilder {
|
|
30002
30002
|
constructor(opts) {
|
|
30003
30003
|
super();
|
|
@@ -209805,7 +209805,7 @@ var kleur_default = $;
|
|
|
209805
209805
|
// dist/cli-core.js
|
|
209806
209806
|
var import_lodash15 = __toESM(require_lodash(), 1);
|
|
209807
209807
|
import os from "os";
|
|
209808
|
-
import { join as
|
|
209808
|
+
import { join as join25, relative as relative11, resolve as resolve23 } from "path";
|
|
209809
209809
|
|
|
209810
209810
|
// ../utils/src/dashboard-api/shared-api.ts
|
|
209811
209811
|
var DashboardAPI = class {
|
|
@@ -210253,9 +210253,9 @@ function transformToVulnChainNode(dependencyTree) {
|
|
|
210253
210253
|
}
|
|
210254
210254
|
|
|
210255
210255
|
// dist/internal/socket-mode-helpers-socket-dependency-trees.js
|
|
210256
|
-
var import_picomatch2 = __toESM(require_picomatch2(), 1);
|
|
210257
|
-
import { basename as basename7, dirname as dirname8, sep as sep5 } from "path";
|
|
210258
210256
|
var import_packageurl_js = __toESM(require_packageurl_js(), 1);
|
|
210257
|
+
var import_picomatch2 = __toESM(require_picomatch2(), 1);
|
|
210258
|
+
import { basename as basename7, dirname as dirname8, join as join23, sep as sep5 } from "path";
|
|
210259
210259
|
var REQUIREMENTS_FILES_SEARCH_DEPTH2 = 3;
|
|
210260
210260
|
function inferWorkspaceFromManifestPath(ecosystem, manifestPath, properPythonProjects) {
|
|
210261
210261
|
switch (ecosystem) {
|
|
@@ -210278,7 +210278,7 @@ function inferWorkspaceFromManifestPath(ecosystem, manifestPath, properPythonPro
|
|
|
210278
210278
|
return workspaceDir;
|
|
210279
210279
|
}
|
|
210280
210280
|
if (base.endsWith(".txt")) {
|
|
210281
|
-
const isWithinProperProject = properPythonProjects.some((properProjectDir) => workspaceDir.startsWith(properProjectDir) && workspaceDir.replace(properProjectDir, "").split(sep5).length <= REQUIREMENTS_FILES_SEARCH_DEPTH2);
|
|
210281
|
+
const isWithinProperProject = properPythonProjects.some((properProjectDir) => (workspaceDir === "." || workspaceDir.startsWith(properProjectDir)) && workspaceDir.replace(properProjectDir, "").split(sep5).length <= REQUIREMENTS_FILES_SEARCH_DEPTH2);
|
|
210282
210282
|
if (isWithinProperProject) {
|
|
210283
210283
|
return void 0;
|
|
210284
210284
|
}
|
|
@@ -210368,7 +210368,7 @@ async function fetchArtifactsFromSocket(rootWorkingDirectory, manifestsTarHash)
|
|
|
210368
210368
|
for (const file of allFiles) {
|
|
210369
210369
|
const base = basename7(file);
|
|
210370
210370
|
const workspaceDir = dirname8(file) || ".";
|
|
210371
|
-
if (base === "pyproject.toml" || base === "setup.py" && await isSetupPySetuptools(file)) {
|
|
210371
|
+
if (base === "pyproject.toml" || base === "setup.py" && await isSetupPySetuptools(join23(rootWorkingDirectory, file))) {
|
|
210372
210372
|
if (!properPythonProjects.includes(workspaceDir)) {
|
|
210373
210373
|
properPythonProjects.push(workspaceDir);
|
|
210374
210374
|
}
|
|
@@ -210442,7 +210442,7 @@ async function fetchArtifactsFromSocket(rootWorkingDirectory, manifestsTarHash)
|
|
|
210442
210442
|
name: artifact.name ?? "",
|
|
210443
210443
|
dependency: artifact.name ?? "",
|
|
210444
210444
|
vulnChainDetails: computeVulnChainDetails2(artifacts, artifact.id),
|
|
210445
|
-
vulnerabilityAccessPaths: vuln.reachabilityData?.pattern ?? null,
|
|
210445
|
+
vulnerabilityAccessPaths: vuln.reachabilityData?.undeterminableReachability ? vuln.reachabilityData.publicComment ?? "" : vuln.reachabilityData?.pattern ?? null,
|
|
210446
210446
|
ecosystem,
|
|
210447
210447
|
artifactId: artifact.id
|
|
210448
210448
|
};
|
|
@@ -224212,7 +224212,7 @@ var { root: root2 } = static_exports;
|
|
|
224212
224212
|
// ../utils/src/maven-utils.ts
|
|
224213
224213
|
var import_lodash14 = __toESM(require_lodash(), 1);
|
|
224214
224214
|
import { existsSync as existsSync20, readdirSync as readdirSync4, statSync as statSync4 } from "fs";
|
|
224215
|
-
import { join as
|
|
224215
|
+
import { join as join24 } from "path";
|
|
224216
224216
|
var { memoize: memoize3 } = import_lodash14.default;
|
|
224217
224217
|
var memoizedParseShellArgs = memoize3(parseShellArgs);
|
|
224218
224218
|
var MAVEN_PUBLIC_REPOSITORIES = [
|
|
@@ -225583,7 +225583,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
|
|
|
225583
225583
|
}
|
|
225584
225584
|
|
|
225585
225585
|
// dist/version.js
|
|
225586
|
-
var version2 = "14.12.
|
|
225586
|
+
var version2 = "14.12.3";
|
|
225587
225587
|
|
|
225588
225588
|
// dist/cli-core.js
|
|
225589
225589
|
var { mapValues, omit, partition, pick } = import_lodash15.default;
|
|
@@ -225685,7 +225685,7 @@ var CliCore = class {
|
|
|
225685
225685
|
}
|
|
225686
225686
|
}
|
|
225687
225687
|
async main() {
|
|
225688
|
-
this.coanaLogPath =
|
|
225688
|
+
this.coanaLogPath = join25(await createTmpDirectory("coana-cli-"), "coana-log.txt");
|
|
225689
225689
|
logger.initWinstonLogger(this.options.debug, this.coanaLogPath);
|
|
225690
225690
|
logger.silent = this.options.silent;
|
|
225691
225691
|
try {
|
|
@@ -226266,8 +226266,9 @@ async function getGitDataToMetadataIfAvailable(rootWorkingDirectory) {
|
|
|
226266
226266
|
}
|
|
226267
226267
|
|
|
226268
226268
|
// dist/cli-upgrade-purl.js
|
|
226269
|
-
import { join as
|
|
226269
|
+
import { join as join26, relative as relative12 } from "node:path";
|
|
226270
226270
|
var import_packageurl_js2 = __toESM(require_packageurl_js(), 1);
|
|
226271
|
+
var ECOSYSTEMS_WITH_SOCKET_UPGRADES = ["NPM", "MAVEN"];
|
|
226271
226272
|
async function upgradePurl(path2, upgrades, options, logFile, cliFixRunId) {
|
|
226272
226273
|
logger.initWinstonLogger(options.debug);
|
|
226273
226274
|
logger.silent = options.silent;
|
|
@@ -226281,8 +226282,20 @@ async function upgradePurl(path2, upgrades, options, logFile, cliFixRunId) {
|
|
|
226281
226282
|
logger.info(`Upgrading purls for ${path2}:
|
|
226282
226283
|
${upgrades.map((upgrade) => ` ${upgrade.purl} -> ${upgrade.upgradeVersion}`).join("\n")}`);
|
|
226283
226284
|
if (options.manifestsTarHash) {
|
|
226285
|
+
const { supportedUpgrades, unsupportedUpgrades } = upgrades.reduce((acc, upgrade) => {
|
|
226286
|
+
const ecosystem = getAdvisoryEcosystemFromPurl(upgrade.purl);
|
|
226287
|
+
const target = ECOSYSTEMS_WITH_SOCKET_UPGRADES.includes(ecosystem) ? "supportedUpgrades" : "unsupportedUpgrades";
|
|
226288
|
+
acc[target].push(upgrade);
|
|
226289
|
+
return acc;
|
|
226290
|
+
}, { supportedUpgrades: [], unsupportedUpgrades: [] });
|
|
226291
|
+
if (unsupportedUpgrades.length > 0) {
|
|
226292
|
+
logger.warn(`The following upgrades are not supported due to missing support for upgrading their ecosystem: ${unsupportedUpgrades.map((upgrade) => ` ${upgrade.purl} -> ${upgrade.upgradeVersion}`).join("\n")}`);
|
|
226293
|
+
}
|
|
226294
|
+
if (supportedUpgrades.length === 0) {
|
|
226295
|
+
return "fixed-none";
|
|
226296
|
+
}
|
|
226284
226297
|
try {
|
|
226285
|
-
const purlToUpgradeVersion = new Map(
|
|
226298
|
+
const purlToUpgradeVersion = new Map(supportedUpgrades.map((upgrade) => [upgrade.purl, upgrade.upgradeVersion]));
|
|
226286
226299
|
const { artifacts } = await fetchArtifactsFromSocket(path2, options.manifestsTarHash);
|
|
226287
226300
|
const ecosystemToSocketArtifactUpgrades = {};
|
|
226288
226301
|
artifacts.forEach((artifact, idx) => {
|
|
@@ -226302,16 +226315,12 @@ ${upgrades.map((upgrade) => ` ${upgrade.purl} -> ${upgrade.upgradeVersion}`).joi
|
|
|
226302
226315
|
});
|
|
226303
226316
|
});
|
|
226304
226317
|
for (const [ecosystem, upgrades2] of Object.entries(ecosystemToSocketArtifactUpgrades)) {
|
|
226305
|
-
|
|
226306
|
-
await applySocketUpgrades(ecosystem, path2, upgrades2, artifacts);
|
|
226307
|
-
} else {
|
|
226308
|
-
logger.warn(`Unsupported ecosystem ${ecosystem} for socket upgrades`);
|
|
226309
|
-
}
|
|
226318
|
+
await applySocketUpgrades(ecosystem, path2, upgrades2, artifacts);
|
|
226310
226319
|
}
|
|
226311
226320
|
if (upgradePurlRunId) {
|
|
226312
226321
|
await getSocketAPI().finalizeUpgradePurlRun(upgradePurlRunId, "success");
|
|
226313
226322
|
}
|
|
226314
|
-
return;
|
|
226323
|
+
return unsupportedUpgrades.length === 0 ? "fixed-all" : "fixed-some";
|
|
226315
226324
|
} catch (error) {
|
|
226316
226325
|
if (upgradePurlRunId) {
|
|
226317
226326
|
await getSocketAPI().finalizeUpgradePurlRun(
|
|
@@ -226338,7 +226347,7 @@ ${upgrades.map((upgrade) => ` ${upgrade.purl} -> ${upgrade.upgradeVersion}`).joi
|
|
|
226338
226347
|
const subprojectPromiseQueue = new PromiseQueue(Number(options.concurrency));
|
|
226339
226348
|
supportedSubprojects.forEach((subproject) => {
|
|
226340
226349
|
subprojectPromiseQueue.enqueueTask(async () => {
|
|
226341
|
-
const workspacePathsMatchingGlob = subproject.workspacePaths.filter((wsPath) => minimatch(
|
|
226350
|
+
const workspacePathsMatchingGlob = subproject.workspacePaths.filter((wsPath) => minimatch(join26(subproject.subprojectPath, wsPath), options.globPattern ?? "**"));
|
|
226342
226351
|
if (workspacePathsMatchingGlob.length === 0)
|
|
226343
226352
|
return;
|
|
226344
226353
|
logger.info(`Found workspaces for subproject ${subproject.subprojectPath}${options.globPattern ? `matching glob ${options.globPattern}` : ""}:
|
|
@@ -226367,7 +226376,7 @@ ${workspacePathsMatchingGlob.map((wsPath) => ` ${wsPath}`).join("\n")}`);
|
|
|
226367
226376
|
});
|
|
226368
226377
|
if (vulnerabilityFixes.length === 0)
|
|
226369
226378
|
return;
|
|
226370
|
-
logger.info(`Found ${vulnerabilityFixes.length} ${vulnerabilityFixes.length === 1 ? "dependency" : "dependencies"} matching upgrade specs for ${
|
|
226379
|
+
logger.info(`Found ${vulnerabilityFixes.length} ${vulnerabilityFixes.length === 1 ? "dependency" : "dependencies"} matching upgrade specs for ${join26(subproject.subprojectPath, wsPath)}`);
|
|
226371
226380
|
workspaceToFixes[wsPath] = [
|
|
226372
226381
|
{
|
|
226373
226382
|
fixId: "dummy",
|
|
@@ -226388,7 +226397,7 @@ ${workspacePathsMatchingGlob.map((wsPath) => ` ${wsPath}`).join("\n")}`);
|
|
|
226388
226397
|
}
|
|
226389
226398
|
}
|
|
226390
226399
|
var signalFixApplied = (_fixId, subprojectPath, workspacePath, vulnerabilityFixes) => {
|
|
226391
|
-
logger.info(`Successfully upgraded purls for: ${
|
|
226400
|
+
logger.info(`Successfully upgraded purls for: ${join26(subprojectPath, workspacePath)}`);
|
|
226392
226401
|
logger.info(`Upgraded:
|
|
226393
226402
|
${vulnerabilityFixes.map((fix) => ` ${fix.dependencyName} from ${fix.currentVersion} to ${fix.fixedVersion}`).join("\n")}`);
|
|
226394
226403
|
};
|
|
@@ -226433,16 +226442,16 @@ async function computeFixesAndUpgradePurls(path2, options, logFile) {
|
|
|
226433
226442
|
return;
|
|
226434
226443
|
}
|
|
226435
226444
|
try {
|
|
226436
|
-
await upgradePurl(path2, combinedFixes.map((fix) => ({ purl: fix.purl, upgradeVersion: fix.fixedVersion })), {
|
|
226445
|
+
const applyFixesStatus = await upgradePurl(path2, combinedFixes.map((fix) => ({ purl: fix.purl, upgradeVersion: fix.fixedVersion })), {
|
|
226437
226446
|
debug: options.debug,
|
|
226438
226447
|
silent: options.silent,
|
|
226439
226448
|
runWithoutDocker: options.runWithoutDocker,
|
|
226440
226449
|
manifestsTarHash: options.manifestsTarHash,
|
|
226441
226450
|
concurrency: "1",
|
|
226442
226451
|
globPattern: options.globPattern
|
|
226443
|
-
}, autofixRunId);
|
|
226452
|
+
}, autofixRunId) ?? "fixed-all";
|
|
226444
226453
|
if (autofixRunId) {
|
|
226445
|
-
await getSocketAPI().finalizeAutofixRun(autofixRunId, ghsasFailedToFix.length === 0 ? "fixed-all" : ghsasFailedToFix.length === Object.keys(ghsaToVulnerableArtifactIdsToApply).length ? "fixed-none" : "fixed-some");
|
|
226454
|
+
await getSocketAPI().finalizeAutofixRun(autofixRunId, ghsasFailedToFix.length === 0 && applyFixesStatus === "fixed-all" ? "fixed-all" : ghsasFailedToFix.length === Object.keys(ghsaToVulnerableArtifactIdsToApply).length || applyFixesStatus === "fixed-none" ? "fixed-none" : "fixed-some");
|
|
226446
226455
|
}
|
|
226447
226456
|
} catch (error) {
|
|
226448
226457
|
if (autofixRunId) {
|
|
@@ -226545,7 +226554,7 @@ function computeSBOMTaskArtifacts(dependencyTrees) {
|
|
|
226545
226554
|
}
|
|
226546
226555
|
|
|
226547
226556
|
// dist/index.js
|
|
226548
|
-
import { join as
|
|
226557
|
+
import { join as join27 } from "path";
|
|
226549
226558
|
var program2 = new Command();
|
|
226550
226559
|
var run2 = new Command();
|
|
226551
226560
|
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, NUGET and GO are supported. Default is all supported ecosystems.").addOption(new Option("--purl-types <purlTypes...>", "List of PURL types to analyze (space-separated). Currently npm, pypi, maven, nuget, golang and cargo are supported. Default is all supported purl types.").hideHelp()).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("--disable-analytics-sharing", "Disable analytics sharing.", 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.")).option("--ignore-failing-workspaces", "Continue processing when a workspace fails instead of exiting. Failed workspaces will be logged at termination.", false).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) => {
|
|
@@ -226563,7 +226572,7 @@ var upgradePurls = new Command();
|
|
|
226563
226572
|
upgradePurls.name("upgrade-purls").argument("<path>", "File system path to the folder containing the project").argument("<specs...>", "Package upgrade specifications in the format 'purl -> newVersion' (e.g., 'pkg:maven/io.micrometer/micrometer-core@1.10.9 -> 1.15.0')").option("-g, --glob <pattern>", "Glob pattern to filter workspaces by absolute file path").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("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).addOption(new Option("--run-without-docker", "Run package managers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--socket-mode", "Use Socket for computing dependency trees").default(process.env.SOCKET_MODE === "true").hideHelp()).version(version2).action(async (path2, specs2, options) => {
|
|
226564
226573
|
process.env.DOCKER_IMAGE_TAG ??= version2;
|
|
226565
226574
|
await withTmpDirectory("upgrade-purls", async (tmpDir) => {
|
|
226566
|
-
const logFile =
|
|
226575
|
+
const logFile = join27(tmpDir, "upgrade-purls.log");
|
|
226567
226576
|
logger.initWinstonLogger(options.debug, logFile);
|
|
226568
226577
|
const upgradeSpecs = specs2.map((spec) => {
|
|
226569
226578
|
const [purl, upgradeVersion] = spec.split("->").map((s4) => s4.trim());
|
|
@@ -226581,7 +226590,7 @@ var computeFixesAndUpgradePurlsCmd = new Command();
|
|
|
226581
226590
|
computeFixesAndUpgradePurlsCmd.name("compute-fixes-and-upgrade-purls").argument("<path>", "File system path to the folder containing the project").option("-a, --apply-fixes-to <ghsas...>", 'GHSA IDs to compute fixes for. Use "all" to compute fixes for all vulnerabilities.', []).option("--dry-run", "Show what changes would be made without actually making them", false).option("-g, --glob <pattern>", "Glob pattern to filter workspaces by absolute file path").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).addOption(new Option("--run-without-docker", "Run package managers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").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).action(async (path2, options) => {
|
|
226582
226591
|
process.env.DOCKER_IMAGE_TAG ??= version2;
|
|
226583
226592
|
await withTmpDirectory("compute-fixes-and-upgrade-purls", async (tmpDir) => {
|
|
226584
|
-
const logFile =
|
|
226593
|
+
const logFile = join27(tmpDir, "compute-fixes-and-upgrade-purls.log");
|
|
226585
226594
|
logger.initWinstonLogger(options.debug, logFile);
|
|
226586
226595
|
await computeFixesAndUpgradePurls(path2, options, logFile);
|
|
226587
226596
|
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/cli-with-sentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.99",
|
|
4
4
|
"description": "CLI for Socket.dev, includes Sentry error handling, otherwise identical to the regular `socket` package",
|
|
5
5
|
"homepage": "https://github.com/SocketDev/socket-cli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@babel/preset-typescript": "7.27.1",
|
|
87
87
|
"@babel/runtime": "7.28.3",
|
|
88
88
|
"@biomejs/biome": "2.2.2",
|
|
89
|
-
"@coana-tech/cli": "14.12.
|
|
89
|
+
"@coana-tech/cli": "14.12.3",
|
|
90
90
|
"@cyclonedx/cdxgen": "11.6.0",
|
|
91
91
|
"@dotenvx/dotenvx": "1.49.0",
|
|
92
92
|
"@eslint/compat": "1.3.2",
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
"@types/which": "3.0.4",
|
|
129
129
|
"@types/yargs-parser": "21.0.3",
|
|
130
130
|
"@typescript-eslint/parser": "8.41.0",
|
|
131
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
131
|
+
"@typescript/native-preview": "7.0.0-dev.20250829.3",
|
|
132
132
|
"@vitest/coverage-v8": "3.2.4",
|
|
133
133
|
"blessed": "0.1.81",
|
|
134
134
|
"blessed-contrib": "4.11.0",
|
|
135
|
-
"browserslist": "4.25.
|
|
135
|
+
"browserslist": "4.25.4",
|
|
136
136
|
"chalk-table": "1.0.2",
|
|
137
137
|
"cmd-shim": "7.0.0",
|
|
138
138
|
"custompatch": "1.1.8",
|
|
@@ -241,6 +241,6 @@
|
|
|
241
241
|
"strict": true
|
|
242
242
|
},
|
|
243
243
|
"dependencies": {
|
|
244
|
-
"@sentry/node": "10.
|
|
244
|
+
"@sentry/node": "10.8.0"
|
|
245
245
|
}
|
|
246
246
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SetupSdkOptions } from '../../utils/sdk.mts';
|
|
2
|
-
export type SuggestRepoSlugOptions = {
|
|
3
|
-
sdkOpts?: SetupSdkOptions | undefined;
|
|
4
|
-
};
|
|
5
|
-
export declare function suggestRepoSlug(orgSlug: string, options?: SuggestRepoSlugOptions | undefined): Promise<{
|
|
6
|
-
slug: string;
|
|
7
|
-
defaultBranch: string;
|
|
8
|
-
} | void>;
|
|
9
|
-
//# sourceMappingURL=suggest-repo-slug.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"suggest-repo-slug.d.mts","sourceRoot":"","sources":["../../../../src/commands/scan/suggest-repo-slug.mts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAA;CACtC,CAAA;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,sBAAsB,GAAG,SAAS,GAC3C,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB,GAAG,IAAI,CAAC,CA8FR"}
|