socketsecurity 2.2.92__tar.gz → 2.3.0__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 (139) hide show
  1. socketsecurity-2.3.0/.github/dependabot.yml +74 -0
  2. socketsecurity-2.3.0/.github/workflows/dependabot-review.yml +205 -0
  3. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/workflows/e2e-test.yml +8 -1
  4. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/workflows/python-tests.yml +16 -0
  5. socketsecurity-2.3.0/.gitignore +58 -0
  6. socketsecurity-2.3.0/CHANGELOG.md +176 -0
  7. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/PKG-INFO +43 -1
  8. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/README.md +42 -0
  9. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/pyproject.toml +1 -1
  10. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/__init__.py +1 -1
  11. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/config.py +30 -0
  12. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/__init__.py +10 -5
  13. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/socketcli.py +59 -7
  14. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/core/test_sdk_methods.py +1 -0
  15. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/e2e/fixtures/simple-npm/package.json +1 -1
  16. socketsecurity-2.3.0/tests/e2e/fixtures/simple-pypi/requirements.txt +3 -0
  17. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_cli_config.py +39 -0
  18. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_socketcli.py +96 -0
  19. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/uv.lock +84 -84
  20. socketsecurity-2.2.92/.gitignore +0 -34
  21. socketsecurity-2.2.92/CHANGELOG.md +0 -71
  22. socketsecurity-2.2.92/tests/e2e/fixtures/simple-pypi/requirements.txt +0 -3
  23. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/CODEOWNERS +0 -0
  24. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  25. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  26. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  27. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  28. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/workflows/docker-stable.yml +0 -0
  29. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/workflows/pr-preview.yml +0 -0
  30. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/workflows/release.yml +0 -0
  31. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/workflows/version-check.yml +0 -0
  32. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.github/zizmor.yml +0 -0
  33. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.hooks/sync_version.py +0 -0
  34. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.pre-commit-config.yaml +0 -0
  35. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/.python-version +0 -0
  36. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/Dockerfile +0 -0
  37. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/LICENSE +0 -0
  38. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/Makefile +0 -0
  39. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/docs/ci-cd.md +0 -0
  40. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/docs/cli-reference.md +0 -0
  41. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/docs/development.md +0 -0
  42. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/docs/troubleshooting.md +0 -0
  43. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/examples/config/sarif-dashboard-parity.json +0 -0
  44. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/examples/config/sarif-dashboard-parity.toml +0 -0
  45. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/examples/config/sarif-diff-ci-cd.json +0 -0
  46. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/examples/config/sarif-diff-ci-cd.toml +0 -0
  47. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/examples/config/sarif-instance-detail.json +0 -0
  48. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/examples/config/sarif-instance-detail.toml +0 -0
  49. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/instructions/gitlab-commit-status/uat.md +0 -0
  50. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/pytest.ini +0 -0
  51. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/scripts/build_container.sh +0 -0
  52. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/scripts/build_container_flexible.sh +0 -0
  53. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/scripts/deploy-test-docker.sh +0 -0
  54. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/scripts/deploy-test-pypi.sh +0 -0
  55. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/scripts/docker-entrypoint.sh +0 -0
  56. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/scripts/run.sh +0 -0
  57. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/session.md +0 -0
  58. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socket.yml +0 -0
  59. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/alert_selection.py +0 -0
  60. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/classes.py +0 -0
  61. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/cli_client.py +0 -0
  62. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/exceptions.py +0 -0
  63. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/git_interface.py +0 -0
  64. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/helper/__init__.py +0 -0
  65. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
  66. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/lazy_file_loader.py +0 -0
  67. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/logging.py +0 -0
  68. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/messages.py +0 -0
  69. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/resource_utils.py +0 -0
  70. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/scm/__init__.py +0 -0
  71. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/scm/base.py +0 -0
  72. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/scm/client.py +0 -0
  73. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/scm/github.py +0 -0
  74. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/scm/gitlab.py +0 -0
  75. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/scm_comments.py +0 -0
  76. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/socket_config.py +0 -0
  77. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/tools/reachability.py +0 -0
  78. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/core/utils.py +0 -0
  79. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/fossa_compat.py +0 -0
  80. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/output.py +0 -0
  81. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/__init__.py +0 -0
  82. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/base.py +0 -0
  83. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/formatters/__init__.py +0 -0
  84. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/formatters/slack.py +0 -0
  85. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/jira.py +0 -0
  86. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/manager.py +0 -0
  87. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/slack.py +0 -0
  88. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/teams.py +0 -0
  89. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/socketsecurity/plugins/webhook.py +0 -0
  90. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/__init__.py +0 -0
  91. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/core/conftest.py +0 -0
  92. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/core/create_diff_input.json +0 -0
  93. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/core/test_diff_alerts.py +0 -0
  94. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/core/test_diff_generation.py +0 -0
  95. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/core/test_has_manifest_files.py +0 -0
  96. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/core/test_package_and_alerts.py +0 -0
  97. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/core/test_supporting_methods.py +0 -0
  98. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/fullscans/create_response.json +0 -0
  99. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/fullscans/diff/stream_diff.json +0 -0
  100. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
  101. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/fullscans/head_scan/metadata.json +0 -0
  102. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
  103. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
  104. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/fullscans/new_scan/metadata.json +0 -0
  105. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
  106. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/repos/repo_info_error.json +0 -0
  107. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/repos/repo_info_no_head.json +0 -0
  108. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/repos/repo_info_success.json +0 -0
  109. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/data/settings/security-policy.json +0 -0
  110. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/e2e/fixtures/simple-npm/index.js +0 -0
  111. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/e2e/validate-gitlab.sh +0 -0
  112. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/e2e/validate-json.sh +0 -0
  113. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/e2e/validate-reachability.sh +0 -0
  114. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/e2e/validate-sarif.sh +0 -0
  115. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/e2e/validate-scan.sh +0 -0
  116. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/fixtures/fossa/README.md +0 -0
  117. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/fixtures/fossa/fossa-analyze-empty.json +0 -0
  118. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/fixtures/fossa/fossa-analyze-populated.json +0 -0
  119. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/fixtures/fossa/fossa-sbom-empty-deep.json +0 -0
  120. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/fixtures/fossa/fossa-sbom-populated.json +0 -0
  121. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/__init__.py +0 -0
  122. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_alert_selection.py +0 -0
  123. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_client.py +0 -0
  124. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_config.py +0 -0
  125. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_dependency_overview.py +0 -0
  126. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_disable_ignore.py +0 -0
  127. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_fossa_compat.py +0 -0
  128. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_fossa_parity.py +0 -0
  129. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_gitlab_auth.py +0 -0
  130. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_gitlab_auth_fallback.py +0 -0
  131. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_gitlab_commit_status.py +0 -0
  132. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_gitlab_format.py +0 -0
  133. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_ignore_telemetry_filtering.py +0 -0
  134. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_output.py +0 -0
  135. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/tests/unit/test_slack_plugin.py +0 -0
  136. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/workflows/bitbucket-pipelines.yml +0 -0
  137. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/workflows/buildkite.yml +0 -0
  138. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/workflows/github-actions.yml +0 -0
  139. {socketsecurity-2.2.92 → socketsecurity-2.3.0}/workflows/gitlab-ci.yml +0 -0
