socketsecurity 2.4.6__tar.gz → 2.4.8__tar.gz

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.
Files changed (146) hide show
  1. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/CHANGELOG.md +40 -0
  2. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/PKG-INFO +2 -2
  3. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/docs/cli-reference.md +13 -8
  4. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/pyproject.toml +2 -2
  5. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/__init__.py +1 -1
  6. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/config.py +4 -2
  7. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/__init__.py +43 -1
  8. socketsecurity-2.4.8/socketsecurity/core/tools/reachability.py +469 -0
  9. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/socketcli.py +1 -1
  10. socketsecurity-2.4.8/tests/unit/test_full_scan_retry.py +285 -0
  11. socketsecurity-2.4.8/tests/unit/test_reachability.py +384 -0
  12. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/uv.lock +5 -5
  13. socketsecurity-2.4.6/socketsecurity/core/tools/reachability.py +0 -330
  14. socketsecurity-2.4.6/tests/unit/test_reachability.py +0 -106
  15. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/CODEOWNERS +0 -0
  16. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  17. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  18. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  19. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  20. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/actions/setup-docker/action.yml +0 -0
  21. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/actions/setup-hatch/action.yml +0 -0
  22. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/actions/setup-sfw/action.yml +0 -0
  23. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/dependabot.yml +0 -0
  24. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/workflows/dependency-review.yml +0 -0
  25. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/workflows/docker-stable.yml +0 -0
  26. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/workflows/e2e-test.yml +0 -0
  27. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/workflows/pr-preview.yml +0 -0
  28. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/workflows/python-tests.yml +0 -0
  29. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/workflows/release.yml +0 -0
  30. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/workflows/version-check.yml +0 -0
  31. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.github/zizmor.yml +0 -0
  32. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.gitignore +0 -0
  33. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.hooks/sync_version.py +0 -0
  34. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.pre-commit-config.yaml +0 -0
  35. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/.python-version +0 -0
  36. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/Dockerfile +0 -0
  37. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/LICENSE +0 -0
  38. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/Makefile +0 -0
  39. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/README.md +0 -0
  40. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/docs/ci-cd.md +0 -0
  41. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/docs/development.md +0 -0
  42. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/docs/troubleshooting.md +0 -0
  43. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/examples/config/sarif-dashboard-parity.json +0 -0
  44. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/examples/config/sarif-dashboard-parity.toml +0 -0
  45. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/examples/config/sarif-diff-ci-cd.json +0 -0
  46. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/examples/config/sarif-diff-ci-cd.toml +0 -0
  47. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/examples/config/sarif-instance-detail.json +0 -0
  48. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/examples/config/sarif-instance-detail.toml +0 -0
  49. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/instructions/gitlab-commit-status/uat.md +0 -0
  50. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/pytest.ini +0 -0
  51. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/scripts/build_container.sh +0 -0
  52. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/scripts/build_container_flexible.sh +0 -0
  53. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/scripts/deploy-test-docker.sh +0 -0
  54. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/scripts/deploy-test-pypi.sh +0 -0
  55. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/scripts/docker-entrypoint.sh +0 -0
  56. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/scripts/run.sh +0 -0
  57. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/session.md +0 -0
  58. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socket.yml +0 -0
  59. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/alert_selection.py +0 -0
  60. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/classes.py +0 -0
  61. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/cli_client.py +0 -0
  62. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/exceptions.py +0 -0
  63. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/git_interface.py +0 -0
  64. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/helper/__init__.py +0 -0
  65. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
  66. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/lazy_file_loader.py +0 -0
  67. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/logging.py +0 -0
  68. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/messages.py +0 -0
  69. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/resource_utils.py +0 -0
  70. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/scm/__init__.py +0 -0
  71. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/scm/base.py +0 -0
  72. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/scm/client.py +0 -0
  73. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/scm/github.py +0 -0
  74. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/scm/gitlab.py +0 -0
  75. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/scm_comments.py +0 -0
  76. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/socket_config.py +0 -0
  77. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/core/utils.py +0 -0
  78. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/fossa_compat.py +0 -0
  79. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/output.py +0 -0
  80. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/__init__.py +0 -0
  81. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/base.py +0 -0
  82. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/formatters/__init__.py +0 -0
  83. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/formatters/slack.py +0 -0
  84. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/jira.py +0 -0
  85. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/manager.py +0 -0
  86. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/slack.py +0 -0
  87. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/teams.py +0 -0
  88. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/socketsecurity/plugins/webhook.py +0 -0
  89. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/__init__.py +0 -0
  90. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/conftest.py +0 -0
  91. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/create_diff_input.json +0 -0
  92. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/test_diff_alerts.py +0 -0
  93. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/test_diff_generation.py +0 -0
  94. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/test_facts_compression.py +0 -0
  95. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/test_has_manifest_files.py +0 -0
  96. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/test_package_and_alerts.py +0 -0
  97. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/test_sdk_methods.py +0 -0
  98. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/core/test_supporting_methods.py +0 -0
  99. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/fullscans/create_response.json +0 -0
  100. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/fullscans/diff/stream_diff.json +0 -0
  101. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
  102. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/fullscans/head_scan/metadata.json +0 -0
  103. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
  104. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
  105. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/fullscans/new_scan/metadata.json +0 -0
  106. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
  107. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/repos/repo_info_error.json +0 -0
  108. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/repos/repo_info_no_head.json +0 -0
  109. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/repos/repo_info_success.json +0 -0
  110. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/data/settings/security-policy.json +0 -0
  111. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/e2e/fixtures/simple-npm/index.js +0 -0
  112. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/e2e/fixtures/simple-npm/package.json +0 -0
  113. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/e2e/fixtures/simple-pypi/requirements.txt +0 -0
  114. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/e2e/validate-gitlab.sh +0 -0
  115. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/e2e/validate-json.sh +0 -0
  116. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/e2e/validate-reachability.sh +0 -0
  117. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/e2e/validate-sarif.sh +0 -0
  118. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/e2e/validate-scan.sh +0 -0
  119. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/fixtures/fossa/README.md +0 -0
  120. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/fixtures/fossa/fossa-analyze-empty.json +0 -0
  121. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/fixtures/fossa/fossa-analyze-populated.json +0 -0
  122. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/fixtures/fossa/fossa-sbom-empty-deep.json +0 -0
  123. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/fixtures/fossa/fossa-sbom-populated.json +0 -0
  124. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/__init__.py +0 -0
  125. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_alert_selection.py +0 -0
  126. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_cli_config.py +0 -0
  127. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_client.py +0 -0
  128. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_config.py +0 -0
  129. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_dependency_overview.py +0 -0
  130. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_disable_ignore.py +0 -0
  131. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_exclude_paths.py +0 -0
  132. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_fossa_compat.py +0 -0
  133. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_fossa_parity.py +0 -0
  134. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_gitlab_auth.py +0 -0
  135. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_gitlab_auth_fallback.py +0 -0
  136. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_gitlab_commit_status.py +0 -0
  137. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_gitlab_format.py +0 -0
  138. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_ignore_telemetry_filtering.py +0 -0
  139. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_output.py +0 -0
  140. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_slack_plugin.py +0 -0
  141. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_socketcli.py +0 -0
  142. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/tests/unit/test_tier1_finalize.py +0 -0
  143. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/workflows/bitbucket-pipelines.yml +0 -0
  144. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/workflows/buildkite.yml +0 -0
  145. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/workflows/github-actions.yml +0 -0
  146. {socketsecurity-2.4.6 → socketsecurity-2.4.8}/workflows/gitlab-ci.yml +0 -0
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.4.8
4
+
5
+ ### Fixed: retry transient full-scan upload failures
6
+
7
+ - The full-scan upload (`POST /orgs/<org>/full-scans`) now retries transient
8
+ gateway/connection failures — HTTP 502/503/504/408, dropped or reset connections, and
9
+ request timeouts — up to 3 total attempts with increasing waits (~10s, then ~30s, plus
10
+ jitter). Such failures are intermittent and a retried upload almost always succeeds.
11
+ In these failure modes the server never finished reading the request body, so no scan
12
+ was created and a retry does not duplicate one; in the rare case where a gateway
13
+ timeout races a request the server later completes, the extra scan is benign and
14
+ superseded by the retried one (as if the CLI had run twice).
15
+ Non-transient errors (400/401/403/404/429 and error payloads) are never retried. Each
16
+ retry logs a warning explaining what failed and when the next attempt happens.
17
+ - Requires `socketdev>=3.3.0`: the SDK now records the HTTP status code on the exceptions
18
+ it raises and owns the transient-vs-deterministic classification
19
+ (`APIFailure.is_transient_error()`), so the CLI no longer parses status codes out of
20
+ exception message text.
21
+
22
+ ## 2.4.7
23
+
24
+ ### Changed: pin @coana-tech/cli version; auto-update is now opt-in
25
+
26
+ - Reachability analysis now runs a fixed `@coana-tech/cli` version pinned to this CLI release
27
+ (`15.3.24`) via `npx`, instead of silently pulling the latest published version on every run.
28
+ Engine version changes now ride with the Socket Python CLI release (standard `pip` upgrade),
29
+ giving advance notice of analysis-engine changes.
30
+ - The CLI no longer runs `npm install -g @coana-tech/cli`; an existing global install is left
31
+ untouched (never auto-updated or downgraded).
32
+ - Opt into always-newest with `--reach-version latest`; pin an explicit version with
33
+ `--reach-version <semver>` (unchanged).
34
+ - Runs the engine via `npx --yes --force` (the same flags the Socket Node CLI passes for
35
+ coana); `--yes` skips npx's interactive install prompt so non-interactive/CI runs don't hang.
36
+ - Added an `npm install` + `node` fallback for when the `npx` launcher is missing or fails
37
+ before the engine starts. The installed engine is cached per version for the process
38
+ lifetime (installs once). Tunable via `SOCKET_CLI_COANA_FORCE_NPM_INSTALL` (use the fallback
39
+ as the primary path) and `SOCKET_CLI_COANA_DISABLE_NPM_FALLBACK` (never fall back). `node` is
40
+ now part of the up-front prerequisite check. Also strips `npm_package_*` env vars before
41
+ spawning the engine to avoid `E2BIG` in large monorepos.
42
+
3
43
  ## 2.4.6
