socketsecurity 2.13.0__tar.gz → 2.13.2__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 (190) hide show
  1. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/docker-stable.yml +2 -0
  2. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/release.yml +3 -0
  3. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/CHANGELOG.md +41 -0
  4. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/PKG-INFO +9 -5
  5. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/README.md +4 -0
  6. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/docs/ci-cd.md +12 -2
  7. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/docs/cli-reference.md +17 -1
  8. socketsecurity-2.13.2/docs/troubleshooting.md +306 -0
  9. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/pyproject.toml +5 -5
  10. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/__init__.py +1 -1
  11. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/__init__.py +6 -1
  12. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/messages.py +33 -10
  13. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_messages.py +18 -0
  14. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_pr_comment_rendering.py +128 -1
  15. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/uv.lock +54 -54
  16. socketsecurity-2.13.0/docs/troubleshooting.md +0 -148
  17. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.dockerignore +0 -0
  18. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/CODEOWNERS +0 -0
  19. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  20. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  21. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  22. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  23. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/actions/setup-docker/action.yml +0 -0
  24. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/actions/setup-hatch/action.yml +0 -0
  25. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/actions/setup-sfw/action.yml +0 -0
  26. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/dependabot.yml +0 -0
  27. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/dependency-audit.yml +0 -0
  28. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/dependency-review.yml +0 -0
  29. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/e2e-image.yml +0 -0
  30. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/e2e-test.yml +0 -0
  31. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/package-check.yml +0 -0
  32. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/pr-preview.yml +0 -0
  33. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/python-tests.yml +0 -0
  34. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/workflows/version-check.yml +0 -0
  35. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.github/zizmor.yml +0 -0
  36. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.gitignore +0 -0
  37. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.hooks/sync_version.py +0 -0
  38. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.pre-commit-config.yaml +0 -0
  39. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/.python-version +0 -0
  40. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/CONTRIBUTING.md +0 -0
  41. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/Dockerfile +0 -0
  42. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/Dockerfile.preview +0 -0
  43. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/LICENSE +0 -0
  44. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/Makefile +0 -0
  45. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/benchmarks/manifest_discovery.py +0 -0
  46. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/docs/development.md +0 -0
  47. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/examples/config/sarif-dashboard-parity.json +0 -0
  48. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/examples/config/sarif-dashboard-parity.toml +0 -0
  49. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/examples/config/sarif-diff-ci-cd.json +0 -0
  50. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/examples/config/sarif-diff-ci-cd.toml +0 -0
  51. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/examples/config/sarif-instance-detail.json +0 -0
  52. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/examples/config/sarif-instance-detail.toml +0 -0
  53. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/instructions/gitlab-commit-status/uat.md +0 -0
  54. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/pytest.ini +0 -0
  55. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/scripts/build_container.sh +0 -0
  56. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/scripts/build_container_flexible.sh +0 -0
  57. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/scripts/deploy-test-docker.sh +0 -0
  58. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/scripts/deploy-test-pypi.sh +0 -0
  59. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/scripts/docker-entrypoint.sh +0 -0
  60. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/scripts/run.sh +0 -0
  61. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/session.md +0 -0
  62. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socket.yml +0 -0
  63. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/config.py +0 -0
  64. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/alert_selection.py +0 -0
  65. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/classes.py +0 -0
  66. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/cli_client.py +0 -0
  67. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/cli_run.py +0 -0
  68. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/exceptions.py +0 -0
  69. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/git_interface.py +0 -0
  70. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/git_remote.py +0 -0
  71. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/helper/__init__.py +0 -0
  72. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
  73. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/lazy_file_loader.py +0 -0
  74. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/log_uploader.py +0 -0
  75. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/logging.py +0 -0
  76. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/pull_request.py +0 -0
  77. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/resource_utils.py +0 -0
  78. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/scm/__init__.py +0 -0
  79. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/scm/base.py +0 -0
  80. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/scm/client.py +0 -0
  81. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/scm/github.py +0 -0
  82. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/scm/gitlab.py +0 -0
  83. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/scm_comments.py +0 -0
  84. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/socket_config.py +0 -0
  85. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/streaming.py +0 -0
  86. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/tools/coana-cache.mjs +0 -0
  87. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/tools/reachability.py +0 -0
  88. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/core/utils.py +0 -0
  89. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/exit_codes.py +0 -0
  90. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/fossa_compat.py +0 -0
  91. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/output.py +0 -0
  92. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/__init__.py +0 -0
  93. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/base.py +0 -0
  94. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/formatters/__init__.py +0 -0
  95. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/formatters/slack.py +0 -0
  96. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/jira.py +0 -0
  97. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/manager.py +0 -0
  98. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/slack.py +0 -0
  99. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/teams.py +0 -0
  100. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/plugins/webhook.py +0 -0
  101. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/socketsecurity/socketcli.py +0 -0
  102. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/__init__.py +0 -0
  103. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/conftest.py +0 -0
  104. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/create_diff_input.json +0 -0
  105. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_alert_consolidation.py +0 -0
  106. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_cli_exit_contract.py +0 -0
  107. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_diff_alerts.py +0 -0
  108. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_diff_generation.py +0 -0
  109. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_diff_scan_polling.py +0 -0
  110. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_existing_alerts.py +0 -0
  111. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_exit_codes.py +0 -0
  112. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_facts_compression.py +0 -0
  113. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_full_scan_outputs.py +0 -0
  114. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_has_manifest_files.py +0 -0
  115. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_invalid_facts_marker.py +0 -0
  116. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_package_and_alerts.py +0 -0
  117. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_sdk_methods.py +0 -0
  118. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_strict_blocking_duplicates.py +0 -0
  119. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/core/test_supporting_methods.py +0 -0
  120. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/fullscans/create_response.json +0 -0
  121. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/fullscans/diff/stream_diff.json +0 -0
  122. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
  123. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/fullscans/head_scan/metadata.json +0 -0
  124. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
  125. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
  126. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/fullscans/new_scan/metadata.json +0 -0
  127. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
  128. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/repos/repo_info_error.json +0 -0
  129. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/repos/repo_info_no_head.json +0 -0
  130. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/repos/repo_info_success.json +0 -0
  131. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/data/settings/security-policy.json +0 -0
  132. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/fixtures/simple-cargo/Cargo.lock +0 -0
  133. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/fixtures/simple-cargo/Cargo.toml +0 -0
  134. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/fixtures/simple-cargo/src/main.rs +0 -0
  135. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/fixtures/simple-npm/index.js +0 -0
  136. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/fixtures/simple-npm/package.json +0 -0
  137. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/fixtures/simple-pypi/requirements.txt +0 -0
  138. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/reach_facts.py +0 -0
  139. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/run-with-retries.sh +0 -0
  140. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/validate-gitlab.sh +0 -0
  141. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/validate-json.sh +0 -0
  142. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/validate-reachability.sh +0 -0
  143. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/validate-sarif.sh +0 -0
  144. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/e2e/validate-scan.sh +0 -0
  145. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/fixtures/fossa/README.md +0 -0
  146. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/fixtures/fossa/fossa-analyze-empty.json +0 -0
  147. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/fixtures/fossa/fossa-analyze-populated.json +0 -0
  148. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/fixtures/fossa/fossa-sbom-empty-deep.json +0 -0
  149. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/fixtures/fossa/fossa-sbom-populated.json +0 -0
  150. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/__init__.py +0 -0
  151. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_alert_selection.py +0 -0
  152. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_cli_config.py +0 -0
  153. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_cli_run.py +0 -0
  154. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_client.py +0 -0
  155. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_commit_message_truncation.py +0 -0
  156. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_config.py +0 -0
  157. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_dependency_overview.py +0 -0
  158. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_disable_ignore.py +0 -0
  159. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_dockerfile.py +0 -0
  160. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_exclude_paths.py +0 -0
  161. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_fossa_compat.py +0 -0
  162. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_fossa_parity.py +0 -0
  163. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_full_scan_retry.py +0 -0
  164. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_git_interface.py +0 -0
  165. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_git_remote.py +0 -0
  166. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_github_buildkite_config.py +0 -0
  167. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_gitlab_auth.py +0 -0
  168. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_gitlab_auth_fallback.py +0 -0
  169. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_gitlab_commit_status.py +0 -0
  170. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_gitlab_format.py +0 -0
  171. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_ignore_authorization.py +0 -0
  172. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_ignore_telemetry_filtering.py +0 -0
  173. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_include_dirs.py +0 -0
  174. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_log_uploader.py +0 -0
  175. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_manifest_discovery.py +0 -0
  176. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_output.py +0 -0
  177. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_pull_request_context.py +0 -0
  178. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_reachability.py +0 -0
  179. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_scan_scope.py +0 -0
  180. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_slack_plugin.py +0 -0
  181. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_slack_severity_normalization.py +0 -0
  182. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_socketcli.py +0 -0
  183. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_streaming.py +0 -0
  184. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_summary_text.py +0 -0
  185. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_tier1_finalize.py +0 -0
  186. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/tests/unit/test_user_agent.py +0 -0
  187. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/workflows/bitbucket-pipelines.yml +0 -0
  188. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/workflows/buildkite.yml +0 -0
  189. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/workflows/github-actions.yml +0 -0
  190. {socketsecurity-2.13.0 → socketsecurity-2.13.2}/workflows/gitlab-ci.yml +0 -0
