@socketsecurity/cli-with-sentry 1.5.0 → 1.6.1
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/CHANGELOG.md +12 -1
- package/README.md +5 -5
- package/dist/cli.js +74 -7
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/manifest-scripts/maven-extension/coana-maven-extension.jar +0 -0
- package/dist/manifest-scripts/socket-facts.init.gradle +9 -0
- package/dist/manifest-scripts/socket-facts.plugin.scala +17 -0
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
- package/dist/types/commands/manifest/scripts/assemble.d.mts.map +1 -1
- package/dist/types/commands/manifest/scripts/facts.d.mts +7 -0
- package/dist/types/commands/manifest/scripts/facts.d.mts.map +1 -1
- package/dist/types/commands/manifest/scripts/records.d.mts +3 -0
- package/dist/types/commands/manifest/scripts/records.d.mts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,24 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [1.6.1](https://github.com/SocketDev/socket-cli/releases/tag/v1.6.1) - 2026-10-08
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Updated the Coana CLI to v `15.12.2`.
|
|
11
|
+
|
|
12
|
+
## [1.6.0](https://github.com/SocketDev/socket-cli/releases/tag/v1.6.0) - 2026-10-07
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **`manifest`** — attribute direct JVM dependencies to subproject build files (#1581)
|
|
16
|
+
|
|
7
17
|
## [1.5.0](https://github.com/SocketDev/socket-cli/releases/tag/v1.5.0) - 2026-10-06
|
|
8
18
|
|
|
9
19
|
### Added
|
|
10
20
|
- `socket fix --allow-overrides` fixes a vulnerability that a parent package's version range blocks by writing an override or resolution that forces the fixed version under that parent, in npm, pnpm, Yarn Berry and Rush projects.
|
|
21
|
+
- Socket facts for multi-module Maven, Gradle and sbt builds now attribute each direct dependency to the subproject build files that pull it in, so the dashboard shows which module brought it in.
|
|
11
22
|
|
|
12
23
|
### Changed
|
|
13
|
-
- Updated the Coana CLI to v `15.12.
|
|
24
|
+
- Updated the Coana CLI to v `15.12.1`.
|
|
14
25
|
|
|
15
26
|
## [1.4.2](https://github.com/SocketDev/socket-cli/releases/tag/v1.4.2) - 2026-10-05
|
|
16
27
|
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Socket CLI
|
|
2
2
|
|
|
3
3
|
[](https://socket.dev/npm/package/socket)
|
|
4
|
-
[](https://twitter.com/SocketSecurity)
|
|
5
|
+
[](https://bsky.app/profile/socket.dev)
|
|
6
6
|
|
|
7
7
|
CLI for [Socket.dev](https://socket.dev) — scan dependencies, audit packages, apply security patches, and gate installs from your terminal or CI. This is the 1.x line of the published `socket` package on npm.
|
|
8
8
|
|
|
@@ -171,8 +171,8 @@ MIT
|
|
|
171
171
|
<br/>
|
|
172
172
|
<div align="center">
|
|
173
173
|
<picture>
|
|
174
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.
|
|
175
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.
|
|
176
|
-
<img width="324" height="104" alt="Socket" src="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.
|
|
174
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.6.1/assets/fleet/socket-combomark-dark.svg">
|
|
175
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.6.1/assets/fleet/socket-combomark-light.svg">
|
|
176
|
+
<img width="324" height="104" alt="Socket" src="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.6.1/assets/fleet/socket-combomark-light.svg">
|
|
177
177
|
</picture>
|
|
178
178
|
</div>
|
package/dist/cli.js
CHANGED
|
@@ -1817,6 +1817,8 @@ function reachMemoryLimitToMb(value) {
|
|
|
1817
1817
|
// No sources/targets here: those are local absolute paths, returned in-memory
|
|
1818
1818
|
// as ResolvedArtifactPaths, never serialized into the SBOM.
|
|
1819
1819
|
|
|
1820
|
+
// Relative to the facts file's directory.
|
|
1821
|
+
|
|
1820
1822
|
// Resolved on-disk paths for a --with-files run, keyed by coordinate. `targets`
|
|
1821
1823
|
// = classpath entries (jars / module output dirs); `sources` = module source
|
|
1822
1824
|
// roots.
|
|
@@ -2697,7 +2699,7 @@ function assembleFacts(parsed, opts = {}) {
|
|
|
2697
2699
|
for (const p of parsed.projects.values()) {
|
|
2698
2700
|
projectsByGav.set(gav(p.group, p.name, p.version), p);
|
|
2699
2701
|
}
|
|
2700
|
-
const components = buildComponents(finalNodes, projectsByGav);
|
|
2702
|
+
const components = buildComponents(finalNodes, projectsByGav, buildManifestFilesByCoord(parsed, directByRoot, perRoot));
|
|
2701
2703
|
const projects = opts.emitProjects === false ? [] : buildProjects(parsed, directByRoot, perRoot);
|
|
2702
2704
|
const metadata = {
|
|
2703
2705
|
format: 'socket-facts-sbom',
|
|
@@ -2806,7 +2808,30 @@ function mergeByCoordinate(perRoot) {
|
|
|
2806
2808
|
directByRoot
|
|
2807
2809
|
};
|
|
2808
2810
|
}
|
|
2809
|
-
function
|
|
2811
|
+
function buildManifestFilesByCoord(parsed, directByRoot, perRoot) {
|
|
2812
|
+
const buildFilesByCoord = new Map();
|
|
2813
|
+
for (const [rootId, ids] of directByRoot) {
|
|
2814
|
+
const projectKey = perRoot.get(rootId)?.projectKey ?? '';
|
|
2815
|
+
const buildFiles = parsed.projects.get(projectKey)?.buildFiles ?? [];
|
|
2816
|
+
for (const id of ids) {
|
|
2817
|
+
let set = buildFilesByCoord.get(id);
|
|
2818
|
+
if (!set) {
|
|
2819
|
+
set = new Set();
|
|
2820
|
+
buildFilesByCoord.set(id, set);
|
|
2821
|
+
}
|
|
2822
|
+
for (const f of buildFiles) {
|
|
2823
|
+
set.add(f);
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
return new Map([...buildFilesByCoord].map(({
|
|
2828
|
+
0: id,
|
|
2829
|
+
1: buildFiles
|
|
2830
|
+
}) => [id, [constants.default.DOT_SOCKET_DOT_FACTS_JSON, ...[...buildFiles].sort()].map(file => ({
|
|
2831
|
+
file
|
|
2832
|
+
}))]));
|
|
2833
|
+
}
|
|
2834
|
+
function buildComponents(finalNodes, projectsByGav, manifestFilesByCoord) {
|
|
2810
2835
|
return [...finalNodes.keys()].sort().map(id => {
|
|
2811
2836
|
const fn = finalNodes.get(id);
|
|
2812
2837
|
const c = fn.coord;
|
|
@@ -2843,6 +2868,10 @@ function buildComponents(finalNodes, projectsByGav) {
|
|
|
2843
2868
|
if (fn.children.size) {
|
|
2844
2869
|
comp.dependencies = [...fn.children].sort();
|
|
2845
2870
|
}
|
|
2871
|
+
const manifestFiles = manifestFilesByCoord.get(id);
|
|
2872
|
+
if (manifestFiles) {
|
|
2873
|
+
comp.manifestFiles = manifestFiles;
|
|
2874
|
+
}
|
|
2846
2875
|
return comp;
|
|
2847
2876
|
});
|
|
2848
2877
|
}
|
|
@@ -3159,6 +3188,7 @@ function serializeExcludePathPatterns(paths) {
|
|
|
3159
3188
|
// project projectKey group name version dir
|
|
3160
3189
|
// projectSrc projectKey path (--with-files only)
|
|
3161
3190
|
// projectTgt projectKey path (--with-files only)
|
|
3191
|
+
// projectBuild projectKey path (build-root-relative)
|
|
3162
3192
|
// root rootId projectKey config prod(0|1)
|
|
3163
3193
|
// node rootId coordId group name version ext classifier direct(0|1)
|
|
3164
3194
|
// edge rootId parentCoordId childCoordId
|
|
@@ -3227,7 +3257,8 @@ function parseRecords(text) {
|
|
|
3227
3257
|
version: '',
|
|
3228
3258
|
dir: '',
|
|
3229
3259
|
sources: [],
|
|
3230
|
-
targets: []
|
|
3260
|
+
targets: [],
|
|
3261
|
+
buildFiles: []
|
|
3231
3262
|
};
|
|
3232
3263
|
result.projects.set(key, p);
|
|
3233
3264
|
}
|
|
@@ -3263,6 +3294,11 @@ function parseRecords(text) {
|
|
|
3263
3294
|
project(f[1] ?? '').targets.push(f[2]);
|
|
3264
3295
|
}
|
|
3265
3296
|
break;
|
|
3297
|
+
case 'projectBuild':
|
|
3298
|
+
if (f[2]) {
|
|
3299
|
+
project(f[1] ?? '').buildFiles.push(f[2]);
|
|
3300
|
+
}
|
|
3301
|
+
break;
|
|
3266
3302
|
case 'root':
|
|
3267
3303
|
{
|
|
3268
3304
|
const r = root(f[1] ?? '');
|
|
@@ -8998,6 +9034,18 @@ function readWrittenFiles(outputFile) {
|
|
|
8998
9034
|
const files = result?.modifiedFiles;
|
|
8999
9035
|
return Array.isArray(files) && files.every(f => typeof f === 'string') ? new Set(files) : undefined;
|
|
9000
9036
|
}
|
|
9037
|
+
// Coana exits with this code after writing an --output-file that lists computed fixes it left unapplied.
|
|
9038
|
+
const COANA_FIXES_NOT_APPLIED_EXIT_CODE = 5;
|
|
9039
|
+
function isFixesNotAppliedExit(result) {
|
|
9040
|
+
return !result.ok && result.data?.code === COANA_FIXES_NOT_APPLIED_EXIT_CODE;
|
|
9041
|
+
}
|
|
9042
|
+
function readNotAppliedFixes(fixesResultJson) {
|
|
9043
|
+
const notApplied = fixesResultJson?.notApplied;
|
|
9044
|
+
return Array.isArray(notApplied) ? notApplied : [];
|
|
9045
|
+
}
|
|
9046
|
+
function formatNotAppliedFixes(notApplied) {
|
|
9047
|
+
return notApplied.map(f => ` ${f.ghsa}: ${f.purl} -> ${f.fixedVersion}: ${f.reason}`).join('\n');
|
|
9048
|
+
}
|
|
9001
9049
|
async function coanaFix(fixConfig) {
|
|
9002
9050
|
if (!fixConfig.dynamicSbomInference) {
|
|
9003
9051
|
return await coanaFixWithFacts(fixConfig, undefined);
|
|
@@ -9214,7 +9262,7 @@ async function coanaFixWithFacts(fixConfig, factsSlot) {
|
|
|
9214
9262
|
if (!silence) {
|
|
9215
9263
|
spinner?.stop();
|
|
9216
9264
|
}
|
|
9217
|
-
if (!fixCResult.ok) {
|
|
9265
|
+
if (!fixCResult.ok && !isFixesNotAppliedExit(fixCResult)) {
|
|
9218
9266
|
return fixCResult;
|
|
9219
9267
|
}
|
|
9220
9268
|
|
|
@@ -9231,11 +9279,24 @@ async function coanaFixWithFacts(fixConfig, factsSlot) {
|
|
|
9231
9279
|
const tmpContent = await fs$1.promises.readFile(tmpFile, 'utf8');
|
|
9232
9280
|
await fs$1.promises.writeFile(outputFile, tmpContent, 'utf8');
|
|
9233
9281
|
}
|
|
9282
|
+
const ghsaDetails = fixesResultJson ? [fixesResultJson] : [];
|
|
9283
|
+
const notApplied = readNotAppliedFixes(fixesResultJson);
|
|
9284
|
+
if (!fixCResult.ok || notApplied.length) {
|
|
9285
|
+
return {
|
|
9286
|
+
ok: false,
|
|
9287
|
+
message: fixesResultJson?.type === 'no-fixes-applied' ? 'No computed fixes were applied' : 'Some computed fixes were not applied',
|
|
9288
|
+
cause: formatNotAppliedFixes(notApplied),
|
|
9289
|
+
data: {
|
|
9290
|
+
fixedAll: false,
|
|
9291
|
+
ghsaDetails
|
|
9292
|
+
}
|
|
9293
|
+
};
|
|
9294
|
+
}
|
|
9234
9295
|
return {
|
|
9235
9296
|
ok: true,
|
|
9236
9297
|
data: {
|
|
9237
9298
|
fixedAll: true,
|
|
9238
|
-
ghsaDetails
|
|
9299
|
+
ghsaDetails
|
|
9239
9300
|
}
|
|
9240
9301
|
};
|
|
9241
9302
|
} finally {
|
|
@@ -9342,7 +9403,13 @@ async function coanaFixWithFacts(fixConfig, factsSlot) {
|
|
|
9342
9403
|
spinner: silence ? undefined : spinner,
|
|
9343
9404
|
stdio: silence ? 'pipe' : 'inherit'
|
|
9344
9405
|
});
|
|
9345
|
-
if (
|
|
9406
|
+
if (isFixesNotAppliedExit(fixCResult)) {
|
|
9407
|
+
if (!silence) {
|
|
9408
|
+
logger.logger.warn(`Not every fix for ${ghsaId} was applied:\n${formatNotAppliedFixes(readNotAppliedFixes(fs$2.readJsonSync(tmpFile, {
|
|
9409
|
+
throws: false
|
|
9410
|
+
})))}`);
|
|
9411
|
+
}
|
|
9412
|
+
} else if (!fixCResult.ok) {
|
|
9346
9413
|
if (!silence) {
|
|
9347
9414
|
logger.logger.error(`Update failed for ${ghsaId}: ${utils.getErrorCause(fixCResult)}`);
|
|
9348
9415
|
}
|
|
@@ -24431,5 +24498,5 @@ process.on('unhandledRejection', async (reason, promise) => {
|
|
|
24431
24498
|
// eslint-disable-next-line n/no-process-exit
|
|
24432
24499
|
process.exit(1);
|
|
24433
24500
|
});
|
|
24434
|
-
//# debugId=
|
|
24501
|
+
//# debugId=e70a53df-f766-401c-8399-eee0c4d48cc7
|
|
24435
24502
|
//# sourceMappingURL=cli.js.map
|