4
44
 
5
45
  ### Docs: reachability reference corrections
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketsecurity
3
- Version: 2.4.6
3
+ Version: 2.4.8
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Project-URL: Homepage, https://socket.dev
6
6
  Author-email: Douglas Coburn <douglas@socket.dev>
@@ -43,7 +43,7 @@ Requires-Dist: packaging
43
43
  Requires-Dist: prettytable
44
44
  Requires-Dist: python-dotenv
45
45
  Requires-Dist: requests
46
- Requires-Dist: socketdev<4.0.0,>=3.2.1
46
+ Requires-Dist: socketdev<4.0.0,>=3.3.0
47
47
  Provides-Extra: dev
48
48
  Requires-Dist: hatch; extra == 'dev'
49
49
  Requires-Dist: pre-commit; extra == 'dev'
@@ -240,13 +240,13 @@ If you don't want to provide the Socket API Token every time then you can use th
240
240
  | Parameter | Required | Default | Description |
241
241
  |:---------------------------------|:---------|:--------|:---------------------------------------------------------------------------------------------------------------------------|
242
242
  | `--reach` | False | False | Enable reachability analysis to identify which vulnerable functions are actually called by your code. Creates a tier-1 full-application reachability scan (`scan_type=socket_tier1`). |
243
- | `--reach-version` | False | latest | Version of @coana-tech/cli to use for analysis |
244
- | `--reach-analysis-timeout` | False | *coana* | Timeout in seconds for the reachability analysis. Omitted by default, so coana applies its own (currently 600s). Alias: `--reach-timeout` |
245
- | `--reach-analysis-memory-limit` | False | *coana* | Memory limit in MB for the reachability analysis. Omitted by default, so coana applies its own (currently 8192). Alias: `--reach-memory-limit` |
246
- | `--reach-concurrency` | False | *coana* | Control parallel analysis execution (must be >= 1). Omitted by default, so coana applies its own (currently 1) |
243
+ | `--reach-version` | False | 15.3.24 | Version of @coana-tech/cli to use. Defaults to the pinned version that ships with this CLI release, so the engine only changes when you upgrade the Socket CLI. Pass `latest` to always use the newest published version (opt-in auto-update), or an explicit version (e.g. `1.2.3`) to pin it. |
244
+ | `--reach-analysis-timeout` | False | 600 | Timeout in seconds for the reachability analysis. Omitted by default, so coana applies its own default. Alias: `--reach-timeout` |
245
+ | `--reach-analysis-memory-limit` | False | 8192 | Memory limit in MB for the reachability analysis. Omitted by default, so coana applies its own default. Alias: `--reach-memory-limit` |
246
+ | `--reach-concurrency` | False | 1 | Control parallel analysis execution (must be >= 1). Omitted by default, so coana applies its own default. |
247
247
  | `--reach-additional-params` | False | | Pass custom parameters to the coana CLI tool |
