diff --git a/CHANGELOG.md b/CHANGELOG.md index e559b3db6..947a2c1c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +### Added +- Catch reachability analyses that stop early: with `--reach-incomplete-analysis-as-error`, `socket scan create --reach` and `socket scan reach` report a vulnerability whose analysis hit the timeout or memory limit before finding a reachable path as an analysis error instead of unreachable. + ### Changed - Updated the Coana CLI to v `15.15.10`. diff --git a/src/commands/ci/handle-ci.mts b/src/commands/ci/handle-ci.mts index d315d5a12..f5a9434b8 100644 --- a/src/commands/ci/handle-ci.mts +++ b/src/commands/ci/handle-ci.mts @@ -125,6 +125,7 @@ export async function handleCi(autoManifest: boolean): Promise { reachEcosystems: [], reachExcludePaths: [], reachFallbackToRegularScan: false, + reachIncompleteAnalysisAsError: false, reachRetainFactsFile: false, reachSkipCache: false, reachUseOnlyPregeneratedSboms: false, diff --git a/src/commands/scan/cmd-scan-create.mts b/src/commands/scan/cmd-scan-create.mts index 07a53a24c..551b5a2f0 100644 --- a/src/commands/scan/cmd-scan-create.mts +++ b/src/commands/scan/cmd-scan-create.mts @@ -335,6 +335,7 @@ async function run( reachDisableDependencyDownloads, reachDisableExternalToolChecks, reachFallbackToRegularScan, + reachIncompleteAnalysisAsError, reachRetainFactsFile, reachSkipCache, reachUseOnlyPregeneratedSboms, @@ -373,6 +374,7 @@ async function run( reachDisableDependencyDownloads: boolean reachDisableExternalToolChecks: boolean reachFallbackToRegularScan: boolean + reachIncompleteAnalysisAsError: boolean reachRetainFactsFile: boolean reachSkipCache: boolean reachUseOnlyPregeneratedSboms: boolean @@ -810,6 +812,7 @@ async function run( reachEcosystems, reachExcludePaths, reachFallbackToRegularScan: Boolean(reachFallbackToRegularScan), + reachIncompleteAnalysisAsError: Boolean(reachIncompleteAnalysisAsError), reachRetainFactsFile: Boolean(reachRetainFactsFile), reachSkipCache: Boolean(reachSkipCache), reachUseOnlyPregeneratedSboms: Boolean(reachUseOnlyPregeneratedSboms), diff --git a/src/commands/scan/cmd-scan-create.test.mts b/src/commands/scan/cmd-scan-create.test.mts index a11898069..2c904506a 100644 --- a/src/commands/scan/cmd-scan-create.test.mts +++ b/src/commands/scan/cmd-scan-create.test.mts @@ -237,7 +237,7 @@ describe('socket scan create', async () => { --reach-analysis-memory-limit The maximum memory for the reachability analysis as a whole number optionally followed by MB or GB (e.g. 512MB, 8GB). The default is 8GB. --reach-analysis-timeout Set the timeout for the reachability analysis as a whole number optionally followed by s, m or h (e.g. 90s, 10m, 1h). Defaults to 10m. Split analysis runs may cause the total scan time to exceed this timeout significantly. --reach-concurrency Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available. - --reach-continue-on-analysis-errors Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors. + --reach-continue-on-analysis-errors Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors. With --reach-incomplete-analysis-as-error, an unreachable verdict from an analysis that stopped early is an error too. --reach-continue-on-install-errors Continue reachability analysis when package installation fails, falling back to precomputed reachability results. By default, the CLI halts on installation errors. --reach-continue-on-missing-lock-files Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version catalog / pre-generated SBOM). By default, the CLI halts. --reach-continue-on-no-source-files Continue reachability analysis when a workspace contains no source files for its ecosystem. By default, the CLI halts. @@ -248,6 +248,7 @@ describe('socket scan create', async () => { --reach-disable-external-tool-checks Disable external tool checks during reachability analysis. --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. --reach-fallback-to-regular-scan If reachability analysis fails, continue with a regular SCA scan (without reachability results) instead of halting. By default, the CLI halts on reachability errors. + --reach-incomplete-analysis-as-error An analysis that stops early (e.g. at --reach-analysis-timeout or --reach-analysis-memory-limit) can report a vulnerability unreachable because it found no path before it stopped. Report such a vulnerability as an analysis error instead. Analysis errors halt the scan unless --reach-continue-on-analysis-errors is set. --reach-retain-facts-file Keep the \`.socket.facts.json\` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. Delete it once inspected: later reachability scans ignore it, but a scan without --reach uploads it as an SBOM carrying stale reachability results. --reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous runs to speed up the analysis. --reach-use-only-pregenerated-sboms When using this option, the scan is created based only on pre-generated CDX and SPDX files in your project. diff --git a/src/commands/scan/cmd-scan-reach.mts b/src/commands/scan/cmd-scan-reach.mts index a0526a97c..331c56b83 100644 --- a/src/commands/scan/cmd-scan-reach.mts +++ b/src/commands/scan/cmd-scan-reach.mts @@ -164,6 +164,7 @@ async function run( reachDisableAnalytics, reachDisableDependencyDownloads, reachDisableExternalToolChecks, + reachIncompleteAnalysisAsError, reachRetainFactsFile, reachSkipCache, reachUseOnlyPregeneratedSboms, @@ -187,6 +188,7 @@ async function run( reachDisableAnalytics: boolean reachDisableDependencyDownloads: boolean reachDisableExternalToolChecks: boolean + reachIncompleteAnalysisAsError: boolean reachRetainFactsFile: boolean reachSkipCache: boolean reachUseOnlyPregeneratedSboms: boolean @@ -315,6 +317,7 @@ async function run( reachDisableExternalToolChecks: Boolean(reachDisableExternalToolChecks), reachEcosystems, reachExcludePaths, + reachIncompleteAnalysisAsError: Boolean(reachIncompleteAnalysisAsError), reachRetainFactsFile: Boolean(reachRetainFactsFile), reachSkipCache: Boolean(reachSkipCache), reachUseOnlyPregeneratedSboms: Boolean(reachUseOnlyPregeneratedSboms), diff --git a/src/commands/scan/cmd-scan-reach.test.mts b/src/commands/scan/cmd-scan-reach.test.mts index 9eb0c170c..b44372138 100644 --- a/src/commands/scan/cmd-scan-reach.test.mts +++ b/src/commands/scan/cmd-scan-reach.test.mts @@ -46,7 +46,7 @@ describe('socket scan reach', async () => { --reach-analysis-memory-limit The maximum memory for the reachability analysis as a whole number optionally followed by MB or GB (e.g. 512MB, 8GB). The default is 8GB. --reach-analysis-timeout Set the timeout for the reachability analysis as a whole number optionally followed by s, m or h (e.g. 90s, 10m, 1h). Defaults to 10m. Split analysis runs may cause the total scan time to exceed this timeout significantly. --reach-concurrency Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available. - --reach-continue-on-analysis-errors Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors. + --reach-continue-on-analysis-errors Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors. With --reach-incomplete-analysis-as-error, an unreachable verdict from an analysis that stopped early is an error too. --reach-continue-on-install-errors Continue reachability analysis when package installation fails, falling back to precomputed reachability results. By default, the CLI halts on installation errors. --reach-continue-on-missing-lock-files Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version catalog / pre-generated SBOM). By default, the CLI halts. --reach-continue-on-no-source-files Continue reachability analysis when a workspace contains no source files for its ecosystem. By default, the CLI halts. @@ -56,6 +56,7 @@ describe('socket scan reach', async () => { --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. --reach-disable-external-tool-checks Disable external tool checks during reachability analysis. --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. + --reach-incomplete-analysis-as-error An analysis that stops early (e.g. at --reach-analysis-timeout or --reach-analysis-memory-limit) can report a vulnerability unreachable because it found no path before it stopped. Report such a vulnerability as an analysis error instead. Analysis errors halt the scan unless --reach-continue-on-analysis-errors is set. --reach-retain-facts-file Keep the \`.socket.facts.json\` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. Delete it once inspected: later reachability scans ignore it, but a scan without --reach uploads it as an SBOM carrying stale reachability results. --reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous runs to speed up the analysis. --reach-use-only-pregenerated-sboms When using this option, the scan is created based only on pre-generated CDX and SPDX files in your project. diff --git a/src/commands/scan/create-scan-from-github.mts b/src/commands/scan/create-scan-from-github.mts index 077df6418..36bc267d5 100644 --- a/src/commands/scan/create-scan-from-github.mts +++ b/src/commands/scan/create-scan-from-github.mts @@ -344,6 +344,7 @@ async function scanOneRepo( reachEcosystems: [], reachExcludePaths: [], reachFallbackToRegularScan: false, + reachIncompleteAnalysisAsError: false, reachRetainFactsFile: false, reachSkipCache: false, reachUseOnlyPregeneratedSboms: false, diff --git a/src/commands/scan/perform-reachability-analysis.mts b/src/commands/scan/perform-reachability-analysis.mts index e141237f9..f5853dab4 100644 --- a/src/commands/scan/perform-reachability-analysis.mts +++ b/src/commands/scan/perform-reachability-analysis.mts @@ -46,6 +46,7 @@ export type ReachabilityOptions = { reachDisableAnalytics: boolean reachEcosystems: PURL_Type[] reachExcludePaths: string[] + reachIncompleteAnalysisAsError: boolean reachRetainFactsFile: boolean reachSkipCache: boolean reachUseOnlyPregeneratedSboms: boolean @@ -243,6 +244,9 @@ export async function performReachabilityAnalysis( ...(reachabilityOptions.reachDisableExternalToolChecks ? ['--disable-external-tool-checks'] : []), + ...(reachabilityOptions.reachIncompleteAnalysisAsError + ? ['--incomplete-analysis-as-error'] + : []), // Older Coana versions split analyses unless this is passed. '--disable-analysis-splitting', '--run-without-docker', diff --git a/src/commands/scan/perform-reachability-analysis.test.mts b/src/commands/scan/perform-reachability-analysis.test.mts index 55c862b97..2acbc25a0 100644 --- a/src/commands/scan/perform-reachability-analysis.test.mts +++ b/src/commands/scan/perform-reachability-analysis.test.mts @@ -333,6 +333,18 @@ describe('performReachabilityAnalysis flag forwarding', () => { const args = await coanaArgsFor(scanCwd, { reachAdvisories: [] }) expect(args).not.toContain('--ghsas') }) + + it('passes --reach-incomplete-analysis-as-error to Coana as --incomplete-analysis-as-error', async () => { + const args = await coanaArgsFor(scanCwd, { + reachIncompleteAnalysisAsError: true, + }) + expect(args).toContain('--incomplete-analysis-as-error') + }) + + it('omits --incomplete-analysis-as-error by default', async () => { + const args = await coanaArgsFor(scanCwd, {}) + expect(args).not.toContain('--incomplete-analysis-as-error') + }) }) describe('performReachabilityAnalysis --use-only-socket-facts-artifacts gating', () => { diff --git a/src/commands/scan/reachability-flags.mts b/src/commands/scan/reachability-flags.mts index 8f8361383..e4a7b028b 100644 --- a/src/commands/scan/reachability-flags.mts +++ b/src/commands/scan/reachability-flags.mts @@ -79,7 +79,7 @@ export const reachabilityFlags: MeowFlags = { type: 'boolean', default: false, description: - 'Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors.', + 'Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors. With --reach-incomplete-analysis-as-error, an unreachable verdict from an analysis that stopped early is an error too.', }, reachContinueOnInstallErrors: { type: 'boolean', @@ -160,6 +160,12 @@ export const reachabilityFlags: MeowFlags = { description: 'If reachability analysis fails, continue with a regular SCA scan (without reachability results) instead of halting. By default, the CLI halts on reachability errors.', }, + reachIncompleteAnalysisAsError: { + type: 'boolean', + default: false, + description: + 'An analysis that stops early (e.g. at --reach-analysis-timeout or --reach-analysis-memory-limit) can report a vulnerability unreachable because it found no path before it stopped. Report such a vulnerability as an analysis error instead. Analysis errors halt the scan unless --reach-continue-on-analysis-errors is set.', + }, reachLazyMode: { type: 'boolean', default: false, diff --git a/test/reachability-options.mts b/test/reachability-options.mts index 70ed0eaa6..101eef0c8 100644 --- a/test/reachability-options.mts +++ b/test/reachability-options.mts @@ -21,6 +21,7 @@ export function makeReachabilityOptions(): ReachabilityOptions { reachDisableExternalToolChecks: false, reachEcosystems: [], reachExcludePaths: [], + reachIncompleteAnalysisAsError: false, reachRetainFactsFile: false, reachSkipCache: false, reachUseOnlyPregeneratedSboms: false, diff --git a/test/snapshots/termless/cli.native.socket-help-scan-create.svg b/test/snapshots/termless/cli.native.socket-help-scan-create.svg index d23dbc644..bc4458208 100644 --- a/test/snapshots/termless/cli.native.socket-help-scan-create.svg +++ b/test/snapshots/termless/cli.native.socket-help-scan-create.svg @@ -1,4 +1,4 @@ - + CLI: v2.1.0-rc.0 | cmd: socket scan create | org: (not set) | token: (not set) @@ -127,135 +127,143 @@ --reach-continue-on-analysis-errors Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back -to precomputed reachability results. By default, the CLI halts on analysis errors. +to precomputed reachability results. By default, the CLI halts on analysis errors. With --reach-incomplete-analysis-as-error, an unreachable - --reach-continue-on-install-errors Continue reachability analysis when package installation fails, falling back to precomputed reachabi + verdict from an analysis that stopped early is an error too. -lity results. By default, the CLI halts on installation errors. + --reach-continue-on-install-errors Continue reachability analysis when package installation fails, falling back to precomputed reachabi - --reach-continue-on-missing-lock-files Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version +lity results. By default, the CLI halts on installation errors. - catalog / pre-generated SBOM). By default, the CLI halts. + --reach-continue-on-missing-lock-files Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version - --reach-continue-on-no-source-files Continue reachability analysis when a workspace contains no source files for its ecosystem. By defa + catalog / pre-generated SBOM). By default, the CLI halts. -ult, the CLI halts. + --reach-continue-on-no-source-files Continue reachability analysis when a workspace contains no source files for its ecosystem. By defa - --reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI. +ult, the CLI halts. - --reach-detailed-analysis-log-file A log file with detailed analysis logs is written to root of each analyzed workspace. + --reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI. - --reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations. + --reach-detailed-analysis-log-file A log file with detailed analysis logs is written to root of each analyzed workspace. - --reach-disable-dependency-downloads Only analyze dependencies that are already installed (e.g. in the project's .venv, vendor director + --reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations. -y or module cache). Missing dependencies count as installation failures. + --reach-disable-dependency-downloads Only analyze dependencies that are already installed (e.g. in the project's .venv, vendor director - --reach-disable-external-tool-checks Disable external tool checks during reachability analysis. +y or module cache). Missing dependencies count as installation failures. - --reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Supp + --reach-disable-external-tool-checks Disable external tool checks during reachability analysis. -orted: cargo, composer, gem, golang, maven, npm, nuget, pypi. Defaults to all supported ecosystems. + --reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Supp - --reach-fallback-to-regular-scan If reachability analysis fails, continue with a regular SCA scan (without reachability results) instea +orted: cargo, composer, gem, golang, maven, npm, nuget, pypi. Defaults to all supported ecosystems. -d of halting. By default, the CLI halts on reachability errors. + --reach-fallback-to-regular-scan If reachability analysis fails, continue with a regular SCA scan (without reachability results) instea - --reach-retain-facts-file Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of d +d of halting. By default, the CLI halts on reachability errors. -eleting it after a successful scan. Delete it once inspected: later reachability scans ignore it, but a scan without --reach uploads it as a + --reach-incomplete-analysis-as-error An analysis that stops early (e.g. at --reach-analysis-timeout or --reach-analysis-memory-limit) c -n SBOM carrying stale reachability results. +an report a vulnerability unreachable because it found no path before it stopped. Report such a vulnerability as an analysis error instead. - --reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous +Analysis errors halt the scan unless --reach-continue-on-analysis-errors is set. - runs to speed up the analysis. + --reach-retain-facts-file Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of d - --reach-use-only-pregenerated-sboms When using this option, the scan is created based only on pre-generated CDX and SPDX files in your +eleting it after a successful scan. Delete it once inspected: later reachability scans ignore it, but a scan without --reach uploads it as a -project. +n SBOM carrying stale reachability results. - --reach-version Override the version of @coana-tech/cli used for reachability analysis. Default: 15.15.10. + --reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous - + runs to speed up the analysis. - Uploads the specified dependency manifest files for Go, Gradle, JavaScript, + --reach-use-only-pregenerated-sboms When using this option, the scan is created based only on pre-generated CDX and SPDX files in your - Kotlin, Python, and Scala. Files like "package.json" and "requirements.txt". +project. - If any folder is specified, the ones found in there recursively are uploaded. + --reach-version Override the version of @coana-tech/cli used for reachability analysis. Default: 15.15.10. - Details on TARGET: + Uploads the specified dependency manifest files for Go, Gradle, JavaScript, - + Kotlin, Python, and Scala. Files like "package.json" and "requirements.txt". - - Defaults to the current dir (cwd) if none given + If any folder is specified, the ones found in there recursively are uploaded. - - Multiple targets can be specified + - - If a target is a file, only that file is checked + Details on TARGET: - - If it is a dir, the dir is scanned for any supported manifest files + - - Dirs MUST be within the current dir (cwd), you can use --cwd to change it + - Defaults to the current dir (cwd) if none given - - Supports globbing such as "**/package.json", "**/requirements.txt", etc. + - Multiple targets can be specified - - Ignores any file specified in your project's ".gitignore" + - If a target is a file, only that file is checked - - Also a sensible set of default ignores from the "ignore-by-default" module + - If it is a dir, the dir is scanned for any supported manifest files - + - Dirs MUST be within the current dir (cwd), you can use --cwd to change it - The --repo and --branch flags tell Socket to associate this Scan with that + - Supports globbing such as "**/package.json", "**/requirements.txt", etc. - repo/branch. The names will show up on your dashboard on the Socket website. + - Ignores any file specified in your project's ".gitignore" - + - Also a sensible set of default ignores from the "ignore-by-default" module - Note: for a first run you probably want to set --default-branch to indicate + - the default branch name, like "main" or "master". + The --repo and --branch flags tell Socket to associate this Scan with that - + repo/branch. The names will show up on your dashboard on the Socket website. - The "alerts page" (​https://socket.dev/dashboard/org/YOURORG/alerts​) will show + - the results from the last scan designated as the "pending head" on the branch + Note: for a first run you probably want to set --default-branch to indicate - configured on Socket to be the "default branch". When creating a scan the + the default branch name, like "main" or "master". - --set-as-alerts-page flag will default to true to update this. You can prevent + - this by using --no-set-as-alerts-page. This flag is ignored for any branch that + The "alerts page" (​https://socket.dev/dashboard/org/YOURORG/alerts​) will show - is not designated as the "default branch". It is disabled when using --tmp. + the results from the last scan designated as the "pending head" on the branch - + configured on Socket to be the "default branch". When creating a scan the - You can use `socket scan setup` to configure certain repo flag defaults. + --set-as-alerts-page flag will default to true to update this. You can prevent - + this by using --no-set-as-alerts-page. This flag is ignored for any branch that - Examples + is not designated as the "default branch". It is disabled when using --tmp. - $ socket scan create + - $ socket scan create ./proj --json + You can use `socket scan setup` to configure certain repo flag defaults. - $ socket scan create --repo=test-repo --branch=main ./package.json + - $ socket scan create --uv-members ./packages/api ./packages/worker + Examples - + $ socket scan create - + $ socket scan create ./proj --json - + $ socket scan create --repo=test-repo --branch=main ./package.json - + $ socket scan create --uv-members ./packages/api ./packages/worker - \ No newline at end of file + + + + + + + + + \ No newline at end of file diff --git a/test/snapshots/termless/cli.native.socket-help-scan-reach.svg b/test/snapshots/termless/cli.native.socket-help-scan-reach.svg index 0723f6eb3..03371cbe1 100644 --- a/test/snapshots/termless/cli.native.socket-help-scan-reach.svg +++ b/test/snapshots/termless/cli.native.socket-help-scan-reach.svg @@ -1,4 +1,4 @@ - + CLI: v2.1.0-rc.0 | cmd: socket scan reach | org: (not set) | token: (not set) @@ -83,91 +83,99 @@ --reach-continue-on-analysis-errors Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back -to precomputed reachability results. By default, the CLI halts on analysis errors. +to precomputed reachability results. By default, the CLI halts on analysis errors. With --reach-incomplete-analysis-as-error, an unreachable - --reach-continue-on-install-errors Continue reachability analysis when package installation fails, falling back to precomputed reachabi + verdict from an analysis that stopped early is an error too. -lity results. By default, the CLI halts on installation errors. + --reach-continue-on-install-errors Continue reachability analysis when package installation fails, falling back to precomputed reachabi - --reach-continue-on-missing-lock-files Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version +lity results. By default, the CLI halts on installation errors. - catalog / pre-generated SBOM). By default, the CLI halts. + --reach-continue-on-missing-lock-files Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version - --reach-continue-on-no-source-files Continue reachability analysis when a workspace contains no source files for its ecosystem. By defa + catalog / pre-generated SBOM). By default, the CLI halts. -ult, the CLI halts. + --reach-continue-on-no-source-files Continue reachability analysis when a workspace contains no source files for its ecosystem. By defa - --reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI. +ult, the CLI halts. - --reach-detailed-analysis-log-file A log file with detailed analysis logs is written to root of each analyzed workspace. + --reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI. - --reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations. + --reach-detailed-analysis-log-file A log file with detailed analysis logs is written to root of each analyzed workspace. - --reach-disable-dependency-downloads Only analyze dependencies that are already installed (e.g. in the project's .venv, vendor director + --reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations. -y or module cache). Missing dependencies count as installation failures. + --reach-disable-dependency-downloads Only analyze dependencies that are already installed (e.g. in the project's .venv, vendor director - --reach-disable-external-tool-checks Disable external tool checks during reachability analysis. +y or module cache). Missing dependencies count as installation failures. - --reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Supp + --reach-disable-external-tool-checks Disable external tool checks during reachability analysis. -orted: cargo, composer, gem, golang, maven, npm, nuget, pypi. Defaults to all supported ecosystems. + --reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Supp - --reach-retain-facts-file Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of d +orted: cargo, composer, gem, golang, maven, npm, nuget, pypi. Defaults to all supported ecosystems. -eleting it after a successful scan. Delete it once inspected: later reachability scans ignore it, but a scan without --reach uploads it as a + --reach-incomplete-analysis-as-error An analysis that stops early (e.g. at --reach-analysis-timeout or --reach-analysis-memory-limit) c -n SBOM carrying stale reachability results. +an report a vulnerability unreachable because it found no path before it stopped. Report such a vulnerability as an analysis error instead. - --reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous +Analysis errors halt the scan unless --reach-continue-on-analysis-errors is set. - runs to speed up the analysis. + --reach-retain-facts-file Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of d - --reach-use-only-pregenerated-sboms When using this option, the scan is created based only on pre-generated CDX and SPDX files in your +eleting it after a successful scan. Delete it once inspected: later reachability scans ignore it, but a scan without --reach uploads it as a -project. +n SBOM carrying stale reachability results. - --reach-version Override the version of @coana-tech/cli used for reachability analysis. Default: 15.15.10. + --reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous - + runs to speed up the analysis. - Runs the Socket reachability analysis without creating a scan in Socket. + --reach-use-only-pregenerated-sboms When using this option, the scan is created based only on pre-generated CDX and SPDX files in your - The output is written to .socket.facts.json in the current working directory +project. - unless the --output flag is specified. + --reach-version Override the version of @coana-tech/cli used for reachability analysis. Default: 15.15.10. - Note: Manifest files are uploaded to Socket's backend services because the + Runs the Socket reachability analysis without creating a scan in Socket. - reachability analysis requires creating a Software Bill of Materials (SBOM) + The output is written to .socket.facts.json in the current working directory - from these files before the analysis can run. + unless the --output flag is specified. - Examples + Note: Manifest files are uploaded to Socket's backend services because the - $ socket scan reach + reachability analysis requires creating a Software Bill of Materials (SBOM) - $ socket scan reach ./proj + from these files before the analysis can run. - $ socket scan reach ./proj --reach-ecosystems npm,pypi + - $ socket scan reach ./monorepo --dynamic-sbom-inference + Examples - $ socket scan reach --output custom-report.json + $ socket scan reach - $ socket scan reach ./proj --output ./reports/analysis.json + $ socket scan reach ./proj - + $ socket scan reach ./proj --reach-ecosystems npm,pypi - + $ socket scan reach ./monorepo --dynamic-sbom-inference - + $ socket scan reach --output custom-report.json - + $ socket scan reach ./proj --output ./reports/analysis.json - \ No newline at end of file + + + + + + + + + \ No newline at end of file