You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d2ee8a0
Browse filesBrowse the repository at this point in the historyBrowse files
feat(scan): add --reach-fallback-to-regular-scan flag (#1537)
* feat(scan): add --reach-fallback-to-regular-scan flag
When reachability analysis fails (e.g. backend gateway disconnect during
compute-artifacts), �[34m?�[39m �[1mNo TARGET given. Do you want to use the current directory?�[22m �[2m(Use arrow keys)�[22m
�[36m❯ Yes�[39m
No
�[36mTarget the current directory�[39m�[?25l�[29G
�[?25h currently aborts the
whole scan. The new opt-in flag continues with a regular SCA scan
instead, so the rest of the scan still ships when reachability errors
out.
* fix(scan): make the reachability fallback leave a clean scan and a signal
The --reach-fallback-to-regular-scan path had three gaps.
Coana writes its report over `.socket.facts.json` in place, so an analysis
that fails part way leaves partial output where the scan's inputs were. The
fallback uploaded that file as-is and left it on disk, where the next --reach
run reads it as a pre-generated input. Snapshot the facts files before the
analysis runs and restore them on fallback: captured files are rolled back to
their pre-analysis bytes, and files the analysis created are removed. A
producer-written facts file (socket manifest gradle --facts) is user-owned
input and is restored rather than deleted.
The JSON and Markdown output reported an unqualified success, so nothing
downstream could tell a degraded scan from a full one. Carry the failure in a
`reachabilityFallback` field alongside the scan result.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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
+
## [Unreleased]
8
+
9
+
### Added
10
+
- Added the `--reach-fallback-to-regular-scan` flag to `socket scan create`, keeping the scan moving with regular SCA results when full application reachability analysis fails. The JSON and Markdown output carry a `reachabilityFallback` marker so automation can tell a downgraded scan from a full one.
--reach-disable-external-tool-checks Disable external tool checks during reachability analysis.
71
71
--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.
72
72
--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.
73
+
--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.
73
74
--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. IMPORTANT: you must delete this file before running a fresh full application reachability scan. A stale \`.socket.facts.json\` left in place is picked up as a pre-generated input and silently overrides fresh analysis, so the new scan results will not be reliable.
74
75
--reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous runs to speed up the analysis.
75
76
--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.
// Restore the pre-analysis facts files: the regular scan must upload
339
+
// the inputs it would have had without --reach, not partial output.
340
+
awaitfactsSnapshot.restore()
341
+
logger.warn(
342
+
`Reachability analysis failed: ${reachResult.message}${reachResult.cause ? ` — ${reachResult.cause}` : ''}. Falling back to a regular SCA scan without reachability results.`,
338
343
)
339
-
340
-
// Append coana's reachability report, but not twice: a pre-generated facts
341
-
// input can resolve to the same path coana wrote its report to.
0 commit comments