248
248
  | `--reach-ecosystems` | False | | Comma-separated list of ecosystems to analyze (e.g., "npm,pypi"). If not specified, all supported ecosystems are analyzed |
249
- | `--reach-min-severity` | False | | Minimum severity level for reporting reachability results (info, low, moderate, high, critical) |
249
+ | `--reach-min-severity` | False | info | Minimum severity of vulnerabilities to analyze (info, low, moderate, high, critical). Omitted by default, so coana analyzes all severities — equivalent to `info`, the lowest. |
250
250
  | `--reach-skip-cache` | False | False | Skip cache and force fresh reachability analysis |
251
251
  | `--reach-disable-analytics` | False | False | Disable analytics collection during reachability analysis |
252
252
  | `--reach-enable-analysis-splitting` | False | False | Enable analysis splitting/bucketing (a legacy performance feature). Splitting is disabled by default. |
@@ -262,8 +262,9 @@ If you don't want to provide the Socket API Token every time then you can use th
262
262
  **Reachability Analysis Requirements:**
263
263
 
264
264
  The Python CLI verifies the following **up front** (before invoking the analysis engine) and exits with code **3** if any are unmet:
265
- - `npm` - Required to install and run `@coana-tech/cli` (the analysis engine)
266
- - `npx` - Required to execute `@coana-tech/cli`
265
+ - `npm` - Required (verified up front; ships alongside `npx`)
266
+ - `npx` - Required to fetch (on first use) and run `@coana-tech/cli` (the analysis engine)
267
+ - `node` - Required to run the engine (used directly by the `npm install` fallback)
267
268
  - `uv` - Required by the analysis engine