@@ -0,0 +1,74 @@
1
+ # Dependabot configuration for socket-python-cli.
2
+ #
3
+ # Design notes:
4
+ # - Python deps are grouped into a weekly PR (minor/patch).
5
+ # - GitHub Actions are grouped similarly into one weekly PR.
6
+ # - Docker (the project Dockerfile) is tracked separately.
7
+ # - 7-day cooldown enforced across all ecosystems.
8
+
9
+ version: 2
10
+ updates:
11
+
12
+ # Main app Python deps (uv-tracked)
13
+ - package-ecosystem: "uv"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "weekly"
17
+ open-pull-requests-limit: 2
18
+ groups:
19
+ python-minor-patch:
20
+ patterns:
21
+ - "*"
22
+ update-types:
23
+ - "minor"
24
+ - "patch"
25
+ python-major:
26
+ patterns:
27
+ - "*"
28
+ update-types:
29
+ - "major"
30
+ labels:
31
+ - "dependencies"
32
+ - "python:uv"
33
+ commit-message:
34
+ prefix: "chore"
35
+ include: "scope"
36
+ cooldown:
37
+ default-days: 7
38
+
39
+ # GitHub Actions used in workflows
40
+ - package-ecosystem: "github-actions"
41
+ directory: "/"
42
+ schedule:
43
+ interval: "weekly"
44
+ open-pull-requests-limit: 2
45
+ groups:
46
+ github-actions-minor-patch:
47
+ patterns:
48
+ - "*"
49
+ update-types:
50
+ - "minor"
51
+ - "patch"
52
+ labels:
53
+ - "dependencies"
54
+ - "github-actions"
55
+ commit-message:
56
+ prefix: "ci"
57
+ include: "scope"
58
+ cooldown:
59
+ default-days: 7
60
+
61
+ # Project Dockerfile base images and pinned binaries
62
+ - package-ecosystem: "docker"
63
+ directory: "/"
64
+ schedule:
65
+ interval: "weekly"
66
+ open-pull-requests-limit: 2
67
+ labels:
68
+ - "dependencies"
69
+ - "docker"
70
+ commit-message:
71
+ prefix: "chore"
72
+ include: "scope"
73
+ cooldown:
74
+ default-days: 7
@@ -0,0 +1,205 @@
1
+ name: dependabot-review
2
+
3
+ # Dependency-update PR guardrails for Dependabot-authored PRs.
4
+ #
5
+ # Runs only on PRs opened by dependabot[bot]. Inspects which files
6
+ # changed, then conditionally runs Socket Firewall (sfw) install smoke
7
+ # jobs for the affected manifests. Because sfw uses the free, anonymous
8
+ # Socket public-data path it needs NO API key, so we can run it from
9
+ # the unprivileged `pull_request` context without pull_request_target
10
+ # or any of its security tradeoffs.
11
+ #
12
+ # Pattern adapted from SocketDev/socket-basics.
13
+
14
+ on:
15
+ pull_request:
16
+ types: [opened, synchronize, reopened, ready_for_review]
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ concurrency:
22
+ group: dependabot-review-${{ github.event.pull_request.number }}
23
+ cancel-in-progress: true
24
+
25
+ jobs:
26
+ inspect:
27
+ if: github.event.pull_request.user.login == 'dependabot[bot]'
28
+ runs-on: ubuntu-latest
29
+ timeout-minutes: 5
30
+ outputs:
31
+ python_deps_changed: ${{ steps.diff.outputs.python_deps_changed }}
32
+ fixture_npm_changed: ${{ steps.diff.outputs.fixture_npm_changed }}
33
+ fixture_pypi_changed: ${{ steps.diff.outputs.fixture_pypi_changed }}
34
+ dockerfile_changed: ${{ steps.diff.outputs.dockerfile_changed }}
35
+ workflow_or_action_changed: ${{ steps.diff.outputs.workflow_or_action_changed }}
36
+ steps:
37
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
38
+ with:
39
+ fetch-depth: 0
40
+ persist-credentials: false
41
+
42
+ - name: Inspect changed files
43
+ id: diff
44
+ env:
45
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
46
+ HEAD_SHA: ${{ github.event.pull_request.head.sha }}
47
+ run: |
48
+ CHANGED_FILES="$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")"
49
+
50
+ {
51
+ echo "## Changed files"
52
+ echo '```'
53
+ printf '%s\n' "$CHANGED_FILES"
54
+ echo '```'
55
+ } >> "$GITHUB_STEP_SUMMARY"
56
+
57
+ has_file() {
58
+ local pattern="$1"
59
+ if printf '%s\n' "$CHANGED_FILES" | grep -Eq "$pattern"; then
60
+ echo "true"
61
+ else
62
+ echo "false"
63
+ fi
64
+ }
65
+
66
+ {
67
+ echo "python_deps_changed=$(has_file '^(pyproject\.toml|uv\.lock)$')"
68
+ echo "fixture_npm_changed=$(has_file '^tests/e2e/fixtures/simple-npm/')"
69
+ echo "fixture_pypi_changed=$(has_file '^tests/e2e/fixtures/simple-pypi/')"
70
+ echo "dockerfile_changed=$(has_file '^Dockerfile$')"
71
+ echo "workflow_or_action_changed=$(has_file '^\.github/workflows/|^\.github/dependabot\.yml$')"
72
+ } >> "$GITHUB_OUTPUT"
73
+
74
+ - name: Summarize review expectations
75
+ env:
76
+ PR_URL: ${{ github.event.pull_request.html_url }}
77
+ run: |
78
+ {
79
+ echo "## Dependabot Review Checklist"
80
+ echo "- PR: $PR_URL"
81
+ echo "- Confirm upstream release notes before merge"
82
+ echo "- Do not treat a Dependabot PR as trusted solely because of the actor"
83
+ echo "- This workflow runs in pull_request context only; no publish secrets are exposed"
84
+ } >> "$GITHUB_STEP_SUMMARY"
85
+
86
+ python-sfw-smoke:
87
+ needs: inspect
88
+ if: needs.inspect.outputs.python_deps_changed == 'true'
89
+ runs-on: ubuntu-latest
90
+ timeout-minutes: 15
91
+ steps:
92
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
93
+ with:
94
+ fetch-depth: 1
95
+ persist-credentials: false
96
+
97
+ - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
98
+ with:
99
+ python-version: "3.12"
100
+
101
+ - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
102
+ with:
103
+ node-version: "20"
104
+
105
+ - name: Install Socket Firewall
106
+ run: npm install -g sfw
107
+
108
+ - name: Install uv
109
+ run: python -m pip install --upgrade pip uv
110
+
111
+ - name: Sync project through Socket Firewall
112
+ run: sfw uv sync --extra test --extra dev
113
+
114
+ - name: Import smoke test
115
+ run: |
116
+ uv run python -c "
117
+ from socketsecurity.socketcli import cli, build_socket_sdk
118
+ from socketsecurity.core import Core
119
+ from socketsecurity.core.exceptions import (
120
+ APIFailure, RequestTimeoutExceeded, APIResourceNotFound,
121
+ )
122
+ from socketsecurity.core.git_interface import Git
123
+ from socketsecurity.config import CliConfig
124
+ print('import smoke OK')
125
+ "
126
+
127
+ fixture-npm-sfw-smoke:
128
+ needs: inspect
129
+ if: needs.inspect.outputs.fixture_npm_changed == 'true'
130
+ runs-on: ubuntu-latest
131
+ timeout-minutes: 15
132
+ steps:
133
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
134
+ with:
135
+ fetch-depth: 1
136
+ persist-credentials: false
137
+
138
+ - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
139
+ with:
140
+ node-version: "20"
141
+
142
+ - name: Install Socket Firewall
143
+ run: npm install -g sfw
144
+
145
+ - name: Install fixture through Socket Firewall
146
+ working-directory: tests/e2e/fixtures/simple-npm
147
+ run: sfw npm install --no-audit --no-fund --ignore-scripts
148
+
149
+ fixture-pypi-sfw-smoke:
150
+ needs: inspect
151
+ if: needs.inspect.outputs.fixture_pypi_changed == 'true'
152
+ runs-on: ubuntu-latest
153
+ timeout-minutes: 15
154
+ steps:
155
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
156
+ with:
157
+ fetch-depth: 1
158
+ persist-credentials: false
159
+
160
+ - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
161
+ with:
162
+ python-version: "3.12"
163
+
164
+ - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
165
+ with:
166
+ node-version: "20"
167
+
168
+ - name: Install Socket Firewall
169
+ run: npm install -g sfw
170
+
171
+ - name: Install fixture through Socket Firewall
172
+ working-directory: tests/e2e/fixtures/simple-pypi
173
+ run: |
174
+ python -m venv .venv
175
+ # shellcheck disable=SC1091
176
+ source .venv/bin/activate
177
+ sfw pip install -r requirements.txt
178
+
179
+ dockerfile-smoke:
180
+ needs: inspect
181
+ if: needs.inspect.outputs.dockerfile_changed == 'true'
182
+ runs-on: ubuntu-latest
183
+ timeout-minutes: 20
184
+ steps:
185
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
186
+ with:
187
+ fetch-depth: 1
188
+ persist-credentials: false
189
+
190
+ - name: Build the Dockerfile (no push)
191
+ run: docker build --pull -t socket-python-cli:dependabot-smoke .
192
+
193
+ workflow-notice:
194
+ needs: inspect
195
+ if: needs.inspect.outputs.workflow_or_action_changed == 'true'
196
+ runs-on: ubuntu-latest
197
+ timeout-minutes: 2
198
+ steps:
199
+ - name: Flag workflow-sensitive updates
200
+ run: |
201
+ {
202
+ echo "## Sensitive File Notice"
203
+ echo "This Dependabot PR changes workflow or dependabot config files."
204
+ echo "Require explicit human review before merge."
205
+ } >> "$GITHUB_STEP_SUMMARY"
@@ -11,7 +11,14 @@ permissions:
11
11
 