@@ -1,3 +1,5 @@
1
+ # Every release already tags `stable`. Run this only to point `stable` at a
2
+ # different release, such as rolling back from a bad one.
1
3
  name: Mark Release as Stable
2
4
  on:
3
5
  workflow_dispatch:
@@ -126,8 +126,11 @@ jobs:
126
126
  # Attach an SPDX SBOM generated from the built image, next to the
127
127
  # provenance attestation the action already adds.
128
128
  sbom: true
129
+ # `stable` follows `latest`. To point it at an older release, run
130
+ # docker-stable.yml.
129
131
  tags: |
130
132
  socketdev/cli:latest
133
+ socketdev/cli:stable
131
134
  socketdev/cli:${{ env.VERSION }}
132
135
  build-args: |
133
136
  CLI_VERSION=${{ env.VERSION }}
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.13.2
4
+
5
+ ### Added
6
+
7
+ - Security and license alerts on a transitive dependency now name the direct
8
+ dependency that introduced it, under the manifest link. Up to five are listed.
9
+
10
+ ### Changed
11
+
12
+ - Manifest file links in PR comments and reports pick the source host only from
13
+ `--scm`. The fallback that guessed GitHub, GitLab, or Bitbucket from the Socket
14
+ diff URL never produced a link and has been removed.
15
+ - Each release now also tags `socketdev/cli:stable`, so `stable` and `latest`
16
+ both point at the newest release. Previously `stable` moved only when someone
17
+ promoted a release by hand. Pin `socketdev/cli:<version>` for reproducible CI
18
+ runs.
19
+
20
+ ### Fixed
21
+
22
+ - Scoped npm packages and Maven artifacts named as the introducing dependency
23
+ keep their scope or group ID (`npm/@acme/widgets@1.2.0`, not
24
+ `npm/widgets@1.2.0`).
25
+
26
+ ## 2.13.1
27
+
28
+ ### Documentation
29
+
30
+ - New [API token permissions](docs/troubleshooting.md#api-token-permissions) guide:
31
+ the scopes `socketcli` needs, what happens without each one, and the API calls
32
+ behind them.
33
+ - Add `diff-scans:create` and `diff-scans:list` to CI tokens. Without them, scan
34
+ comparisons fall back to a less resilient path with only a warning.
35
+ - Documented how the baseline scan for a comparison is chosen.
36
+ - Listed all four accepted token environment variables in priority order.
37
+
38
+ ### Changed: bump the Socket Python SDK to 3.6.3
39
+
40
+ - Bumped the pinned Socket Python SDK (`socketdev`) from `3.6.2` to `3.6.3`.
41
+ The release fixes `settings.integration_events()`, which the CLI does not
42
+ call, so CLI behavior is unchanged.
43
+
3
44
  ## 2.13.0
4
45
 
5
46
  ### Upgrade notes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: socketsecurity
3
- Version: 2.13.0
3
+ Version: 2.13.2
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>
@@ -44,15 +44,15 @@ Requires-Dist: packaging==26.3
44
44
  Requires-Dist: prettytable==3.18.0
45
45
  Requires-Dist: python-dotenv==1.2.4
46
46
  Requires-Dist: requests==2.34.2
47
- Requires-Dist: socketdev==3.6.2
47
+ Requires-Dist: socketdev==3.6.3
48
48
  Provides-Extra: dev
49
49
  Requires-Dist: hatch==1.18.2; extra == 'dev'
50
50
  Requires-Dist: pre-commit==4.7.0; extra == 'dev'
51
- Requires-Dist: ruff==0.17.4; extra == 'dev'
51
+ Requires-Dist: ruff==0.17.5; extra == 'dev'
52
52
  Requires-Dist: twine==7.0.0; extra == 'dev'
53
- Requires-Dist: uv==0.13.7; extra == 'dev'
53
+ Requires-Dist: uv==0.13.8; extra == 'dev'
54
54
  Provides-Extra: test
55
- Requires-Dist: pytest-asyncio==1.4.1.post1; extra == 'test'
55
+ Requires-Dist: pytest-asyncio==1.5.0; extra == 'test'
56
56
  Requires-Dist: pytest-cov==7.1.0; extra == 'test'
57
57
  Requires-Dist: pytest-mock==3.17.0; extra == 'test'
58
58
  Requires-Dist: pytest-watch==4.2.0; extra == 'test'
@@ -79,6 +79,10 @@ pip install socketsecurity
79
79
  export SOCKET_SECURITY_API_TOKEN="<token>"
80
80
  ```
81
81
 
82
+ The token needs more than scan-creation access. Most missing scopes fail the run, and
83
+ a token without the `diff-scans` scopes falls back with only a warning. See
84
+ [`docs/troubleshooting.md#api-token-permissions`](https://github.com/SocketDev/socket-python-cli/blob/main/docs/troubleshooting.md#api-token-permissions).
85
+
82
86
  ### 3) Run a basic scan
83
87
 
84
88
  ```bash
@@ -18,6 +18,10 @@ pip install socketsecurity
18
18
  export SOCKET_SECURITY_API_TOKEN="<token>"
19
19
  ```
20
20
 
21
+ The token needs more than scan-creation access. Most missing scopes fail the run, and
22
+ a token without the `diff-scans` scopes falls back with only a warning. See
23
+ [`docs/troubleshooting.md#api-token-permissions`](https://github.com/SocketDev/socket-python-cli/blob/main/docs/troubleshooting.md#api-token-permissions).
24
+
21
25
  ### 3) Run a basic scan
22
26
 
23
27
  ```bash
@@ -564,8 +564,9 @@ console output and Dashboard association but does not post a PR comment.
564
564
 
565
565
  `socketdev/cli` on Docker Hub packages the CLI with the toolchains reachability
566
566
  analysis runs on: Node.js, Go, Java, .NET, Rust, Ruby, pyenv, and PyPy on
567
- `linux/amd64`. The toolchains are most of the image's size. Tags are published
568
- per release (`socketdev/cli:<version>`), plus `latest` and `stable`.
567
+ `linux/amd64`. The toolchains are most of the image's size. Each release is
568
+ published as `socketdev/cli:<version>`, and `latest` and `stable` both point at
569
+ the newest release. Pin a version tag for reproducible CI runs.
569
570
 
570
571
  ```sh
571
572
  docker run --rm \
@@ -661,3 +662,12 @@ Prebuilt examples in this repo:
661
662
  the console table, including native Buildkite job logs, and in GitHub/GitLab
662
663
  security comments when that SCM adapter is configured. Findings without a known
663
664
  patched release leave the console cell blank and omit the comment field.
665
+ - A token missing the `diff-scans:create` and `diff-scans:list` scopes does not fail
666
+ the build. It logs
667
+ `Diff scan comparison failed with APIAccessDenied(Insufficient permissions)` and falls
668
+ back to a less resilient comparison path. This affects every run that compares
669
+ scans: PR/MR events, and runs without an SCM integration. An SCM-integrated branch
670
+ push creates a full scan and never compares. Tokens created from the nine-scope
671
+ list in the CI/CD token setup guide lack both scopes; see
672
+ [`troubleshooting.md#api-token-permissions`](troubleshooting.md#api-token-permissions)
673
+ for the full scope list and what each missing scope does.
@@ -232,6 +232,22 @@ If you don't want to provide the Socket API Token every time then you can use th
232
232
  |:------------|:---------|:--------|:----------------------------------------------------------------------------------|
233
233
  | `--api-token` | False | | Socket Security API token (can also be set via SOCKET_SECURITY_API_TOKEN env var) |
234
234
 
235
+ The token is read from the first of these that is set, then from `--api-token`:
236
+
237
+ 1. `SOCKET_SECURITY_API_KEY`
238
+ 2. `SOCKET_SECURITY_API_TOKEN`
239
+ 3. `SOCKET_API_KEY`
240
+ 4. `SOCKET_API_TOKEN`
241
+
242
+ This repository's examples use `SOCKET_SECURITY_API_TOKEN`, and the CI/CD guides on
243
+ docs.socket.dev use `SOCKET_SECURITY_API_KEY`. Either works. If both are set,
244
+ `SOCKET_SECURITY_API_KEY` wins.
245
+
246
+ > **Token permissions:** the CLI needs more than scan-creation access. Most missing
247
+ > scopes fail the run, and a token without the `diff-scans` scopes falls back with only
248
+ > a warning. See [`troubleshooting.md#api-token-permissions`](troubleshooting.md#api-token-permissions)
249
+ > for the scopes to grant, the API calls a run makes, and which flags add to them.
250
+
235
251
  #### Repository
236
252
  | Parameter | Required | Default | Description |
237
253
  |:-----------------|:---------|:--------|:------------------------------------------------------------------------------------------------------------------|
@@ -930,7 +946,7 @@ When `--enable-gitlab-security` (or `--enable-json` / `--enable-sarif`) is used
930
946
  ### Requirements
931
947
 
932
948
  - **GitLab Version**: GitLab 12.0 or later (for Security Dashboard support)
933
- - **Socket API Token**: Set via `$SOCKET_API_TOKEN` environment variable or `--api-token` parameter
949
+ - **Socket API Token**: Set via `SOCKET_SECURITY_API_TOKEN` environment variable or `--api-token` parameter (see [Authentication](#authentication) for the other accepted variable names)
934
950
  - **CI/CD Artifacts**: Reports must be uploaded as `dependency_scanning` artifacts
935
951
 
936
952
  ### Troubleshooting
@@ -0,0 +1,306 @@
1
+ # Troubleshooting
2
+
3
+ ## Unexpected CI exit status
4
+
5
+ | Symptom | What to check |
6
+ |---------|---------------|
7
+ | Exit `2`, even with `--disable-blocking` | Fix the flags or configuration reported in the logs. Check config-file readability, native boolean/integer values, a positive timeout and the `files` array. Usage errors are never suppressed. |
8
+ | Exit `3` with no reported findings | Check tokens, scopes, baseline lookup and scan-completeness errors. This is a failed evaluation; `--exit-code-on-api-error` can remap its code. |
9
+ | Ctrl+C is treated as a configuration error | Update wrapper/CI rules: Ctrl+C changed from `2` to `130` in 2.13.0. |
10
+ | Exit `0` despite expected blockers | Check `--disable-blocking`, remapping to `0`, and whether the run produced a full scan instead of a diff. Full scans do not gate on findings. |
11
+
12
+ See [Exit codes in CI](ci-cd.md#exit-codes-in-ci) for the flag combinations and
13
+ [upgrade guidance](../README.md#upgrading-to-2130) for older pipeline rules.
14
+
15
+ ## Repository lookup or creation fails
16
+
17
+ A run that compares scans looks up the repository first, unless `--base-scan-id` or
18
+ `--base-commit-sha` is set. A token missing a repository scope stops there with the
19
+ infrastructure-error code (`3` by default):
20
+
21
+ | Log message | Missing scope |
22
+ |-------------|---------------|
23
+ | `Failed to get repository <repo> (HTTP 403). The API token may be missing the repo:list scope.` | `repo:list` |
24
+ | `API failure while creating repository <repo> (HTTP 403): ...`, then `A 403 here usually means the API token is missing the repo:create scope.` | `repo:create`. Only needed when the repository does not exist yet |
25
+
26
+ Both failures follow `--disable-blocking` and `--exit-code-on-api-error`. Before
27
+ 2.13.0, any failed lookup was treated as a missing repository, so a token without
28
+ `repo:list` ended in the `repo:create` message, and the run exited `2` whatever
29
+ either flag said.
30
+
31
+ ## API token permissions
32
+
33
+ The CLI authenticates with a single Socket organization API token. Most missing scopes
34
+ fail the run with an API error. The two `diff-scans` scopes are the exception: without
35
+ them the run falls back to an older comparison and only logs a warning.
36
+
37
+ ### Scopes to grant
38
+
39
+ For a least-privilege CI token, grant these:
40
+
41
+ | Scope | Needed for | Without it |
42
+ |:---|:---|:---|
43
+ | `full-scans:create` | Creating the scan, on every run. `--reach` also locates the analysis engine, uploads manifests and records the reachability scan under it | The run fails |
44
+ | `full-scans:list` | Finding the baseline scan and comparing against it, on every run that compares scans. Also fetching scan contents for `--enable-json`, `--enable-sarif`, `--enable-gitlab-security` and `--generate-license` on a full scan | Those runs fail |
45
+ | `diff-scans:create` | Creating the comparison | The run [falls back](#apiaccessdenied-on-the-scan-comparison) with a warning |
46
+ | `diff-scans:list` | Polling for the comparison, and finding an existing one | The same fallback |
47
+ | `repo:list` | Looking up the repository's default branch, on runs that compare scans without `--base-scan-id` or `--base-commit-sha` | Those runs fail; see [Repository lookup or creation fails](#repository-lookup-or-creation-fails) |
48
+ | `repo:create` | Creating the repository when that lookup finds none | The first comparison for a repository Socket has not seen fails |
49
+ | `packages:list` | `--generate-license` only | Those runs fail |
50
+
51
+ A failed run exits with the API-error code: `3` by default, the value of
52
+ `--exit-code-on-api-error` when set, or `0` with `--disable-blocking`.
53
+
54
+ Scopes are grouped by their prefix, and granting a group grants every scope in it:
55
+ `full-scans` covers `full-scans:create`, `full-scans:list` and `full-scans:delete`. The
56
+ dashboard's token dialog lists each scope under its group. A token with the groups
57
+ `full-scans`, `diff-scans`, `repo` and `packages` therefore works too; it just holds
58
+ more than this CLI uses.
59
+
60
+ The scopes each endpoint checks are listed in the
61
+ [API reference](https://docs.socket.dev/reference). `GET organizations` and the
62
+ telemetry event posted when someone replies to a Socket comment with an ignore command
63
+ check no scope, so any valid token for the organization works. `GET report/supported`
64
+ needs no token at all.
65
+
66
+ **Tokens restricted to specific repositories** can scan those repositories but cannot
67
+ set up a new one. The API rejects them on `POST orgs/{org}/repos`, and
68
+ `POST orgs/{org}/full-scans` does not create a missing repository for them, whatever
69
+ scopes they hold. They are also rejected on `POST orgs/{org}/purl`, so
70
+ `--generate-license` needs a token with organization-wide repository access.
71
+
72
+ ### Tokens with the nine-scope CI/CD list
73
+
74
+ The [CI/CD token setup guide](https://docs.socket.dev/docs/create-socket-api-key-for-cicd)
75
+ was written before the diff-scans endpoints existed. Tokens created from its
76
+ nine-scope list hold exactly these:
77
+
78
+ `repo:list`, `repo:create`, `repo:update`, `security-policy:read`,
79
+ `triage:alerts-list`, `triage:alerts-update`, `full-scans:list`, `full-scans:create`,
80
+ `packages:list`
81
+
82
+ **That list has neither `diff-scans:create` nor `diff-scans:list`**, and every run
83
+ that compares scans uses both. A token with only those nine scopes always falls back
84
+ to the older comparison path; see
85
+ [the next section](#apiaccessdenied-on-the-scan-comparison). Add the two scopes.
86
+
87
+ The list also has four scopes this CLI never uses: `repo:update`,
88
+ `security-policy:read`, `triage:alerts-list` and `triage:alerts-update`. A token used
89
+ only by `socketcli` can drop them.
90
+
91
+ ### API calls by run type
92
+
93
+ Every run:
94
+
95
+ | API call | Scope | Purpose |
96
+ |:---|:---|:---|
97
+ | `GET organizations` | none | Resolve the org ID and slug from the token |
98
+ | `POST python-cli-runs` | `full-scans:create` | Register the run. When log upload is on (`--upload-logs`, or enabled for the organization), `POST python-cli-runs/{id}/logs` and `POST python-cli-runs/{id}/finalize` follow under the same scope. A failure in any of the three is ignored |
99
+ | `GET report/supported` | none | Fetch supported manifest patterns |
100
+ | `POST orgs/{org}/full-scans` | `full-scans:create` | Create the new scan. With an organization-wide token, the server creates the repository if it does not exist yet |
101
+
102
+ Comment events with `--scm github` or `--scm gitlab` create no scan.
103
+
104
+ Runs that compare scans (see [which runs compare](#apiaccessdenied-on-the-scan-comparison)) add:
105
+
106
+ | API call | Scope | Purpose |
107
+ |:---|:---|:---|
108
+ | `GET orgs/{org}/repos/{repo}` | `repo:list` | Look up the repository's default branch. Skipped with `--base-scan-id` or `--base-commit-sha` |
109
+ | `POST orgs/{org}/repos` | `repo:create` | Create the repository, **only attempted when the lookup above finds none** |
110
+ | `GET orgs/{org}/full-scans` | `full-scans:list` | Find the baseline: the newest matching scan on the default branch, or with `--base-commit-sha` the scan for that commit or a scanned ancestor. Skipped with `--base-scan-id` |
111
+ | `POST orgs/{org}/full-scans` | `full-scans:create` | Create a temporary empty baseline when no scan matches |
112
+ | `POST orgs/{org}/diff-scans/from-ids` | `diff-scans:create` and `full-scans:list` | Create the comparison (preferred path) |
113
+ | `GET orgs/{org}/diff-scans` | `diff-scans:list` | Find the existing comparison when creation returns 409 |
114
+ | `GET orgs/{org}/diff-scans/{id}` | `diff-scans:list` | Poll for the computed comparison |
115
+ | `GET orgs/{org}/full-scans/diff` | `full-scans:list` | Streaming comparison (fallback path). The API marks this endpoint as deprecated |
116
+
117
+ Flags add:
118
+
119
+ | Flag | API call | Scope |
120
+ |:---|:---|:---|
121
+ | `--reach` | `GET organizations` (plan check) | none |
122
+ | `--reach` | `POST orgs/{org}/coana-cli/artifacts` (locate the analysis engine download, only when it is not cached) | `full-scans:create` or `fixes:list` |
123
+ | `--reach` | `POST orgs/{org}/upload-manifest-files`, `POST tier1-reachability-scan/finalize` | `full-scans:create` |
124
+ | `--generate-license` | `POST orgs/{org}/purl` | `packages:list` |
125
+ | `--enable-json`, `--enable-sarif`, `--enable-gitlab-security` or `--generate-license` on a full scan | `GET orgs/{org}/full-scans/{id}` (scan contents) | `full-scans:list` |
126
+ | `--strict-blocking`, `--enable-gitlab-security` or `--legal-format fossa` on a run that compares scans | `GET orgs/{org}/full-scans/{id}` (alerts on unchanged packages) | `full-scans:list` |
127
+
128
+ `--reach` also runs the analysis engine with the same token. The engine reports to the
129
+ `tier1-reachability-scan/*` endpoints, which check `full-scans:create`.
130
+
131
+ ## `APIAccessDenied` on the scan comparison
132
+
133
+ Any run that compares scans first tries the diff-scans endpoints. A token without the
134
+ `diff-scans:create` and `diff-scans:list` scopes logs a warning and continues on the
135
+ older path:
136
+
137
+ ```
138
+ Diff scan comparison failed with APIAccessDenied(Insufficient permissions), falling back to the streaming scan comparison
139
+ ```
140
+
141
+ The scan still succeeds and the diff results are the same, so this is easy to miss.
142
+
143
+ **Which runs compare scans:**
144
+
145
+ | Run | Compares? |
146
+ |:---|:---|
147
+ | Pull request or merge request run with `--scm github` / `--scm gitlab` | Yes |
148
+ | Comment event with `--scm github` / `--scm gitlab` | No. It creates no scan |
149
+ | Any other event with `--scm github` / `--scm gitlab` (branch and default-branch pushes) | No. It creates a full scan |
150
+ | No SCM integration (`--scm api`, the default) | Yes |
151
+
152
+ In the rows that compare, the CLI first looks for a supported manifest among the
153
+ commit's changed files, or among `--files` when that is given. If it finds none, or
154
+ the directory is not a git repository and `--files` is not given, it creates a full
155
+ scan instead. `--ignore-commit-files` in a git repository and `--enable-diff` outside
156
+ one skip that check, so those runs always compare.
157
+
158
+ Before 2.9.0 an SCM-integrated branch push also compared, so a pipeline scanning only
159
+ pushes (`--pr-number 0 --default-branch`) hit this too. If you are diagnosing an older
160
+ run, that is why the warning can appear in a log with no pull request in sight.
161
+
162
+ **Which scope is missing.** The fallback calls `GET orgs/{org}/full-scans/diff`, which
163
+ checks `full-scans:list`. When the fallback succeeds, the missing scope is
164
+ `diff-scans:create`, `diff-scans:list`, or both. A token without `full-scans:list`
165
+ does not get that far: the CLI lists full scans to pick the baseline before it compares
166
+ anything, so the run fails first with `Failed to resolve the matching head scan for
167
+ repo ...` and the API-error exit code. With `--base-scan-id` that lookup is skipped,
168
+ and the run fails at the fallback instead. A fallback that fails another way, such as a
169
+ timeout or a dropped connection, says nothing about scopes.
170
+
171
+ **Why the diff-scans path is preferred.** It polls with short, bounded requests rather
172
+ than holding one connection open while the backend computes, which is what lets large
173
+ comparisons survive network idle timeouts — notably Azure NAT gateways, which reap idle
174
+ connections after four minutes and surface as an intermittent `ConnectionResetError`.
175
+ Falling back costs resilience, not correctness.
176
+
177
+ The two paths can take noticeably different amounts of time on the same repository,
178
+ because cached diff-scan responses always embed per-package license details while the
179
+ streaming comparison requests a lean payload. On a large dependency tree, compare the
180
+ `Diff scan comparison ready in ...` timing against the `Diff Report Gathered in ...`
181
+ total before assuming either path is at fault.
182
+
183
+ ## Baseline scans that do not appear in the dashboard
184
+
185
+ A run that compares scans picks its baseline from the repository's default branch: the
186
+ newest scan there with the same scan type (`socket`, or `socket_tier1` with `--reach`)
187
+ and, with `--workspace`, the same workspace. `--base-scan-id` and `--base-commit-sha`
188
+ override that choice. When no scan matches, the CLI creates a **temporary empty
189
+ baseline** and compares to that:
190
+
191
+ ```
192
+ No previous scan found - creating empty baseline scan
193
+ Baseline selected: source=empty scan_id="<baseline>"
194
+ Comparing scans - Head scan ID: <baseline>, New scan ID: <real scan>
195
+ ```
196
+
197
+ The baseline is created as a temporary scan and is deliberately not set as the
198
+ repository head or default branch, so it does not show up as a repository scan in the
199
+ dashboard. Looking it up by ID will come up empty. This is expected — the scan to look
200
+ at is the "New scan ID".
201
+
202
+ Because everything is new relative to an empty baseline, that comparison reports
203
+ every package as added and zero as unchanged. This happens on a repository's first
204
+ comparison, and also the first time it is compared under a different scan type or
205
+ workspace, such as the first `--reach` run on a repository that only has regular
206
+ scans. A new branch compares against the default branch's newest matching scan, not an
207
+ empty baseline.
208
+
209
+ ## Reachability scan IDs are not full-scan IDs
210
+
211
+ With `--reach`, the CLI logs an extra identifier before the normal scan flow starts:
212
+
213
+ ```
214
+ Reachability scan ID: <tier-1 reachability scan ID>
215
+ ```
216
+
217
+ That value is `tier1ReachabilityScanId`, read out of `.socket.facts.json`. It
218
+ identifies the reachability analysis run, not a Socket full scan, and will not resolve
219
+ in the dashboard's scan views. The full scan to look at is the "New scan ID" reported
220
+ by the comparison step that follows.
221
+
222
+ ## Common gotchas
223
+
224
+ - In diff scope, `--strict-blocking` uses a stricter alert set (`new + unchanged`) for blocking checks and diff-based output selection.
225
+ - `--sarif-scope full` requires `--reach`.
226
+ - In `--sarif-scope full` with `--sarif-file`, SARIF JSON is written to file and stdout JSON is suppressed.
227
+ - `--sarif-grouping alert` currently applies to `--sarif-scope full`.
228
+
229
+ ## Reachability on a restricted network
230
+
231
+ - `Failed to run reachability analysis: HTTPSConnectionPool(host='storage.googleapis.com', ...)`: the engine download is blocked. Allow `storage.googleapis.com`, or set `HTTPS_PROXY`. An npm mirror does not cover it.
232
+ - Every vulnerability reported as `INSTALL ERROR`: the engine could not install your dependencies. Allow the ecosystem's package registry, or install dependencies in the target path before running `--reach`.
233
+ - See **Reachability network access** in the [CLI reference](cli-reference.md) for the full list of hosts.
234
+
235
+ ## Dashboard vs CLI result counts
236
+
237
+ Differences in result counts can be valid, even when filtering appears similar.
238
+
239
+ Common reasons:
240
+
241
+ - `diff` vs `full` data source:
242
+ - `--sarif-scope diff` is based on diff alerts (typically net-new in the compared scan context).
243
+ - `--sarif-scope full` is based on full reachability facts data.
244
+ - Consolidation differences:
245
+ - Dashboard and API/CLI can apply different consolidation/grouping rules.
246
+ - `--sarif-grouping alert` and `--sarif-grouping instance` intentionally produce different row counts.
247
+ - Policy vs dataset:
248
+ - `--strict-blocking` only affects diff-scope behavior and does not make diff output equivalent to full dashboard data.
249
+ - Reachability data availability:
250
+ - If reachability analysis partially fails and falls back to precomputed reachability, counts can shift.
251
+
252
+ Recommended comparison path:
253
+
254
+ 1. Use full-scope SARIF for parity-oriented comparisons.
255
+ 2. Keep grouping fixed (`alert` for dashboard-style rollups, `instance` for detailed exports).
256
+ 3. Compare reachability filters with the same mode and grouping across runs.
257
+
258
+ ## Save submitted file list
259
+
260
+ Use `--save-submitted-files-list` to inspect exactly what was sent for scanning.
261
+
262
+ ```bash
263
+ socketcli --save-submitted-files-list submitted_files.json
264
+ ```
265
+
266
+ Output includes:
267
+
268
+ - timestamp
269
+ - total file count
270
+ - total size
271
+ - complete submitted file list
272
+
273
+ ## Save manifest archive
274
+
275
+ Use `--save-manifest-tar` to export discovered manifest files as `.tar.gz`.
276
+
277
+ ```bash
278
+ socketcli --save-manifest-tar manifest_files.tar.gz
279
+ ```
280
+
281
+ Combined example:
282
+
283
+ ```bash
284
+ socketcli --save-submitted-files-list files.json --save-manifest-tar backup.tar.gz
285
+ ```
286
+
287
+ ## Octopus merge note
288
+
289
+ For octopus merges (3+ parents), Git can report incomplete changed-file sets because default diff compares against the first parent.
290
+
291
+ If needed, force full scan behavior with:
292
+
293
+ - `--ignore-commit-files`
294
+
295
+ ## GitLab report troubleshooting
296
+
297
+ If report is not visible in GitLab Security Dashboard:
298
+
299
+ - verify `dependency_scanning` artifact is configured in `.gitlab-ci.yml`
300
+ - verify job completed and artifact uploaded
301
+ - verify report file schema is valid
302
+
303
+ If vulnerabilities array is empty:
304
+
305
+ - this can be expected when no actionable security issues are present in the result scope
306
+ - confirm expected scope/flags and compare with Socket dashboard data
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "socketsecurity"
9
- version = "2.13.0"
9
+ version = "2.13.2"
10
10
  requires-python = ">= 3.11"
11
11
  license = {"file" = "LICENSE"}
12
12
  dependencies = [
@@ -16,7 +16,7 @@ dependencies = [
16
16
  "gitpython==3.2.1",
17
17
  "packaging==26.3",
18
18
  "python-dotenv==1.2.4",
19
- "socketdev==3.6.2",
19
+ "socketdev==3.6.3",
20
20
  "beautifulsoup4==4.15.0",
21
21
  "markdown==3.11.3",
22
22
  "brotli==1.2.1; platform_python_implementation == 'CPython'",
@@ -47,13 +47,13 @@ test = [
47
47
  "pytest==9.2.0",
48
48
  "pytest-cov==7.1.0",
49
49
  "pytest-mock==3.17.0",
50
- "pytest-asyncio==1.4.1.post1",
50
+ "pytest-asyncio==1.5.0",
51
51
  "pytest-watch==4.2.0"
52
52
  ]
53
53
  dev = [
54
- "ruff==0.17.4",
54
+ "ruff==0.17.5",
55
55
  "twine==7.0.0", # for building
56
- "uv==0.13.7", # for dependency management
56
+ "uv==0.13.8", # for dependency management
57
57
  "pre-commit==4.7.0",
58
58
  "hatch==1.18.2"
59
59
  ]
@@ -1,4 +1,4 @@
1
1
  __author__ = 'socket.dev'
2
- __version__ = '2.13.0'
2
+ __version__ = '2.13.2'
3
3
  USER_AGENT_NAME = 'socket-python-cli'
4
4
  USER_AGENT = f'{USER_AGENT_NAME}/{__version__}'
@@ -2795,7 +2795,12 @@ class Core:
2795
2795
  top_package = packages.get(top_id)
2796
2796
  if top_package:
2797
2797
  manifests = ""
2798
- top_purl = f"{top_package.type}/{top_package.name}@{top_package.version}"
2798
+ ancestor_name = (
2799
+ f"{top_package.namespace}/{top_package.name}"
2800
+ if top_package.namespace
2801
+ else top_package.name
2802
+ )
2803
+ top_purl = f"{top_package.type}/{ancestor_name}@{top_package.version}"
2799
2804
  if hasattr(top_package, "manifestFiles") and top_package.manifestFiles:
2800
2805
  for manifest_data in top_package.manifestFiles:
2801
2806
  manifest_file = manifest_data.get("file")
@@ -78,18 +78,10 @@ class Messages:
78
78
  # Remove leading slashes
79
79
  clean_path = clean_path.lstrip('/')
80
80
 
81
- # Determine SCM type from config or diff_url
82
- scm_type = "api" # Default to API
81
+ # diff.diff_url points at Socket, not the SCM, so only config decides.
82
+ scm_type = "api"
83
83
  if config and hasattr(config, 'scm'):
84
84
  scm_type = config.scm.lower()
85
- elif hasattr(diff, 'diff_url') and diff.diff_url:
86
- diff_url = diff.diff_url.lower()
87
- if 'github.com' in diff_url or 'github' in diff_url:
88
- scm_type = "github"
89
- elif 'gitlab' in diff_url:
90
- scm_type = "gitlab"
91
- elif 'bitbucket' in diff_url:
92
- scm_type = "bitbucket"
93
85
 
94
86
  # Generate URL based on SCM type using config information
95
87
  # NEVER use diff.diff_url for SCM URLs - those are Socket URLs for "View report" links
@@ -861,6 +853,35 @@ class Messages:
861
853
  """
862
854
  return escape(Messages.inline_html_text(value))
863
855
 
856
+ # Enough to name the usual one or two ancestors without letting a package
857
+ # pulled in by dozens of direct dependencies swamp the alert row.
858
+ INTRODUCED_BY_LIMIT = 5
859
+
860
+ @staticmethod
861
+ def introduced_by_html(alert: Issue) -> str:
862
+ """Name the direct dependencies that pulled a transitive package in.
863
+
864
+ Returns an empty string for a direct dependency, or for a transitive one
865
+ whose ancestors are not in this scan, so the row only gains a line when
866
+ there is an ancestor to name.
867
+ """
868
+ ancestors = []
869
+ for entry in getattr(alert, "introduced_by", None) or []:
870
+ if not isinstance(entry, (list, tuple)) or not entry:
871
+ continue
872
+ source = entry[0]
873
+ if source and source != "direct" and source not in ancestors:
874
+ ancestors.append(source)
875
+ if not ancestors:
876
+ return ""
877
+
878
+ shown = ancestors[:Messages.INTRODUCED_BY_LIMIT]
879
+ names = ", ".join(f"<code>{Messages.html_text(name)}</code>" for name in shown)
880
+ hidden = len(ancestors) - len(shown)
881
+ if hidden:
882
+ names += f" and {hidden} more"
883
+ return f"<p><strong>Introduced by:</strong> {names}</p>"
884
+
864
885
  @staticmethod
865
886
  def html_attr(value) -> str:
866
887
  """Escape a value for an HTML attribute, quotes included.
@@ -990,6 +1011,7 @@ class Messages:
990
1011
  ) if show_ignore else ""
991
1012
  row += f""" </ul>
992
1013
  <p><strong>From:</strong> <a href="{Messages.html_attr(license_manifest_url)}">Manifest File</a></p>
1014
+ {Messages.introduced_by_html(first_alert)}
993
1015
  <p>ℹ️ Read more on: <a href="{Messages.html_attr(first_alert.purl)}">This package</a> | <a href="https://socket.dev/alerts/license">What is a license policy violation?</a></p>
994
1016
  <blockquote>
995
1017
  <p><em>Next steps:</em> Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at <strong>support@socket.dev</strong>.</p>
@@ -1039,6 +1061,7 @@ class Messages:
1039
1061
  <p><strong>Note:</strong> {Messages.html_text(alert.description)}</p>
1040
1062
  {patched_version_html}
1041
1063
  <p><strong>Source:</strong> <a href="{Messages.html_attr(manifest_url)}">Manifest File</a></p>
1064
+ {Messages.introduced_by_html(alert)}
1042
1065
  <p>ℹ️ Read more on:
1043
1066
  <a href="{Messages.html_attr(alert.purl)}">This package</a> |
1044
1067
  <a href="{Messages.html_attr(alert.url)}">This alert</a> |
@@ -102,3 +102,21 @@ def test_manifest_link_falls_back_to_the_report_without_a_repository_url():
102
102
  url = Messages.get_manifest_file_url(diff, "app/package.json", config)
103
103
 
104
104
  assert url == "https://socket.dev/report/123?tab=files&file=app%2Fpackage.json"
105
+
106
+
107
+
108
+ def test_manifest_link_does_not_guess_the_scm_from_the_diff_url():
109
+ """Without an explicit scm, a GitHub-looking diff_url falls back to the report."""
110
+
111
+ class _NoScmConfig:
112
+ branch = "main"
113
+ repository_url = "https://github.com/acme/widgets"
114
+
115
+ diff = Diff(
116
+ diff_url="https://github.com/acme/widgets/pull/1",
117
+ report_url="https://socket.dev/report/123",
118
+ )
119
+
120
+ url = Messages.get_manifest_file_url(diff, "app/package.json", _NoScmConfig())
121
+
122
+ assert url == "https://socket.dev/report/123?tab=files&file=app%2Fpackage.json"