268
269
  - An **Enterprise** Socket organization plan (any `enterprise*` plan, including Enterprise trials)
269
270
 
@@ -313,7 +314,11 @@ Sample config files:
313
314
 
314
315
  For CI-specific examples and guidance, see [`ci-cd.md`](ci-cd.md).
315
316
 
316
- The CLI will automatically install `@coana-tech/cli` if not present. Use `--reach` to enable reachability analysis during a full scan, or add `--only-facts-file` (with `--reach`) to submit only the reachability facts file (`.socket.facts.json`) when creating the full scan.
317
+ The CLI runs a pinned `@coana-tech/cli` version via `npx --yes --force` (the same flags the Socket Node CLI passes for coana); it does **not** auto-update the engine or install it globally. `--yes` skips npx's interactive install prompt so non-interactive/CI runs don't hang. If the `npx` launcher is unavailable or fails before the engine starts, the CLI falls back to `npm install`-ing the pinned version into a temp directory and running it via `node`. Pass `--reach-version latest` to opt into the newest published version. Use `--reach` to enable reachability analysis during a full scan, or add `--only-facts-file` (with `--reach`) to submit only the reachability facts file (`.socket.facts.json`) when creating the full scan.
318
+
319
+ The launcher fallback can be tuned via environment variables:
320
+ - `SOCKET_CLI_COANA_FORCE_NPM_INSTALL` — skip `npx` entirely and always use the `npm install` + `node` path (useful where `npx` is known-broken).
321
+ - `SOCKET_CLI_COANA_DISABLE_NPM_FALLBACK` — never fall back; surface the `npx` failure directly.
317
322
 
318
323
  #### Advanced Configuration
319
324
  | Parameter | Required | Default | Description |
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "socketsecurity"
9
- version = "2.4.6"
9
+ version = "2.4.8"
10
10
  requires-python = ">= 3.11"
11
11
  license = {"file" = "LICENSE"}
