socket 1.1.158 → 1.1.160
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 +5 -0
- package/README.md +5 -5
- package/dist/cli.js +143 -100
- 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/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-reach.d.mts +1 -1
- package/dist/types/commands/scan/handle-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/reachability-flags.d.mts +4 -0
- package/dist/types/commands/scan/reachability-flags.d.mts.map +1 -1
- package/dist/types/commands/scan/run-dynamic-sbom-inference.d.mts +18 -0
- package/dist/types/commands/scan/run-dynamic-sbom-inference.d.mts.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ 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.1.160](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.160) - 2026-08-26
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Updated the Coana CLI to v `15.10.24`.
|
|
11
|
+
|
|
7
12
|
## [1.1.158](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.158) - 2026-08-17
|
|
8
13
|
|
|
9
14
|
### Changed
|
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
|
|
|
@@ -138,8 +138,8 @@ MIT
|
|
|
138
138
|
<br/>
|
|
139
139
|
<div align="center">
|
|
140
140
|
<picture>
|
|
141
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.1.
|
|
142
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.1.
|
|
143
|
-
<img width="324" height="104" alt="Socket" src="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.1.
|
|
141
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.1.160/assets/fleet/socket-combomark-dark.svg">
|
|
142
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.1.160/assets/fleet/socket-combomark-light.svg">
|
|
143
|
+
<img width="324" height="104" alt="Socket" src="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.1.160/assets/fleet/socket-combomark-light.svg">
|
|
144
144
|
</picture>
|
|
145
145
|
</div>
|
package/dist/cli.js
CHANGED
|
@@ -2087,69 +2087,6 @@ async function performReachabilityAnalysis(options) {
|
|
|
2087
2087
|
}
|
|
2088
2088
|
}
|
|
2089
2089
|
|
|
2090
|
-
// The point here is to attempt to detect the various supported manifest files
|
|
2091
|
-
// the CLI can generate. This would be environments that we can't do server side
|
|
2092
|
-
|
|
2093
|
-
async function detectManifestActions(
|
|
2094
|
-
// Passing in null means we attempt detection for every supported language
|
|
2095
|
-
// regardless of local socket.json status. Sometimes we want that.
|
|
2096
|
-
sockJson, cwd = process.cwd()) {
|
|
2097
|
-
const output = {
|
|
2098
|
-
bazel: false,
|
|
2099
|
-
cdxgen: false,
|
|
2100
|
-
// TODO
|
|
2101
|
-
count: 0,
|
|
2102
|
-
conda: false,
|
|
2103
|
-
gradle: false,
|
|
2104
|
-
maven: false,
|
|
2105
|
-
sbt: false
|
|
2106
|
-
};
|
|
2107
|
-
if (sockJson?.defaults?.manifest?.bazel?.disabled) {
|
|
2108
|
-
debug.debugLog('notice', `[DEBUG] - bazel auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
2109
|
-
} else if (fs$1.existsSync(path.join(cwd, 'MODULE.bazel')) || fs$1.existsSync(path.join(cwd, 'WORKSPACE')) || fs$1.existsSync(path.join(cwd, 'WORKSPACE.bazel'))) {
|
|
2110
|
-
debug.debugLog('notice', '[DEBUG] - Detected a Bazel workspace');
|
|
2111
|
-
output.bazel = true;
|
|
2112
|
-
output.count += 1;
|
|
2113
|
-
}
|
|
2114
|
-
if (sockJson?.defaults?.manifest?.sbt?.disabled) {
|
|
2115
|
-
debug.debugLog('notice', `[DEBUG] - sbt auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
2116
|
-
} else if (fs$1.existsSync(path.join(cwd, 'build.sbt'))) {
|
|
2117
|
-
debug.debugLog('notice', '[DEBUG] - Detected a Scala sbt build file');
|
|
2118
|
-
output.sbt = true;
|
|
2119
|
-
output.count += 1;
|
|
2120
|
-
}
|
|
2121
|
-
if (sockJson?.defaults?.manifest?.gradle?.disabled) {
|
|
2122
|
-
debug.debugLog('notice', `[DEBUG] - gradle auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
2123
|
-
} else if (fs$1.existsSync(path.join(cwd, 'build.gradle')) || fs$1.existsSync(path.join(cwd, 'build.gradle.kts')) || fs$1.existsSync(path.join(cwd, 'settings.gradle')) || fs$1.existsSync(path.join(cwd, 'settings.gradle.kts'))) {
|
|
2124
|
-
// Detect by build descriptor, not the `gradlew` wrapper (a project can build via
|
|
2125
|
-
// `gradle` on PATH). `settings.gradle(.kts)` covers Kotlin-DSL roots with no root build script.
|
|
2126
|
-
debug.debugLog('notice', '[DEBUG] - Detected a gradle build file');
|
|
2127
|
-
output.gradle = true;
|
|
2128
|
-
output.count += 1;
|
|
2129
|
-
}
|
|
2130
|
-
if (sockJson?.defaults?.manifest?.maven?.disabled) {
|
|
2131
|
-
debug.debugLog('notice', `[DEBUG] - maven auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
2132
|
-
} else if (fs$1.existsSync(path.join(cwd, 'pom.xml'))) {
|
|
2133
|
-
debug.debugLog('notice', '[DEBUG] - Detected a Maven pom.xml build file');
|
|
2134
|
-
output.maven = true;
|
|
2135
|
-
output.count += 1;
|
|
2136
|
-
}
|
|
2137
|
-
if (sockJson?.defaults?.manifest?.conda?.disabled) {
|
|
2138
|
-
debug.debugLog('notice', `[DEBUG] - conda auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
2139
|
-
} else {
|
|
2140
|
-
const envyml = path.join(cwd, constants.ENVIRONMENT_YML);
|
|
2141
|
-
const hasEnvyml = fs$1.existsSync(envyml);
|
|
2142
|
-
const envyaml = path.join(cwd, constants.ENVIRONMENT_YAML);
|
|
2143
|
-
const hasEnvyaml = !hasEnvyml && fs$1.existsSync(envyaml);
|
|
2144
|
-
if (hasEnvyml || hasEnvyaml) {
|
|
2145
|
-
debug.debugLog('notice', '[DEBUG] - Detected an environment.yml Conda file');
|
|
2146
|
-
output.conda = true;
|
|
2147
|
-
output.count += 1;
|
|
2148
|
-
}
|
|
2149
|
-
}
|
|
2150
|
-
return output;
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
2090
|
const BUILD_TOOLS = ['gradle', 'maven', 'sbt'];
|
|
2154
2091
|
|
|
2155
2092
|
// One glob-suffix set per ecosystem's build-descriptor marker(s); `settings.gradle(.kts)`
|
|
@@ -4028,6 +3965,104 @@ function resolveEcosystemConfig(ecosystem, dir, sockJson) {
|
|
|
4028
3965
|
};
|
|
4029
3966
|
}
|
|
4030
3967
|
|
|
3968
|
+
// Recursively discovers and generates Socket facts for every independent
|
|
3969
|
+
// gradle/sbt/maven build root under `cwd`, returning the generated facts
|
|
3970
|
+
// paths plus the resolved-paths sidecar that reachability forwards to Coana.
|
|
3971
|
+
async function runDynamicSbomInference({
|
|
3972
|
+
cwd,
|
|
3973
|
+
excludePaths,
|
|
3974
|
+
sbtTmpDir,
|
|
3975
|
+
withFiles
|
|
3976
|
+
}) {
|
|
3977
|
+
const sidecarAcc = withFiles ? new Map() : undefined;
|
|
3978
|
+
const outcomes = await generateRecursiveManifests({
|
|
3979
|
+
cwd,
|
|
3980
|
+
excludePaths,
|
|
3981
|
+
sbtTmpDir: withFiles ? sbtTmpDir : undefined,
|
|
3982
|
+
sidecarAcc,
|
|
3983
|
+
verbose: false,
|
|
3984
|
+
withFiles
|
|
3985
|
+
});
|
|
3986
|
+
// No candidates discovered at all (distinct from candidates that were found
|
|
3987
|
+
// but produced no generated facts - empty/skippedDisabled are already warned
|
|
3988
|
+
// about elsewhere and are not this kind of mistake).
|
|
3989
|
+
if (!outcomes.length) {
|
|
3990
|
+
throw new utils.InputError(['No Gradle, sbt, or Maven build root was found.', '', '- Remove --dynamic-sbom-inference; it only applies to these ecosystems.', '- Make sure to run it from the correct dir (use --cwd to target another dir).'].join('\n'));
|
|
3991
|
+
}
|
|
3992
|
+
// Fail loud rather than silently proceed with a partial multi-root result:
|
|
3993
|
+
// matches handleManifestDynamicSbomInference's own check.
|
|
3994
|
+
if (outcomes.some(o => o.status === 'failed')) {
|
|
3995
|
+
throw new utils.InputError('One or more independent build roots failed to generate Socket facts; aborting (see the errors above).');
|
|
3996
|
+
}
|
|
3997
|
+
return {
|
|
3998
|
+
factsPaths: outcomes.filter(o => o.status === 'generated').map(o => o.factsPath),
|
|
3999
|
+
resolvedPathsSidecar: sidecarAcc && hasSidecarEntries(sidecarAcc) ? serializeSidecar(sidecarAcc) : undefined
|
|
4000
|
+
};
|
|
4001
|
+
}
|
|
4002
|
+
|
|
4003
|
+
// The point here is to attempt to detect the various supported manifest files
|
|
4004
|
+
// the CLI can generate. This would be environments that we can't do server side
|
|
4005
|
+
|
|
4006
|
+
async function detectManifestActions(
|
|
4007
|
+
// Passing in null means we attempt detection for every supported language
|
|
4008
|
+
// regardless of local socket.json status. Sometimes we want that.
|
|
4009
|
+
sockJson, cwd = process.cwd()) {
|
|
4010
|
+
const output = {
|
|
4011
|
+
bazel: false,
|
|
4012
|
+
cdxgen: false,
|
|
4013
|
+
// TODO
|
|
4014
|
+
count: 0,
|
|
4015
|
+
conda: false,
|
|
4016
|
+
gradle: false,
|
|
4017
|
+
maven: false,
|
|
4018
|
+
sbt: false
|
|
4019
|
+
};
|
|
4020
|
+
if (sockJson?.defaults?.manifest?.bazel?.disabled) {
|
|
4021
|
+
debug.debugLog('notice', `[DEBUG] - bazel auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
4022
|
+
} else if (fs$1.existsSync(path.join(cwd, 'MODULE.bazel')) || fs$1.existsSync(path.join(cwd, 'WORKSPACE')) || fs$1.existsSync(path.join(cwd, 'WORKSPACE.bazel'))) {
|
|
4023
|
+
debug.debugLog('notice', '[DEBUG] - Detected a Bazel workspace');
|
|
4024
|
+
output.bazel = true;
|
|
4025
|
+
output.count += 1;
|
|
4026
|
+
}
|
|
4027
|
+
if (sockJson?.defaults?.manifest?.sbt?.disabled) {
|
|
4028
|
+
debug.debugLog('notice', `[DEBUG] - sbt auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
4029
|
+
} else if (fs$1.existsSync(path.join(cwd, 'build.sbt'))) {
|
|
4030
|
+
debug.debugLog('notice', '[DEBUG] - Detected a Scala sbt build file');
|
|
4031
|
+
output.sbt = true;
|
|
4032
|
+
output.count += 1;
|
|
4033
|
+
}
|
|
4034
|
+
if (sockJson?.defaults?.manifest?.gradle?.disabled) {
|
|
4035
|
+
debug.debugLog('notice', `[DEBUG] - gradle auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
4036
|
+
} else if (fs$1.existsSync(path.join(cwd, 'build.gradle')) || fs$1.existsSync(path.join(cwd, 'build.gradle.kts')) || fs$1.existsSync(path.join(cwd, 'settings.gradle')) || fs$1.existsSync(path.join(cwd, 'settings.gradle.kts'))) {
|
|
4037
|
+
// Detect by build descriptor, not the `gradlew` wrapper (a project can build via
|
|
4038
|
+
// `gradle` on PATH). `settings.gradle(.kts)` covers Kotlin-DSL roots with no root build script.
|
|
4039
|
+
debug.debugLog('notice', '[DEBUG] - Detected a gradle build file');
|
|
4040
|
+
output.gradle = true;
|
|
4041
|
+
output.count += 1;
|
|
4042
|
+
}
|
|
4043
|
+
if (sockJson?.defaults?.manifest?.maven?.disabled) {
|
|
4044
|
+
debug.debugLog('notice', `[DEBUG] - maven auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
4045
|
+
} else if (fs$1.existsSync(path.join(cwd, 'pom.xml'))) {
|
|
4046
|
+
debug.debugLog('notice', '[DEBUG] - Detected a Maven pom.xml build file');
|
|
4047
|
+
output.maven = true;
|
|
4048
|
+
output.count += 1;
|
|
4049
|
+
}
|
|
4050
|
+
if (sockJson?.defaults?.manifest?.conda?.disabled) {
|
|
4051
|
+
debug.debugLog('notice', `[DEBUG] - conda auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
4052
|
+
} else {
|
|
4053
|
+
const envyml = path.join(cwd, constants.ENVIRONMENT_YML);
|
|
4054
|
+
const hasEnvyml = fs$1.existsSync(envyml);
|
|
4055
|
+
const envyaml = path.join(cwd, constants.ENVIRONMENT_YAML);
|
|
4056
|
+
const hasEnvyaml = !hasEnvyml && fs$1.existsSync(envyaml);
|
|
4057
|
+
if (hasEnvyml || hasEnvyaml) {
|
|
4058
|
+
debug.debugLog('notice', '[DEBUG] - Detected an environment.yml Conda file');
|
|
4059
|
+
output.conda = true;
|
|
4060
|
+
output.count += 1;
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
return output;
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4031
4066
|
/**
|
|
4032
4067
|
* Resolve the bazel binary to invoke for `socket manifest bazel`.
|
|
4033
4068
|
*
|
|
@@ -7125,36 +7160,19 @@ async function handleCreateNewScan({
|
|
|
7125
7160
|
detected.gradle = false;
|
|
7126
7161
|
detected.sbt = false;
|
|
7127
7162
|
detected.maven = false;
|
|
7128
|
-
const
|
|
7129
|
-
const outcomes = await generateRecursiveManifests({
|
|
7163
|
+
const dynamicResult = await runDynamicSbomInference({
|
|
7130
7164
|
cwd,
|
|
7131
7165
|
excludePaths: reach.excludePaths,
|
|
7132
7166
|
// sbt's Scala toolchain lives under its shared global base;
|
|
7133
7167
|
// withFiles' resolved paths point into it, so when reachability
|
|
7134
7168
|
// will consume them afterward, reuse manifestTmpDir (kept alive
|
|
7135
|
-
// until reach finishes below) instead of letting
|
|
7169
|
+
// until reach finishes below) instead of letting the call clean
|
|
7136
7170
|
// its own ephemeral base up before reach ever reads those paths.
|
|
7137
|
-
sbtTmpDir:
|
|
7138
|
-
sidecarAcc,
|
|
7139
|
-
verbose: false,
|
|
7171
|
+
sbtTmpDir: manifestTmpDir,
|
|
7140
7172
|
withFiles: reach.runReachabilityAnalysis
|
|
7141
7173
|
});
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
// already warned about elsewhere and are not this kind of mistake).
|
|
7145
|
-
if (!outcomes.length) {
|
|
7146
|
-
throw new utils.InputError(['No Gradle, sbt, or Maven build root was found.', '', '- Remove --dynamic-sbom-inference; it only applies to these ecosystems.', '- Make sure to run it from the correct dir (use --cwd to target another dir).'].join('\n'));
|
|
7147
|
-
}
|
|
7148
|
-
// Fail loud rather than silently upload a partial multi-root scan:
|
|
7149
|
-
// matches handleManifestDynamicSbomInference's own check.
|
|
7150
|
-
if (outcomes.some(o => o.status === 'failed')) {
|
|
7151
|
-
throw new utils.InputError('One or more independent build roots failed to generate Socket facts; aborting (see the errors above).');
|
|
7152
|
-
}
|
|
7153
|
-
const generatedFactsPaths = outcomes.filter(o => o.status === 'generated').map(o => o.factsPath);
|
|
7154
|
-
scanTargets = Array.from(new Set([...scanTargets, ...generatedFactsPaths]));
|
|
7155
|
-
if (sidecarAcc && hasSidecarEntries(sidecarAcc)) {
|
|
7156
|
-
resolvedPathsSidecar = serializeSidecar(sidecarAcc);
|
|
7157
|
-
}
|
|
7174
|
+
scanTargets = Array.from(new Set([...scanTargets, ...dynamicResult.factsPaths]));
|
|
7175
|
+
resolvedPathsSidecar = dynamicResult.resolvedPathsSidecar;
|
|
7158
7176
|
}
|
|
7159
7177
|
const autoManifestResult = await generateAutoManifest({
|
|
7160
7178
|
computeArtifactsSidecar: reach.runReachabilityAnalysis,
|
|
@@ -19266,11 +19284,15 @@ const cmdRepository = {
|
|
|
19266
19284
|
}
|
|
19267
19285
|
};
|
|
19268
19286
|
|
|
19287
|
+
// Shared prefix so each command can append how it obtains the per-build-root
|
|
19288
|
+
// SBOMs, which differs: `scan create` piggybacks on --auto-manifest, while
|
|
19289
|
+
// `scan reach` runs the build tools itself.
|
|
19290
|
+
const DYNAMIC_SBOM_INFERENCE_DESCRIPTION = 'For Gradle, sbt, and Maven: splits reachability analysis per project/module using a Socket facts SBOM (generated directly by each package manager) per build root, instead of one synthetic root.';
|
|
19269
19291
|
const reachabilityFlags = {
|
|
19270
19292
|
dynamicSbomInference: {
|
|
19271
19293
|
type: 'boolean',
|
|
19272
19294
|
default: false,
|
|
19273
|
-
description:
|
|
19295
|
+
description: `${DYNAMIC_SBOM_INFERENCE_DESCRIPTION} Reachability analysis only; implies --auto-manifest.`
|
|
19274
19296
|
},
|
|
19275
19297
|
reachVersion: {
|
|
19276
19298
|
type: 'string',
|
|
@@ -21792,7 +21814,7 @@ async function outputScanReach(result, {
|
|
|
21792
21814
|
}
|
|
21793
21815
|
}
|
|
21794
21816
|
|
|
21795
|
-
async function
|
|
21817
|
+
async function runScanReach({
|
|
21796
21818
|
cwd,
|
|
21797
21819
|
interactive: _interactive,
|
|
21798
21820
|
orgSlug,
|
|
@@ -21800,11 +21822,28 @@ async function handleScanReach({
|
|
|
21800
21822
|
outputPath,
|
|
21801
21823
|
reachabilityOptions,
|
|
21802
21824
|
targets
|
|
21803
|
-
}) {
|
|
21825
|
+
}, sbtTmpDir) {
|
|
21804
21826
|
const {
|
|
21805
21827
|
spinner
|
|
21806
21828
|
} = constants.default;
|
|
21807
21829
|
|
|
21830
|
+
// Extra discovery targets beyond the user's own; the reachability target
|
|
21831
|
+
// itself stays `targets[0]`.
|
|
21832
|
+
let scanTargets = targets;
|
|
21833
|
+
// Sidecar forwarded to reachability; populated by dynamic SBOM inference.
|
|
21834
|
+
let resolvedPathsSidecar;
|
|
21835
|
+
if (reachabilityOptions.dynamicSbomInference) {
|
|
21836
|
+
logger.logger.info('Generating Socket facts for each Gradle, sbt, and Maven build root ...');
|
|
21837
|
+
const dynamicResult = await runDynamicSbomInference({
|
|
21838
|
+
cwd,
|
|
21839
|
+
excludePaths: reachabilityOptions.excludePaths,
|
|
21840
|
+
sbtTmpDir,
|
|
21841
|
+
withFiles: true
|
|
21842
|
+
});
|
|
21843
|
+
scanTargets = Array.from(new Set([...scanTargets, ...dynamicResult.factsPaths]));
|
|
21844
|
+
resolvedPathsSidecar = dynamicResult.resolvedPathsSidecar;
|
|
21845
|
+
}
|
|
21846
|
+
|
|
21808
21847
|
// Get supported file names.
|
|
21809
21848
|
const supportedFilesCResult = await fetchSupportedScanFileNames({
|
|
21810
21849
|
orgSlug,
|
|
@@ -21832,7 +21871,7 @@ async function handleScanReach({
|
|
|
21832
21871
|
reachabilityOptions,
|
|
21833
21872
|
target: targets[0]
|
|
21834
21873
|
});
|
|
21835
|
-
const packagePaths = await utils.getPackageFilesForScan(
|
|
21874
|
+
const packagePaths = await utils.getPackageFilesForScan(scanTargets, supportedFiles, {
|
|
21836
21875
|
additionalIgnores: additionalScaIgnores,
|
|
21837
21876
|
config: socketConfig,
|
|
21838
21877
|
cwd
|
|
@@ -21856,6 +21895,7 @@ async function handleScanReach({
|
|
|
21856
21895
|
outputPath,
|
|
21857
21896
|
packagePaths,
|
|
21858
21897
|
reachabilityOptions: mergedReachabilityOptions,
|
|
21898
|
+
resolvedPathsSidecar,
|
|
21859
21899
|
spinner,
|
|
21860
21900
|
target: targets[0],
|
|
21861
21901
|
uploadManifests: true
|
|
@@ -21881,23 +21921,26 @@ async function handleScanReach({
|
|
|
21881
21921
|
outputPath
|
|
21882
21922
|
});
|
|
21883
21923
|
}
|
|
21924
|
+
async function handleScanReach(config) {
|
|
21925
|
+
// sbt provisions its Scala toolchain under the directory passed as its
|
|
21926
|
+
// isolated global base; the sidecar's artifactPaths point into it, so it
|
|
21927
|
+
// must stay on disk until the reachability analysis has consumed them.
|
|
21928
|
+
return config.reachabilityOptions.dynamicSbomInference ? await utils.withTmpDir('socket-dynamic-sbom-inference-', tmpDir => runScanReach(config, tmpDir)) : await runScanReach(config, undefined);
|
|
21929
|
+
}
|
|
21884
21930
|
|
|
21885
21931
|
const CMD_NAME$4 = 'reach';
|
|
21886
21932
|
const description$6 = 'Compute full application reachability';
|
|
21887
21933
|
const hidden$4 = true;
|
|
21888
21934
|
|
|
21889
|
-
//
|
|
21890
|
-
//
|
|
21891
|
-
//
|
|
21892
|
-
// otherwise public on `scan create`, since advertising a flag this command
|
|
21893
|
-
// silently ignores would be misleading.
|
|
21935
|
+
// `scan create` gets its per-build-root facts from --auto-manifest, a flag
|
|
21936
|
+
// this command doesn't have; here the build tools are run directly instead,
|
|
21937
|
+
// so the flag's description differs.
|
|
21894
21938
|
const reachabilityFlagsForReach = {
|
|
21895
21939
|
...reachabilityFlags,
|
|
21896
21940
|
dynamicSbomInference: {
|
|
21897
21941
|
type: 'boolean',
|
|
21898
21942
|
default: false,
|
|
21899
|
-
|
|
21900
|
-
description: reachabilityFlags['dynamicSbomInference'].description
|
|
21943
|
+
description: `${DYNAMIC_SBOM_INFERENCE_DESCRIPTION} Each discovered build root is built first to generate its SBOM.`
|
|
21901
21944
|
}
|
|
21902
21945
|
};
|
|
21903
21946
|
const generalFlags = {
|
|
@@ -21965,6 +22008,7 @@ async function run$7(argv, importMeta, {
|
|
|
21965
22008
|
$ ${command}
|
|
21966
22009
|
$ ${command} ./proj
|
|
21967
22010
|
$ ${command} ./proj --reach-ecosystems npm,pypi
|
|
22011
|
+
$ ${command} ./monorepo --dynamic-sbom-inference
|
|
21968
22012
|
$ ${command} --output custom-report.json
|
|
21969
22013
|
$ ${command} ./proj --output ./reports/analysis.json
|
|
21970
22014
|
`
|
|
@@ -21977,6 +22021,7 @@ async function run$7(argv, importMeta, {
|
|
|
21977
22021
|
});
|
|
21978
22022
|
const {
|
|
21979
22023
|
cwd: cwdOverride,
|
|
22024
|
+
dynamicSbomInference,
|
|
21980
22025
|
interactive = true,
|
|
21981
22026
|
json,
|
|
21982
22027
|
markdown,
|
|
@@ -22084,9 +22129,7 @@ async function run$7(argv, importMeta, {
|
|
|
22084
22129
|
outputKind,
|
|
22085
22130
|
outputPath: outputPath || '',
|
|
22086
22131
|
reachabilityOptions: {
|
|
22087
|
-
|
|
22088
|
-
// Socket facts first, which `socket scan reach` never runs.
|
|
22089
|
-
dynamicSbomInference: false,
|
|
22132
|
+
dynamicSbomInference: Boolean(dynamicSbomInference),
|
|
22090
22133
|
excludePaths,
|
|
22091
22134
|
reachAnalysisMemoryLimit,
|
|
22092
22135
|
reachAnalysisTimeout,
|
|
@@ -24053,5 +24096,5 @@ process.on('unhandledRejection', async (reason, promise) => {
|
|
|
24053
24096
|
// eslint-disable-next-line n/no-process-exit
|
|
24054
24097
|
process.exit(1);
|
|
24055
24098
|
});
|
|
24056
|
-
//# debugId=
|
|
24099
|
+
//# debugId=5f7c5659-2323-4182-a73a-b5a96997ea01
|
|
24057
24100
|
//# sourceMappingURL=cli.js.map
|