12
12
  jobs:
13
13
  e2e:
14
- if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
14
+ # Skip e2e on:
15
+ # - PRs from forks (no secrets)
16
+ # - Dependabot PRs (no secrets, and dependency-bump risk is already
17
+ # covered by dependabot-review.yml's Socket Firewall smoke jobs)
18
+ if: >-
19
+ (github.event_name != 'pull_request' ||
20
+ github.event.pull_request.head.repo.full_name == github.repository) &&
21
+ github.event.pull_request.user.login != 'dependabot[bot]'
15
22
  runs-on: ubuntu-latest
16
23
  strategy:
17
24
  fail-fast: false
@@ -48,8 +48,24 @@ jobs:
48
48
  python -m pip install --upgrade pip
49
49
  pip install uv
50
50
  uv sync --extra test
51
+ - name: 🔒 verify uv.lock is in sync with pyproject.toml
52
+ run: uv lock --locked
51
53
  - name: 🧪 run tests
52
54
  run: uv run pytest -q tests/unit/ tests/core/
55
+ - name: 💨 import smoke (catches API-removal breaks from upgraded deps)
56
+ run: |
57
+ uv run python -c "
58
+ from socketsecurity.socketcli import cli
59
+ from socketsecurity.core import Core
60
+ from socketsecurity.core.exceptions import APIFailure, APIResourceNotFound
61
+ from socketsecurity.core.git_interface import Git
62
+ from socketsecurity.config import CliConfig
63
+ print('import smoke OK')
64
+ "
65
+ - name: 🛡️ pip-audit (known CVEs in the locked deps)
66
+ run: |
67
+ uv export --no-hashes --no-emit-project --format requirements-txt > /tmp/req-audit.txt
68
+ uvx pip-audit --strict --progress-spinner off --disable-pip --no-deps -r /tmp/req-audit.txt
53
69
 
54
70
  unsupported-python-install:
55
71
  runs-on: ubuntu-latest
@@ -0,0 +1,58 @@
1
+ # --- Python bytecode / cache ---
2
+ *.pyc
3
+ __pycache__/
4
+ .coverage
5
+ .coverage.*
6
+ coverage.xml
7
+ htmlcov/
8
+ .pytest_cache/
9
+
10
+ # --- Virtual environments ---
11
+ venv/
12
+ .venv/
13
+ .venv-test/
14
+ Pipfile
15
+
16
+ # --- Build / packaging ---
17
+ *.build
18
+ *.dist
19
+ *.egg-info/
20
+ bin/
21
+ build/
22
+ dist/
23
+ *.zip
24
+
25
+ # --- Editor / IDE ---
26
+ .idea/
27
+ *.swp
28
+ *.swo
29
+
30
+ # --- OS ---
31
+ .DS_Store
32
+
33
+ # --- Logs ---
34
+ logs/
35
+
36
+ # --- Env files ---
37
+ *.env
38
+ .env.local
39
+
40
+ # --- Generated output ---
41
+ *.json
42
+ !tests/**/*.json
43
+ !examples/config/*.json
44
+ *.sarif
45
+ markdown_overview_temp.md
46
+ markdown_security_temp.md
47
+
48
+ # --- Project-specific scratch ---
49
+ ai_testing/
50
+ file_generator.py
51
+ run_container.sh
52
+ scripts/*.py
53
+ test/
54
+ test.py
55
+ verify_find_files_lazy_loading.py
56
+
57
+ # --- Conductor workspace ---
58
+ .context/
@@ -0,0 +1,176 @@
1
+ # Changelog
2
+
3
+ ## 2.3.0
4
+
5
+ ### New: `--exit-code-on-api-error`
6
+
7
+ Adds a configurable exit code for API / infrastructure failures (timeouts,
8
+ network errors, unexpected exceptions), so CI pipelines can distinguish them
9
+ from blocking security findings (exit `1`):
10
+
11
+ ```
12
+ socketcli --exit-code-on-api-error 100 ...
13
+ ```
14
+
15
+ Default is `3` (the code the CLI already used for these errors), so **default
16
+ behavior is unchanged** — the exit code only changes when you pass the flag.
17
+ Set it to a Buildkite `soft_fail` code, or to `0` to swallow infra errors.
18
+
19
+ **Interaction to be aware of:** `--disable-blocking` forces exit `0` for *all*
20
+ outcomes and therefore overrides `--exit-code-on-api-error`. Use the new flag
21
+ *without* `--disable-blocking` if you want a custom infra-error code to take
22
+ effect. See the exit-code reference in the README.
23
+
24
+ > A future `3.0` release is planned to make infrastructure errors exit non-zero
25
+ > even under `--disable-blocking` (so outages stop being silently swallowed).
26
+ > That is a breaking change and is intentionally **not** in this release.
27
+
28
+ ### New: commit message auto-truncation
29
+
30
+ `--commit-message` values longer than 200 characters are now automatically
31
+ truncated before being sent to the API, preventing HTTP 413 errors from
32
+ oversized URL query parameters (common with AI-generated commit messages or
33
+ `$BUILDKITE_MESSAGE`).
34
+
35
+ ### Improved: Buildkite log formatting
36
+
37
+ When running inside a Buildkite job (`BUILDKITE=true`), infrastructure errors
38
+ emit Buildkite log section markers (`^^^ +++` / `--- :warning:`) so the error
39
+ section auto-expands in the BK UI, plus a `soft_fail` hint. No effect on other
40
+ CI platforms.
41
+
42
+ ### Fixed
43
+
44
+ - `--timeout` is now honored end-to-end: it was only applied to the local
45
+ `CliClient`, but the full-scan diff comparison uses the Socket SDK instance,
46
+ which was constructed without the CLI timeout and defaulted to 1200s.
47
+ - `--exclude-license-details` now propagates to the full-scan diff comparison
48
+ request (it was only applied to full-scan params / report URLs before).
49
+ ## 2.2.93
50
+
51
+ - Bundled twelve Dependabot dependency updates: `urllib3`, `gitpython`, `python-dotenv`, `pytest`, `uv`, `cryptography`, `pygments`, `requests`, and `idna` (main app), plus `axios`, `requests`, and `flask` (e2e fixtures). `idna` 3.11 → 3.15 includes the fix for CVE-2026-45409.
52
+ - Added `.github/dependabot.yml` with grouped weekly updates, a 7-day cooldown, and e2e fixtures excluded.
53
+ - Added a `dependabot-review` workflow that runs Socket Firewall (`sfw`) install checks on Dependabot PRs with no API token required.
54
+ - Added a `uv.lock` drift check, an import smoke test, and `pip-audit` to the test workflow; skipped e2e tests on Dependabot PRs.
55
+ - Tidied `.gitignore` and backfilled missing CHANGELOG entries for `2.2.81`, `2.2.85`, `2.2.86`, `2.2.88`, `2.2.89`, `2.2.91`, and `2.2.92`.
56
+
57
+ ## 2.2.92
58
+
59
+ - Fixed dependency-overview rendering for unmapped alert types: alert types the SDK
60
+ has no metadata for now fall back to a humanized Title-Cased label (e.g.
61
+ `gptDidYouMean` -> "Possible typosquat attack (GPT)", `SQLInjection` -> "SQL
62
+ Injection") instead of surfacing the raw camelCase identifier.
63
+
64
+ ## 2.2.91
65
+
66
+ - Added legal/compliance artifact presets (`--legal`) and FOSSA-compatible output
67
+ shapes (`--legal-format fossa`) for license and SBOM reporting.
68
+
69
+ ## 2.2.90
70
+
71
+ - Migrated license enrichment PURL lookup to the org-scoped endpoint (`POST /v0/orgs/{slug}/purl`) from the deprecated global endpoint (`POST /v0/purl`).
72
+
73
+ ## 2.2.89
74
+
75
+ - Added `uv.lock` to the version-incrementation CI check so a `pyproject.toml` /
76
+ `__init__.py` version bump without a matching lockfile sync no longer slips through.
77
+ - Updated the local Python pre-commit hook to keep `uv.lock` in sync with
78
+ `pyproject.toml` and `socketsecurity/__init__.py` version changes automatically.
79
+
80
+ ## 2.2.88
81
+
82
+ - Added `bun.lock`, `bun.lockb`, and `vlt-lock.json` to the recognized manifest files
83
+ for Socket scanning, with matching unit-test coverage.
84
+
85
+ ## 2.2.86
86
+
87
+ - Bumped `socketdev` to `>=3.0.33,<4.0.0` to pick up the SDK fix for unknown alert
88
+ categories (the SDK previously crashed while deserializing diff alerts when the API
89
+ returned a category like `"other"`).
90
+ - Normalized diff artifacts with `score=None` to an empty score map in the CLI model
91
+ layer; PR-comment dependency-overview rendering no longer crashes on missing or
92
+ partial score data.
93
+ - Defaulted missing badge values to a valid `100%` fallback rather than producing
94
+ invalid badge URLs.
95
+
96
+ ## 2.2.85
97
+
98
+ - Added four hidden `--reach-continue-on-*` flags in preparation for Coana CLI v15:
99
+ `--reach-continue-on-analysis-errors`, `--reach-continue-on-install-errors`,
100
+ `--reach-continue-on-missing-lock-files`, `--reach-continue-on-no-source-files`.
101
+ Each forwards to the matching Coana flag and opts out of one of Coana v15's new
102
+ halt-by-default behaviors. No-op against today's default Coana version; will take
103
+ effect automatically once Coana v15 becomes the default.
104
+
105
+ ## 2.2.83
106
+
107
+ - Fixed branch detection in detached-HEAD CI checkouts. When `git name-rev --name-only HEAD` returned an output with a suffix operator (e.g. `remotes/origin/master~1`, `master^0`), the `~N`/`^N` was previously passed through as the branch name and rejected by the Socket API as an invalid Git ref. The suffix is now stripped before the prefix split, producing the bare branch name.
108
+
109
+ ## 2.2.81
110
+
111
+ - Fixed GitLab security report schema compliance: corrected schema validation errors so
112
+ Socket-produced reports parse cleanly under GitLab's dependency-scanning ingestion.
113
+ - Populated scan alert data in the GitLab security report so previously-empty alert
114
+ sections now carry the expected findings.
115
+
116
+ ## 2.2.80
117
+
118
+ - Hardened GitHub Actions workflows.
119
+ - Fixed broken links on PyPI page.
120
+
121
+ ## 2.2.79
122
+
123
+ - Updated minimum required Python version.
124
+ - Tweaked CI checks.
125
+
126
+ ## 2.2.78
127
+
128
+ - Fixed reachability filtering.
129
+ - Added config file support.
130
+
131
+ ## 2.2.77
132
+
133
+ - Fixed `has_manifest_files` failing to match root-level manifest files.
134
+
135
+ ## 2.2.76
136
+
137
+ - Added SARIF file output support.
138
+ - Improved reachability filtering.
139
+
140
+ ## 2.2.75
141
+
142
+ - Fixed `workspace` flag regression by updating SDK dependency.
143
+
144
+ ## 2.2.74
145
+
146
+ - Added `--workspace` flag to CLI args.
147
+ - Added GitLab branch protection flag.
148
+ - Added e2e tests for full scans and full scans with reachability.
149
+ - Bumped dependencies: `cryptography`, `virtualenv`, `filelock`, `urllib3`.
150
+
151
+ ## 2.2.71
152
+
153
+ - Added `strace` to the Docker image for debugging purposes.
154
+
155
+ ## 2.2.70
156
+
157
+ - Set the scan to `'socket_tier1'` when using the `--reach` flag. This ensures Tier 1 scans are properly integrated into the organization-wide alerts.
158
+
159
+ ## 2.2.69
160
+
161
+ - Added `--reach-enable-analysis-splitting` flag to enable analysis splitting (disabled by default).
162
+ - Added `--reach-detailed-analysis-log-file` flag to print detailed analysis log file path.
163
+ - Added `--reach-lazy-mode` flag to enable lazy mode for reachability analysis.
164
+ - Changed default behavior: analysis splitting is now disabled by default. The old `--reach-disable-analysis-splitting` flag is kept as a hidden no-op for backwards compatibility.
165
+
166
+ ## 2.2.64
167
+
168
+ - Included PyPy in the Docker image.
169
+
170
+ ## 2.2.57
171
+
172
+ - Fixed Dockerfile to set `GOROOT` to `/usr/lib/go` when using system Go (`GO_VERSION=system`) instead of always using `/usr/local/go`.
173
+
174
+ ## 2.2.56
175
+
176
+ - Removed process timeout from reachability analysis subprocess. Timeouts are now only passed to the Coana CLI via the `--analysis-timeout` flag.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketsecurity
3
- Version: 2.2.92
3
+ Version: 2.3.0
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>
@@ -252,6 +252,48 @@ Minimal pattern:
252
252
  SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }}
253
253
  ```
254
254
 
255
+ ## Exit codes
256
+
257
+ | Code | Meaning |
258
+ |------|---------|
259
+ | `0` | Clean scan — no blocking issues (or `--disable-blocking` set) |
260
+ | `1` | Blocking security finding(s) detected |
261
+ | `2` | Scan interrupted (SIGINT / Ctrl+C) |
262
+ | `3` | Infrastructure or API error (timeout, network failure, unexpected error) |
263
+
264
+ `--exit-code-on-api-error <N>` remaps the infrastructure-error code (`3`) to any
265
+ value — e.g. a Buildkite `soft_fail` code, or `0` to swallow infra errors. Exit
266
+ `3` is a Socket convention, not an industry standard.
267
+
268
+ ### How these options interact
269
+
270
+ The two flags that affect exit codes can cancel each other out, so the order of
271
+ precedence matters:
272
+
273
+ - **`--disable-blocking` wins over everything.** It forces exit `0` for *all*
274
+ outcomes — security findings *and* infrastructure errors. If you set it,
275
+ `--exit-code-on-api-error` has no effect (you'll always get `0`).
276
+ - **`--exit-code-on-api-error` only applies when `--disable-blocking` is *not*
277
+ set.** It changes the infra-error code (and the generic-error code); it never
278
+ touches the security-finding code (`1`).
279
+
280
+ So for the common "don't let Socket outages block my pipeline, but still fail on
281
+ real findings" goal, use `--exit-code-on-api-error` **without** `--disable-blocking`:
282
+
283
+ ```yaml
284
+ # Buildkite: soft-fail only on infrastructure errors, still block on findings
285
+ steps:
286
+ - label: ":lock: Socket Security Scan"
287
+ command: "socketcli --exit-code-on-api-error 100 ..." # NOT --disable-blocking
288
+ soft_fail:
289
+ - exit_status: 100
290
+ ```
291
+
292
+ Combining `--disable-blocking` with `--exit-code-on-api-error 100` would make the
293
+ scan exit `0` on *both* findings and outages — the `soft_fail: 100` rule would
294
+ never match, and real findings would stop blocking. That's usually not what you
295
+ want.
296
+
255
297
  ## Common gotchas
256
298
 
257
299
  See [`docs/troubleshooting.md`](https://github.com/SocketDev/socket-python-cli/blob/main/docs/troubleshooting.md#common-gotchas).
@@ -194,6 +194,48 @@ Minimal pattern:
194
194
  SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }}
195
195
  ```
196
196
 
197
+ ## Exit codes
198
+
199
+ | Code | Meaning |
200
+ |------|---------|
201
+ | `0` | Clean scan — no blocking issues (or `--disable-blocking` set) |
202
+ | `1` | Blocking security finding(s) detected |
203
+ | `2` | Scan interrupted (SIGINT / Ctrl+C) |
204
+ | `3` | Infrastructure or API error (timeout, network failure, unexpected error) |
205
+
206
+ `--exit-code-on-api-error <N>` remaps the infrastructure-error code (`3`) to any
207
+ value — e.g. a Buildkite `soft_fail` code, or `0` to swallow infra errors. Exit
208
+ `3` is a Socket convention, not an industry standard.
209
+
210
+ ### How these options interact
211
+
212
+ The two flags that affect exit codes can cancel each other out, so the order of
213
+ precedence matters:
214
+
215
+ - **`--disable-blocking` wins over everything.** It forces exit `0` for *all*
216
+ outcomes — security findings *and* infrastructure errors. If you set it,
217
+ `--exit-code-on-api-error` has no effect (you'll always get `0`).
218
+ - **`--exit-code-on-api-error` only applies when `--disable-blocking` is *not*
219
+ set.** It changes the infra-error code (and the generic-error code); it never
220
+ touches the security-finding code (`1`).
221
+
222
+ So for the common "don't let Socket outages block my pipeline, but still fail on
223
+ real findings" goal, use `--exit-code-on-api-error` **without** `--disable-blocking`:
224
+
225
+ ```yaml
226
+ # Buildkite: soft-fail only on infrastructure errors, still block on findings
227
+ steps:
228
+ - label: ":lock: Socket Security Scan"
229
+ command: "socketcli --exit-code-on-api-error 100 ..." # NOT --disable-blocking
230
+ soft_fail:
231
+ - exit_status: 100
232
+ ```
233
+
234
+ Combining `--disable-blocking` with `--exit-code-on-api-error 100` would make the
235
+ scan exit `0` on *both* findings and outages — the `soft_fail: 100` rule would
236
+ never match, and real findings would stop blocking. That's usually not what you
237
+ want.
238
+
197
239
  ## Common gotchas
198
240
 
199
241
  See [`docs/troubleshooting.md`](https://github.com/SocketDev/socket-python-cli/blob/main/docs/troubleshooting.md#common-gotchas).
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "socketsecurity"
9
- version = "2.2.92"
9
+ version = "2.3.0"
10
10
  requires-python = ">= 3.11"
11
11
  license = {"file" = "LICENSE"}
12
12
  dependencies = [
@@ -1,3 +1,3 @@
1
1
  __author__ = 'socket.dev'
2
- __version__ = '2.2.92'
2
+ __version__ = '2.3.0'
3
3
  USER_AGENT = f'SocketPythonCLI/{__version__}'