12
12
  dependencies = [
@@ -16,7 +16,7 @@ dependencies = [
16
16
  'GitPython',
17
17
  'packaging',
18
18
  'python-dotenv',
19
- "socketdev>=3.2.1,<4.0.0",
19
+ "socketdev>=3.3.0,<4.0.0",
20
20
  "bs4>=0.0.2",
21
21
  "markdown>=3.10",
22
22
  "brotli>=1.0.9; platform_python_implementation == 'CPython'",
@@ -1,3 +1,3 @@
1
1
  __author__ = 'socket.dev'
2
- __version__ = '2.4.6'
2
+ __version__ = '2.4.8'
3
3
  USER_AGENT = f'SocketPythonCLI/{__version__}'
@@ -943,8 +943,10 @@ def create_argument_parser() -> argparse.ArgumentParser:
943
943
  reachability_group.add_argument(
944
944
  "--reach-version",
945
945
  dest="reach_version",
946
- metavar="<version>",
947
- help="Specific version of @coana-tech/cli to use (e.g., '1.2.3')"
946
+ metavar="<version|latest>",
947
+ help="Version of @coana-tech/cli to use. Defaults to the version pinned to this CLI "
948
+ "release; pass 'latest' to always use the newest published version (opt-in "
949
+ "auto-update), or an explicit version (e.g. '1.2.3') to pin it."
948
950
  )
949
951
  reachability_group.add_argument(
950
952
  "--reach-analysis-timeout",
@@ -1,5 +1,6 @@
1
1
  import logging
2
2
  import os
3
+ import random
3
4
  import re
4
5
  import sys
5
6
  import tarfile
@@ -76,6 +77,21 @@ SOCKET_FACTS_BROTLI_CHUNK_SIZE = 1024 * 1024
76
77
  TIER1_FINALIZE_MAX_ATTEMPTS = 3
77
78
  TIER1_FINALIZE_BACKOFF_SECONDS = 1.0
78
79
 
80
+ # Full scan upload retry policy. An upload can fail transiently at the gateway/connection
81
+ # level (an HTTP 502/503/504/408, a dropped or reset connection, or a client-side timeout)
82
+ # without the server having created the scan; the SDK classifies those failures via
83
+ # APIFailure.is_transient_error() (socketdev>=3.3.0). In these failure modes no scan was
84
+ # created, so a retry does not duplicate one. (A duplicate is possible only if a gateway
85
+ # timeout races a request the server later completes; that is benign - the retried scan
86
+ # supersedes the orphaned one, same as running the CLI twice.)
87
+ #
88
+ # Each schedule entry is the wait before the next attempt once the current one fails (plus
89
+ # a little jitter so a fleet of CI jobs hitting the same failure doesn't retry in
90
+ # lock-step); the final None means the last attempt's failure is re-raised, not retried.
91
+ FULL_SCAN_UPLOAD_BACKOFF_SCHEDULE_SECONDS = (10.0, 30.0, None)
92
+ FULL_SCAN_UPLOAD_MAX_ATTEMPTS = len(FULL_SCAN_UPLOAD_BACKOFF_SCHEDULE_SECONDS)
93
+ FULL_SCAN_UPLOAD_BACKOFF_JITTER_SECONDS = 2.0
94
+
79
95
 
80
96
  def _humanize_alert_type(alert_type: str) -> str:
81
97
  """Convert a camelCase/PascalCase alert type into a Title-Cased label.
@@ -787,7 +803,33 @@ class Core:
787
803
  # facts file under the per-file upload size cap. See _compress_facts_files_for_upload.
788
804
  upload_files, compressed_temp_files = self._compress_facts_files_for_upload(files)
789
805
  try:
790
- res = self.sdk.fullscans.post(upload_files, params, use_types=True, use_lazy_loading=True, max_open_files=50, base_paths=base_paths)
806
+ # Retry transient gateway/timeout failures (502/503/504/408, dropped connections,
807
+ # timeouts) with increasing waits. In these failure modes the server never finished
808
+ # reading the request body, so no scan was created and a retry does not duplicate
809
+ # one (see the retry-policy comment above FULL_SCAN_UPLOAD_BACKOFF_SCHEDULE_SECONDS).
810
+ # fullscans.post() rebuilds its lazy file loaders from the plain paths in
811
+ # upload_files on every call, so simply calling it again per attempt is safe. The
812
+ # loop must stay inside this try so the temp .br files (cleaned up in the finally
813
+ # below) outlive every attempt.
814
+ for attempt, backoff_seconds in enumerate(FULL_SCAN_UPLOAD_BACKOFF_SCHEDULE_SECONDS, start=1):
815
+ try:
816
+ res = self.sdk.fullscans.post(upload_files, params, use_types=True, use_lazy_loading=True, max_open_files=50, base_paths=base_paths)
817
+ break
818
+ except APIFailure as error:
819
+ if backoff_seconds is None or not error.is_transient_error():
820
+ raise
821
+ wait_seconds = backoff_seconds + random.uniform(
822
+ 0, FULL_SCAN_UPLOAD_BACKOFF_JITTER_SECONDS
823
+ )
824
+ # SDK error messages can span many lines (path + response headers); the
825
+ # first line carries the status, which is all the warning needs.
826
+ error_summary = str(error).strip().splitlines()[0] if str(error).strip() else ""
827
+ log.warning(
828
+ f"Full scan upload failed with {type(error).__name__}({error_summary}), "
829
+ f"retrying in {wait_seconds:.0f}s "
830
+ f"(attempt {attempt + 1}/{FULL_SCAN_UPLOAD_MAX_ATTEMPTS})"
831
+ )
832
+ time.sleep(wait_seconds)
791
833
  finally:
792
834
  for temp_file in compressed_temp_files:
793
835
  try: