Skip to content

Commit 783f875

Browse files
feat(scan): add --reach-disable-dependency-downloads (#1668)
Passes Coana's --disable-dependency-downloads, which limits reachability analysis to dependencies that are already installed.
1 parent 31064f6 commit 783f875

14 files changed

Lines changed: 42 additions & 0 deletions

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [Unreleased]
8+
9+
### Added
10+
- `--reach-disable-dependency-downloads` limits reachability analysis to already-installed dependencies.
11+
712
## [1.11.2](https://github.com/SocketDev/socket-cli/releases/tag/v1.11.2) - 2026-10-29
813

914
### Changed

‎src/commands/ci/handle-ci.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export async function handleCi(autoManifest: boolean): Promise<void> {
7878
reachDebug: false,
7979
reachDetailedAnalysisLogFile: false,
8080
reachDisableAnalytics: false,
81+
reachDisableDependencyDownloads: false,
8182
reachDisableExternalToolChecks: false,
8283
reachEcosystems: [],
8384
reachEnableAnalysisSplitting: false,

‎src/commands/scan/cmd-scan-create.mts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ async function run(
297297
reachDetailedAnalysisLogFile,
298298
reachDisableAnalysisSplitting: _reachDisableAnalysisSplitting,
299299
reachDisableAnalytics,
300+
reachDisableDependencyDownloads,
300301
reachDisableExternalToolChecks,
301302
reachEnableAnalysisSplitting,
302303
reachFallbackToRegularScan,
@@ -338,6 +339,7 @@ async function run(
338339
reachDetailedAnalysisLogFile: boolean
339340
reachDisableAnalysisSplitting: boolean
340341
reachDisableAnalytics: boolean
342+
reachDisableDependencyDownloads: boolean
341343
reachDisableExternalToolChecks: boolean
342344
reachEnableAnalysisSplitting: boolean
343345
reachFallbackToRegularScan: boolean
@@ -704,6 +706,7 @@ async function run(
704706
reachDebug: Boolean(reachDebug),
705707
reachDetailedAnalysisLogFile: Boolean(reachDetailedAnalysisLogFile),
706708
reachDisableAnalytics: Boolean(reachDisableAnalytics),
709+
reachDisableDependencyDownloads: Boolean(reachDisableDependencyDownloads),
707710
reachDisableExternalToolChecks: Boolean(reachDisableExternalToolChecks),
708711
reachEcosystems,
709712
reachEnableAnalysisSplitting: Boolean(reachEnableAnalysisSplitting),

‎src/commands/scan/cmd-scan-create.test.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ describe('socket scan create', async () => {
133133
--reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.
134134
--reach-detailed-analysis-log-file A log file with detailed analysis logs is written to root of each analyzed workspace.
135135
--reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations.
136+
--reach-disable-dependency-downloads Only analyze dependencies that are already installed (e.g. in the project's .venv, vendor directory or module cache). Missing dependencies count as installation failures.
136137
--reach-disable-external-tool-checks Disable external tool checks during reachability analysis.
137138
--reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Supported: cargo, composer, gem, golang, maven, npm, nuget, pypi. Defaults to all supported ecosystems.
138139
--reach-enable-analysis-splitting Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.

‎src/commands/scan/cmd-scan-reach.mts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ async function run(
162162
reachDetailedAnalysisLogFile,
163163
reachDisableAnalysisSplitting: _reachDisableAnalysisSplitting,
164164
reachDisableAnalytics,
165+
reachDisableDependencyDownloads,
165166
reachDisableExternalToolChecks,
166167
reachEnableAnalysisSplitting,
167168
reachLazyMode: _reachLazyMode,
@@ -188,6 +189,7 @@ async function run(
188189
reachDetailedAnalysisLogFile: boolean
189190
reachDisableAnalysisSplitting: boolean
190191
reachDisableAnalytics: boolean
192+
reachDisableDependencyDownloads: boolean
191193
reachDisableExternalToolChecks: boolean
192194
reachEnableAnalysisSplitting: boolean
193195
reachLazyMode: boolean
@@ -314,6 +316,7 @@ async function run(
314316
reachDebug: Boolean(reachDebug),
315317
reachDetailedAnalysisLogFile: Boolean(reachDetailedAnalysisLogFile),
316318
reachDisableAnalytics: Boolean(reachDisableAnalytics),
319+
reachDisableDependencyDownloads: Boolean(reachDisableDependencyDownloads),
317320
reachDisableExternalToolChecks: Boolean(reachDisableExternalToolChecks),
318321
reachEcosystems,
319322
reachEnableAnalysisSplitting: Boolean(reachEnableAnalysisSplitting),

‎src/commands/scan/cmd-scan-reach.test.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ describe('socket scan reach', async () => {
5050
--reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.
5151
--reach-detailed-analysis-log-file A log file with detailed analysis logs is written to root of each analyzed workspace.
5252
--reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations.
53+
--reach-disable-dependency-downloads Only analyze dependencies that are already installed (e.g. in the project's .venv, vendor directory or module cache). Missing dependencies count as installation failures.
5354
--reach-disable-external-tool-checks Disable external tool checks during reachability analysis.
5455
--reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Supported: cargo, composer, gem, golang, maven, npm, nuget, pypi. Defaults to all supported ecosystems.
5556
--reach-enable-analysis-splitting Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.

‎src/commands/scan/create-scan-from-github.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ async function scanOneRepo(
336336
reachDebug: false,
337337
reachDetailedAnalysisLogFile: false,
338338
reachDisableAnalytics: false,
339+
reachDisableDependencyDownloads: false,
339340
reachDisableExternalToolChecks: false,
340341
reachEcosystems: [],
341342
reachEnableAnalysisSplitting: false,

‎src/commands/scan/exclude-paths.test.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function makeReachOptions(
2727
reachDebug: false,
2828
reachDetailedAnalysisLogFile: false,
2929
reachDisableAnalytics: false,
30+
reachDisableDependencyDownloads: false,
3031
reachDisableExternalToolChecks: false,
3132
reachEcosystems: [],
3233
reachEnableAnalysisSplitting: false,

‎src/commands/scan/generate-uv-member-sboms.e2e.test.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ describe('uv member scans with the real uv binary', { timeout: 30_000 }, () => {
243243
reachDebug: false,
244244
reachDetailedAnalysisLogFile: false,
245245
reachDisableAnalytics: false,
246+
reachDisableDependencyDownloads: false,
246247
reachDisableExternalToolChecks: false,
247248
reachEcosystems: [],
248249
reachEnableAnalysisSplitting: false,

‎src/commands/scan/handle-create-new-scan.test.mts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function createConfig(
116116
reachDebug: false,
117117
reachDetailedAnalysisLogFile: false,
118118
reachDisableAnalytics: false,
119+
reachDisableDependencyDownloads: false,
119120
reachDisableExternalToolChecks: false,
120121
reachEcosystems: [],
121122
reachEnableAnalysisSplitting: false,
@@ -580,6 +581,7 @@ describe('handleCreateNewScan excludePaths', () => {
580581
reachDebug: false,
581582
reachDetailedAnalysisLogFile: false,
582583
reachDisableAnalytics: false,
584+
reachDisableDependencyDownloads: false,
583585
reachDisableExternalToolChecks: false,
584586
reachEcosystems: [],
585587
reachEnableAnalysisSplitting: false,
@@ -645,6 +647,7 @@ describe('handleCreateNewScan excludePaths', () => {
645647
reachDebug: false,
646648
reachDetailedAnalysisLogFile: false,
647649
reachDisableAnalytics: false,
650+
reachDisableDependencyDownloads: false,
648651
reachDisableExternalToolChecks: false,
649652
reachEcosystems: [],
650653
reachEnableAnalysisSplitting: false,
@@ -716,6 +719,7 @@ describe('handleCreateNewScan excludePaths', () => {
716719
reachDebug: false,
717720
reachDetailedAnalysisLogFile: false,
718721
reachDisableAnalytics: false,
722+
reachDisableDependencyDownloads: false,
719723
reachDisableExternalToolChecks: false,
720724
reachEcosystems: [],
721725
reachEnableAnalysisSplitting: false,
@@ -777,6 +781,7 @@ describe('handleCreateNewScan excludePaths', () => {
777781
reachDebug: false,
778782
reachDetailedAnalysisLogFile: false,
779783
reachDisableAnalytics: false,
784+
reachDisableDependencyDownloads: false,
780785
reachDisableExternalToolChecks: false,
781786
reachEcosystems: [],
782787
reachEnableAnalysisSplitting: false,
@@ -838,6 +843,7 @@ describe('handleCreateNewScan excludePaths', () => {
838843
reachDebug: false,
839844
reachDetailedAnalysisLogFile: false,
840845
reachDisableAnalytics: false,
846+
reachDisableDependencyDownloads: false,
841847
reachDisableExternalToolChecks: false,
842848
reachEcosystems: [],
843849
reachEnableAnalysisSplitting: false,

0 commit comments

Comments
 (0)