socketsecurity 2.2.76__tar.gz → 2.2.78__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 (119) hide show
  1. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/workflows/e2e-test.yml +9 -13
  2. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/workflows/pr-preview.yml +12 -1
  3. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/workflows/python-tests.yml +3 -1
  4. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/workflows/version-check.yml +5 -3
  5. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.gitignore +1 -0
  6. socketsecurity-2.2.78/PKG-INFO +251 -0
  7. socketsecurity-2.2.78/README.md +193 -0
  8. socketsecurity-2.2.78/docs/ci-cd.md +119 -0
  9. socketsecurity-2.2.76/README.md → socketsecurity-2.2.78/docs/cli-reference.md +155 -320
  10. socketsecurity-2.2.78/docs/development.md +95 -0
  11. socketsecurity-2.2.78/docs/troubleshooting.md +81 -0
  12. socketsecurity-2.2.78/examples/config/sarif-dashboard-parity.json +11 -0
  13. socketsecurity-2.2.78/examples/config/sarif-dashboard-parity.toml +18 -0
  14. socketsecurity-2.2.78/examples/config/sarif-diff-ci-cd.json +11 -0
  15. socketsecurity-2.2.78/examples/config/sarif-diff-ci-cd.toml +16 -0
  16. socketsecurity-2.2.78/examples/config/sarif-instance-detail.json +11 -0
  17. socketsecurity-2.2.78/examples/config/sarif-instance-detail.toml +16 -0
  18. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/pyproject.toml +1 -1
  19. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/__init__.py +1 -1
  20. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/config.py +111 -14
  21. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/__init__.py +10 -13
  22. socketsecurity-2.2.78/socketsecurity/core/alert_selection.py +239 -0
  23. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/classes.py +44 -9
  24. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/messages.py +204 -0
  25. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/output.py +59 -21
  26. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/slack.py +29 -24
  27. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/core/conftest.py +11 -4
  28. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/core/test_diff_generation.py +8 -24
  29. socketsecurity-2.2.78/tests/core/test_has_manifest_files.py +68 -0
  30. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/core/test_package_and_alerts.py +44 -14
  31. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/core/test_sdk_methods.py +25 -19
  32. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/core/test_supporting_methods.py +30 -20
  33. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/repos/repo_info_no_head.json +2 -1
  34. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/repos/repo_info_success.json +2 -1
  35. socketsecurity-2.2.78/tests/unit/test_alert_selection.py +101 -0
  36. socketsecurity-2.2.78/tests/unit/test_config.py +164 -0
  37. socketsecurity-2.2.78/tests/unit/test_output.py +816 -0
  38. socketsecurity-2.2.78/tests/unit/test_slack_plugin.py +122 -0
  39. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/uv.lock +1 -1
  40. socketsecurity-2.2.78/workflows/buildkite.yml +13 -0
  41. socketsecurity-2.2.76/PKG-INFO +0 -957
  42. socketsecurity-2.2.76/docs/README.md +0 -10
  43. socketsecurity-2.2.76/tests/unit/test_config.py +0 -93
  44. socketsecurity-2.2.76/tests/unit/test_output.py +0 -338
  45. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/CODEOWNERS +0 -0
  46. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  47. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  48. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  49. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  50. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/workflows/docker-stable.yml +0 -0
  51. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.github/workflows/release.yml +0 -0
  52. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.hooks/sync_version.py +0 -0
  53. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.pre-commit-config.yaml +0 -0
  54. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/.python-version +0 -0
  55. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/CHANGELOG.md +0 -0
  56. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/Dockerfile +0 -0
  57. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/LICENSE +0 -0
  58. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/Makefile +0 -0
  59. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/instructions/gitlab-commit-status/uat.md +0 -0
  60. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/pytest.ini +0 -0
  61. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/scripts/build_container.sh +0 -0
  62. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/scripts/build_container_flexible.sh +0 -0
  63. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/scripts/deploy-test-docker.sh +0 -0
  64. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/scripts/deploy-test-pypi.sh +0 -0
  65. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/scripts/docker-entrypoint.sh +0 -0
  66. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/scripts/run.sh +0 -0
  67. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/session.md +0 -0
  68. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socket.yml +0 -0
  69. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/cli_client.py +0 -0
  70. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/exceptions.py +0 -0
  71. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/git_interface.py +0 -0
  72. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/helper/__init__.py +0 -0
  73. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
  74. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/lazy_file_loader.py +0 -0
  75. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/logging.py +0 -0
  76. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/resource_utils.py +0 -0
  77. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/scm/__init__.py +0 -0
  78. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/scm/base.py +0 -0
  79. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/scm/client.py +0 -0
  80. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/scm/github.py +0 -0
  81. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/scm/gitlab.py +0 -0
  82. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/scm_comments.py +0 -0
  83. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/socket_config.py +0 -0
  84. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/tools/reachability.py +0 -0
  85. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/core/utils.py +0 -0
  86. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/__init__.py +0 -0
  87. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/base.py +0 -0
  88. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/formatters/__init__.py +0 -0
  89. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/formatters/slack.py +0 -0
  90. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/jira.py +0 -0
  91. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/manager.py +0 -0
  92. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/teams.py +0 -0
  93. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/plugins/webhook.py +0 -0
  94. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/socketsecurity/socketcli.py +0 -0
  95. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/__init__.py +0 -0
  96. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/core/create_diff_input.json +0 -0
  97. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/core/test_diff_alerts.py +0 -0
  98. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/fullscans/create_response.json +0 -0
  99. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/fullscans/diff/stream_diff.json +0 -0
  100. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
  101. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/fullscans/head_scan/metadata.json +0 -0
  102. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
  103. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
  104. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/fullscans/new_scan/metadata.json +0 -0
  105. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
  106. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/repos/repo_info_error.json +0 -0
  107. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/data/settings/security-policy.json +0 -0
  108. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/e2e/fixtures/simple-npm/index.js +0 -0
  109. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/e2e/fixtures/simple-npm/package.json +0 -0
  110. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/unit/__init__.py +0 -0
  111. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/unit/test_cli_config.py +0 -0
  112. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/unit/test_client.py +0 -0
  113. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/unit/test_gitlab_auth.py +0 -0
  114. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/unit/test_gitlab_auth_fallback.py +0 -0
  115. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/unit/test_gitlab_commit_status.py +0 -0
  116. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/tests/unit/test_gitlab_format.py +0 -0
  117. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/workflows/bitbucket-pipelines.yml +0 -0
  118. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/workflows/github-actions.yml +0 -0
  119. {socketsecurity-2.2.76 → socketsecurity-2.2.78}/workflows/gitlab-ci.yml +0 -0
@@ -63,15 +63,6 @@ jobs:
63
63
  python -m pip install --upgrade pip
64
64
  pip install .
65
65
 
66
- - name: Verify --sarif-reachable-only without --reach exits non-zero
67
- run: |
68
- if socketcli --sarif-reachable-only --api-token dummy 2>&1; then
69
- echo "FAIL: Expected non-zero exit"
70
- exit 1
71
- else
72
- echo "PASS: Exited non-zero as expected"
73
- fi
74
-
75
66
  - name: Run Socket CLI scan with --sarif-file
76
67
  env:
77
68
  SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_CLI_API_TOKEN }}
@@ -164,10 +155,12 @@ jobs:
164
155
  --target-path tests/e2e/fixtures/simple-npm \
165
156
  --reach \
166
157
  --sarif-file /tmp/sarif-all.sarif \
158
+ --sarif-scope full \
159
+ --sarif-reachability all \
167
160
  --disable-blocking \
168
- 2>/dev/null || true
161
+ 2>/dev/null
169
162
 
170
- - name: Run scan with --sarif-file --sarif-reachable-only (filtered results)
163
+ - name: Run scan with --sarif-file --sarif-reachability reachable (filtered results)
171
164
  env:
172
165
  SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_CLI_API_TOKEN }}
173
166
  run: |
@@ -175,12 +168,15 @@ jobs:
175
168
  --target-path tests/e2e/fixtures/simple-npm \
176
169
  --reach \
177
170
  --sarif-file /tmp/sarif-reachable.sarif \
178
- --sarif-reachable-only \
171
+ --sarif-scope full \
172
+ --sarif-reachability reachable \
179
173
  --disable-blocking \
180
- 2>/dev/null || true
174
+ 2>/dev/null
181
175
 
182
176
  - name: Verify reachable-only results are a subset of all results
183
177
  run: |
178
+ test -f /tmp/sarif-all.sarif
179
+ test -f /tmp/sarif-reachable.sarif
184
180
  python3 -c "
185
181
  import json
186
182
  with open('/tmp/sarif-all.sarif') as f:
@@ -37,6 +37,17 @@ jobs:
37
37
  VERSION=$(hatch version | cut -d+ -f1)
38
38
  echo "VERSION=$VERSION" >> $GITHUB_ENV
39
39
 
40
+ - name: Check if version already exists on Test PyPI
41
+ id: version_check
42
+ env:
43
+ VERSION: ${{ env.VERSION }}
44
+ run: |
45
+ if curl -s -f https://test.pypi.org/pypi/socketsecurity/${VERSION}/json > /dev/null; then
46
+ echo "exists=true" >> $GITHUB_OUTPUT
47
+ else
48
+ echo "exists=false" >> $GITHUB_OUTPUT
49
+ fi
50
+
40
51
  - name: Build package
41
52
  if: steps.version_check.outputs.exists != 'true'
42
53
  run: |
@@ -146,4 +157,4 @@ jobs:
146
157
  build-args: |
147
158
  CLI_VERSION=${{ env.VERSION }}
148
159
  PIP_INDEX_URL=https://test.pypi.org/simple
149
- PIP_EXTRA_INDEX_URL=https://pypi.org/simple
160
+ PIP_EXTRA_INDEX_URL=https://pypi.org/simple
@@ -9,6 +9,7 @@ on:
9
9
  paths:
10
10
  - "socketsecurity/**/*.py"
11
11
  - "tests/unit/**/*.py"
12
+ - "tests/core/**/*.py"
12
13
  - "pyproject.toml"
13
14
  - "uv.lock"
14
15
  - ".github/workflows/python-tests.yml"
@@ -16,6 +17,7 @@ on:
16
17
  paths:
17
18
  - "socketsecurity/**/*.py"
18
19
  - "tests/unit/**/*.py"
20
+ - "tests/core/**/*.py"
19
21
  - "pyproject.toml"
20
22
  - "uv.lock"
21
23
  - ".github/workflows/python-tests.yml"
@@ -47,4 +49,4 @@ jobs:
47
49
  pip install uv
48
50
  uv sync --extra test
49
51
  - name: 🧪 run tests
50
- run: uv run pytest -q tests/unit/
52
+ run: uv run pytest -q tests/unit/ tests/core/
@@ -18,13 +18,15 @@ jobs:
18
18
  - name: Check version increment
19
19
  id: version_check
20
20
  run: |
21
+ python -m pip install --upgrade pip
22
+ pip install packaging
23
+
21
24
  # Get version from current PR
22
25
  PR_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
23
26
  echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV
24
27
 
25
28
  # Get version from main branch
26
- git checkout origin/main
27
- MAIN_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
29
+ MAIN_VERSION=$(git show origin/main:socketsecurity/__init__.py | grep -o "__version__.*" | awk '{print $3}' | tr -d "'")
28
30
  echo "MAIN_VERSION=$MAIN_VERSION" >> $GITHUB_ENV
29
31
 
30
32
  # Compare versions using Python
@@ -87,4 +89,4 @@ jobs:
87
89
  issue_number: prNumber,
88
90
  body: `❌ **Version Check Failed**\n\nPlease increment...`
89
91
  });
90
- }
92
+ }
@@ -15,6 +15,7 @@ scripts/*.py
15
15
  *.json
16
16
  *.sarif
17
17
  !tests/**/*.json
18
+ !examples/config/*.json
18
19
  markdown_overview_temp.md
19
20
  markdown_security_temp.md
20
21
  .DS_Store
@@ -0,0 +1,251 @@
1
+ Metadata-Version: 2.4
2
+ Name: socketsecurity
3
+ Version: 2.2.78
4
+ Summary: Socket Security CLI for CI/CD
5
+ Project-URL: Homepage, https://socket.dev
6
+ Author-email: Douglas Coburn <douglas@socket.dev>
7
+ Maintainer-email: Douglas Coburn <douglas@socket.dev>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2022 Socket Inc
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: oss,sca,security,socket.dev,socketsecurity
31
+ Classifier: Development Status :: 4 - Beta
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: Programming Language :: Python :: 3.11
34
+ Classifier: Programming Language :: Python :: 3.12
35
+ Requires-Python: >=3.10
36
+ Requires-Dist: bs4>=0.0.2
37
+ Requires-Dist: gitpython
38
+ Requires-Dist: markdown>=3.10
39
+ Requires-Dist: mdutils
40
+ Requires-Dist: packaging
41
+ Requires-Dist: prettytable
42
+ Requires-Dist: python-dotenv
43
+ Requires-Dist: requests
44
+ Requires-Dist: socketdev<4.0.0,>=3.0.32
45
+ Provides-Extra: dev
46
+ Requires-Dist: hatch; extra == 'dev'
47
+ Requires-Dist: pre-commit; extra == 'dev'
48
+ Requires-Dist: ruff>=0.3.0; extra == 'dev'
49
+ Requires-Dist: twine; extra == 'dev'
50
+ Requires-Dist: uv>=0.1.0; extra == 'dev'
51
+ Provides-Extra: test
52
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'test'
53
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'test'
54
+ Requires-Dist: pytest-mock>=3.12.0; extra == 'test'
55
+ Requires-Dist: pytest-watch>=4.2.0; extra == 'test'
56
+ Requires-Dist: pytest>=7.4.0; extra == 'test'
57
+ Description-Content-Type: text/markdown
58
+
59
+ # Socket Security CLI
60
+
61
+ Socket Python CLI for Socket scans, diff reporting, reachability analysis, and SARIF/GitLab exports.
62
+
63
+ Comprehensive docs are available in [`docs/`](docs/) for full flag reference, CI/CD-specific guidance, and contributor setup.
64
+
65
+ ## Quick start
66
+
67
+ ### 1) Install
68
+
69
+ ```bash
70
+ pip install socketsecurity
71
+ ```
72
+
73
+ ### 2) Authenticate
74
+
75
+ ```bash
76
+ export SOCKET_SECURITY_API_TOKEN="<token>"
77
+ ```
78
+
79
+ ### 3) Run a basic scan
80
+
81
+ ```bash
82
+ socketcli --target-path .
83
+ ```
84
+
85
+ ## Common use cases
86
+
87
+ This section covers the paved path/common workflows.
88
+ For advanced options and exhaustive details, see [`docs/cli-reference.md`](docs/cli-reference.md).
89
+ For CI/CD-specific guidance, see [`docs/ci-cd.md`](docs/ci-cd.md).
90
+
91
+ ### Basic policy scan (no SARIF)
92
+
93
+ ```bash
94
+ socketcli --target-path .
95
+ ```
96
+
97
+ ### GitLab dependency-scanning report
98
+
99
+ ```bash
100
+ socketcli --enable-gitlab-security --gitlab-security-file gl-dependency-scanning-report.json
101
+ ```
102
+
103
+ ## SARIF use cases
104
+
105
+ ### Full-scope reachable SARIF (grouped alerts)
106
+
107
+ ```bash
108
+ socketcli \
109
+ --reach \
110
+ --sarif-file results.sarif \
111
+ --sarif-scope full \
112
+ --sarif-grouping alert \
113
+ --sarif-reachability reachable \
114
+ --disable-blocking
115
+ ```
116
+
117
+ ### Diff-scope reachable SARIF (PR/CI gating)
118
+
119
+ ```bash
120
+ socketcli \
121
+ --reach \
122
+ --sarif-file results.sarif \
123
+ --sarif-scope diff \
124
+ --sarif-reachability reachable \
125
+ --strict-blocking
126
+ ```
127
+
128
+ ### Full-scope SARIF (instance-level detail)
129
+
130
+ ```bash
131
+ socketcli \
132
+ --reach \
133
+ --sarif-file results.sarif \
134
+ --sarif-scope full \
135
+ --sarif-grouping instance \
136
+ --sarif-reachability all \
137
+ --disable-blocking
138
+ ```
139
+
140
+ ## Choose your mode
141
+
142
+ | Use case | Recommended mode | Key flags |
143
+ |:--|:--|:--|
144
+ | Basic policy enforcement in CI | Diff-based policy check | `--strict-blocking` |
145
+ | Reachable-focused SARIF for reporting | Full-scope grouped SARIF | `--reach --sarif-scope full --sarif-grouping alert --sarif-reachability reachable --sarif-file <path>` |
146
+ | Detailed reachability export for investigations | Full-scope instance SARIF | `--reach --sarif-scope full --sarif-grouping instance --sarif-reachability all --sarif-file <path>` |
147
+ | Net-new PR findings only | Diff-scope SARIF | `--reach --sarif-scope diff --sarif-reachability reachable --sarif-file <path>` |
148
+
149
+ Dashboard parity note:
150
+ - Full-scope SARIF is the closest match for dashboard-style filtering.
151
+ - Exact result counts can still differ from the dashboard due to backend/API consolidation differences and grouping semantics.
152
+ - See [`docs/troubleshooting.md#dashboard-vs-cli-result-counts`](docs/troubleshooting.md#dashboard-vs-cli-result-counts).
153
+
154
+ ## Config files (`--config`)
155
+
156
+ Use `--config <path>` with `.toml` or `.json` to avoid long command lines.
157
+
158
+ Precedence order:
159
+
160
+ `CLI flags` > `environment variables` > `config file` > `built-in defaults`
161
+
162
+ Example:
163
+
164
+ ```toml
165
+ [socketcli]
166
+ repo = "example-repo"
167
+ reach = true
168
+ sarif_scope = "full"
169
+ sarif_grouping = "alert"
170
+ sarif_reachability = "reachable"
171
+ sarif_file = "reachable.sarif"
172
+ ```
173
+
174
+ Equivalent JSON:
175
+
176
+ ```json
177
+ {
178
+ "socketcli": {
179
+ "repo": "example-repo",
180
+ "reach": true,
181
+ "sarif_scope": "full",
182
+ "sarif_grouping": "alert",
183
+ "sarif_reachability": "reachable",
184
+ "sarif_file": "reachable.sarif"
185
+ }
186
+ }
187
+ ```
188
+
189
+ Run:
190
+
191
+ ```bash
192
+ socketcli --config .socketcli.toml --target-path .
193
+ ```
194
+
195
+ Reference sample configs:
196
+
197
+ TOML:
198
+ - [`examples/config/sarif-dashboard-parity.toml`](examples/config/sarif-dashboard-parity.toml)
199
+ - [`examples/config/sarif-instance-detail.toml`](examples/config/sarif-instance-detail.toml)
200
+ - [`examples/config/sarif-diff-ci-cd.toml`](examples/config/sarif-diff-ci-cd.toml)
201
+
202
+ JSON:
203
+ - [`examples/config/sarif-dashboard-parity.json`](examples/config/sarif-dashboard-parity.json)
204
+ - [`examples/config/sarif-instance-detail.json`](examples/config/sarif-instance-detail.json)
205
+ - [`examples/config/sarif-diff-ci-cd.json`](examples/config/sarif-diff-ci-cd.json)
206
+
207
+ ## CI/CD examples
208
+
209
+ Prebuilt workflow examples:
210
+
211
+ - [GitHub Actions](workflows/github-actions.yml)
212
+ - [Buildkite](workflows/buildkite.yml)
213
+ - [GitLab CI](workflows/gitlab-ci.yml)
214
+ - [Bitbucket Pipelines](workflows/bitbucket-pipelines.yml)
215
+
216
+ Minimal pattern:
217
+
218
+ ```yaml
219
+ - name: Run Socket CLI
220
+ run: socketcli --config .socketcli.toml --target-path .
221
+ env:
222
+ SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }}
223
+ ```
224
+
225
+ ## Common gotchas
226
+
227
+ See [`docs/troubleshooting.md`](docs/troubleshooting.md#common-gotchas).
228
+
229
+ ## Quick verification checks
230
+
231
+ After generating SARIF files, validate shape/count quickly:
232
+
233
+ ```bash
234
+ jq '.runs[0].results | length' results.sarif
235
+ jq -r '.runs[0].results[]?.properties.reachability' results.sarif | sort -u
236
+ ```
237
+
238
+ For side-by-side comparisons:
239
+
240
+ ```bash
241
+ jq '.runs[0].results | length' sarif-dashboard-parity-reachable.sarif
242
+ jq '.runs[0].results | length' sarif-full-instance-all.sarif
243
+ jq '.runs[0].results | length' sarif-diff-reachable.sarif
244
+ ```
245
+
246
+ ## Documentation reference
247
+
248
+ - Full CLI reference: [`docs/cli-reference.md`](docs/cli-reference.md)
249
+ - CI/CD guide: [`docs/ci-cd.md`](docs/ci-cd.md)
250
+ - Troubleshooting guide: [`docs/troubleshooting.md`](docs/troubleshooting.md)
251
+ - Development guide: [`docs/development.md`](docs/development.md)
@@ -0,0 +1,193 @@
1
+ # Socket Security CLI
2
+
3
+ Socket Python CLI for Socket scans, diff reporting, reachability analysis, and SARIF/GitLab exports.
4
+
5
+ Comprehensive docs are available in [`docs/`](docs/) for full flag reference, CI/CD-specific guidance, and contributor setup.
6
+
7
+ ## Quick start
8
+
9
+ ### 1) Install
10
+
11
+ ```bash
12
+ pip install socketsecurity
13
+ ```
14
+
15
+ ### 2) Authenticate
16
+
17
+ ```bash
18
+ export SOCKET_SECURITY_API_TOKEN="<token>"
19
+ ```
20
+
21
+ ### 3) Run a basic scan
22
+
23
+ ```bash
24
+ socketcli --target-path .
25
+ ```
26
+
27
+ ## Common use cases
28
+
29
+ This section covers the paved path/common workflows.
30
+ For advanced options and exhaustive details, see [`docs/cli-reference.md`](docs/cli-reference.md).
31
+ For CI/CD-specific guidance, see [`docs/ci-cd.md`](docs/ci-cd.md).
32
+
33
+ ### Basic policy scan (no SARIF)
34
+
35
+ ```bash
36
+ socketcli --target-path .
37
+ ```
38
+
39
+ ### GitLab dependency-scanning report
40
+
41
+ ```bash
42
+ socketcli --enable-gitlab-security --gitlab-security-file gl-dependency-scanning-report.json
43
+ ```
44
+
45
+ ## SARIF use cases
46
+
47
+ ### Full-scope reachable SARIF (grouped alerts)
48
+
49
+ ```bash
50
+ socketcli \
51
+ --reach \
52
+ --sarif-file results.sarif \
53
+ --sarif-scope full \
54
+ --sarif-grouping alert \
55
+ --sarif-reachability reachable \
56
+ --disable-blocking
57
+ ```
58
+
59
+ ### Diff-scope reachable SARIF (PR/CI gating)
60
+
61
+ ```bash
62
+ socketcli \
63
+ --reach \
64
+ --sarif-file results.sarif \
65
+ --sarif-scope diff \
66
+ --sarif-reachability reachable \
67
+ --strict-blocking
68
+ ```
69
+
70
+ ### Full-scope SARIF (instance-level detail)
71
+
72
+ ```bash
73
+ socketcli \
74
+ --reach \
75
+ --sarif-file results.sarif \
76
+ --sarif-scope full \
77
+ --sarif-grouping instance \
78
+ --sarif-reachability all \
79
+ --disable-blocking
80
+ ```
81
+
82
+ ## Choose your mode
83
+
84
+ | Use case | Recommended mode | Key flags |
85
+ |:--|:--|:--|
86
+ | Basic policy enforcement in CI | Diff-based policy check | `--strict-blocking` |
87
+ | Reachable-focused SARIF for reporting | Full-scope grouped SARIF | `--reach --sarif-scope full --sarif-grouping alert --sarif-reachability reachable --sarif-file <path>` |
88
+ | Detailed reachability export for investigations | Full-scope instance SARIF | `--reach --sarif-scope full --sarif-grouping instance --sarif-reachability all --sarif-file <path>` |
89
+ | Net-new PR findings only | Diff-scope SARIF | `--reach --sarif-scope diff --sarif-reachability reachable --sarif-file <path>` |
90
+
91
+ Dashboard parity note:
92
+ - Full-scope SARIF is the closest match for dashboard-style filtering.
93
+ - Exact result counts can still differ from the dashboard due to backend/API consolidation differences and grouping semantics.
94
+ - See [`docs/troubleshooting.md#dashboard-vs-cli-result-counts`](docs/troubleshooting.md#dashboard-vs-cli-result-counts).
95
+
96
+ ## Config files (`--config`)
97
+
98
+ Use `--config <path>` with `.toml` or `.json` to avoid long command lines.
99
+
100
+ Precedence order:
101
+
102
+ `CLI flags` > `environment variables` > `config file` > `built-in defaults`
103
+
104
+ Example:
105
+
106
+ ```toml
107
+ [socketcli]
108
+ repo = "example-repo"
109
+ reach = true
110
+ sarif_scope = "full"
111
+ sarif_grouping = "alert"
112
+ sarif_reachability = "reachable"
113
+ sarif_file = "reachable.sarif"
114
+ ```
115
+
116
+ Equivalent JSON:
117
+
118
+ ```json
119
+ {
120
+ "socketcli": {
121
+ "repo": "example-repo",
122
+ "reach": true,
123
+ "sarif_scope": "full",
124
+ "sarif_grouping": "alert",
125
+ "sarif_reachability": "reachable",
126
+ "sarif_file": "reachable.sarif"
127
+ }
128
+ }
129
+ ```
130
+
131
+ Run:
132
+
133
+ ```bash
134
+ socketcli --config .socketcli.toml --target-path .
135
+ ```
136
+
137
+ Reference sample configs:
138
+
139
+ TOML:
140
+ - [`examples/config/sarif-dashboard-parity.toml`](examples/config/sarif-dashboard-parity.toml)
141
+ - [`examples/config/sarif-instance-detail.toml`](examples/config/sarif-instance-detail.toml)
142
+ - [`examples/config/sarif-diff-ci-cd.toml`](examples/config/sarif-diff-ci-cd.toml)
143
+
144
+ JSON:
145
+ - [`examples/config/sarif-dashboard-parity.json`](examples/config/sarif-dashboard-parity.json)
146
+ - [`examples/config/sarif-instance-detail.json`](examples/config/sarif-instance-detail.json)
147
+ - [`examples/config/sarif-diff-ci-cd.json`](examples/config/sarif-diff-ci-cd.json)
148
+
149
+ ## CI/CD examples
150
+
151
+ Prebuilt workflow examples:
152
+
153
+ - [GitHub Actions](workflows/github-actions.yml)
154
+ - [Buildkite](workflows/buildkite.yml)
155
+ - [GitLab CI](workflows/gitlab-ci.yml)
156
+ - [Bitbucket Pipelines](workflows/bitbucket-pipelines.yml)
157
+
158
+ Minimal pattern:
159
+
160
+ ```yaml
161
+ - name: Run Socket CLI
162
+ run: socketcli --config .socketcli.toml --target-path .
163
+ env:
164
+ SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }}
165
+ ```
166
+
167
+ ## Common gotchas
168
+
169
+ See [`docs/troubleshooting.md`](docs/troubleshooting.md#common-gotchas).
170
+
171
+ ## Quick verification checks
172
+
173
+ After generating SARIF files, validate shape/count quickly:
174
+
175
+ ```bash
176
+ jq '.runs[0].results | length' results.sarif
177
+ jq -r '.runs[0].results[]?.properties.reachability' results.sarif | sort -u
178
+ ```
179
+
180
+ For side-by-side comparisons:
181
+
182
+ ```bash
183
+ jq '.runs[0].results | length' sarif-dashboard-parity-reachable.sarif
184
+ jq '.runs[0].results | length' sarif-full-instance-all.sarif
185
+ jq '.runs[0].results | length' sarif-diff-reachable.sarif
186
+ ```
187
+
188
+ ## Documentation reference
189
+
190
+ - Full CLI reference: [`docs/cli-reference.md`](docs/cli-reference.md)
191
+ - CI/CD guide: [`docs/ci-cd.md`](docs/ci-cd.md)
192
+ - Troubleshooting guide: [`docs/troubleshooting.md`](docs/troubleshooting.md)
193
+ - Development guide: [`docs/development.md`](docs/development.md)
@@ -0,0 +1,119 @@
1
+ # CI/CD guide
2
+
3
+ Use this guide for pipeline-focused CLI usage across platforms.
4
+
5
+ ## Recommended patterns
6
+
7
+ ### Dashboard-style reachable SARIF
8
+
9
+ ```bash
10
+ socketcli \
11
+ --reach \
12
+ --sarif-file results.sarif \
13
+ --sarif-scope full \
14
+ --sarif-grouping alert \
15
+ --sarif-reachability reachable \
16
+ --disable-blocking
17
+ ```
18
+
19
+ ### Diff-based gating on new reachable findings
20
+
21
+ ```bash
22
+ socketcli \
23
+ --reach \
24
+ --sarif-file results.sarif \
25
+ --sarif-scope diff \
26
+ --sarif-reachability reachable \
27
+ --strict-blocking
28
+ ```
29
+
30
+ ## Config file usage in CI
31
+
32
+ Use `--config .socketcli.toml` or `--config .socketcli.json` to keep pipeline commands small.
33
+
34
+ Precedence order:
35
+
36
+ `CLI flags` > `environment variables` > `config file` > `built-in defaults`
37
+
38
+ Example:
39
+
40
+ ```toml
41
+ [socketcli]
42
+ reach = true
43
+ sarif_scope = "full"
44
+ sarif_grouping = "alert"
45
+ sarif_reachability = "reachable"
46
+ sarif_file = "results.sarif"
47
+ ```
48
+
49
+ Equivalent JSON:
50
+
51
+ ```json
52
+ {
53
+ "socketcli": {
54
+ "reach": true,
55
+ "sarif_scope": "full",
56
+ "sarif_grouping": "alert",
57
+ "sarif_reachability": "reachable",
58
+ "sarif_file": "results.sarif"
59
+ }
60
+ }
61
+ ```
62
+
63
+ ## Platform examples
64
+
65
+ ### GitHub Actions
66
+
67
+ ```yaml
68
+ - name: Run Socket CLI
69
+ run: socketcli --config .socketcli.toml --target-path .
70
+ env:
71
+ SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }}
72
+ ```
73
+
74
+ ### Buildkite
75
+
76
+ ```yaml
77
+ steps:
78
+ - label: "Socket scan"
79
+ command: "socketcli --config .socketcli.toml --target-path ."
80
+ env:
81
+ SOCKET_SECURITY_API_TOKEN: "${SOCKET_SECURITY_API_TOKEN}"
82
+ ```
83
+
84
+ ### GitLab CI
85
+
86
+ ```yaml
87
+ socket_scan:
88
+ script:
89
+ - socketcli --config .socketcli.toml --target-path .
90
+ variables:
91
+ SOCKET_SECURITY_API_TOKEN: $SOCKET_SECURITY_API_TOKEN
92
+ ```
93
+
94
+ ### Bitbucket Pipelines
95
+
96
+ ```yaml
97
+ pipelines:
98
+ default:
99
+ - step:
100
+ script:
101
+ - socketcli --config .socketcli.toml --target-path .
102
+ ```
103
+
104
+ ## Workflow templates
105
+
106
+ Prebuilt examples in this repo:
107
+
108
+ - [`../workflows/github-actions.yml`](../workflows/github-actions.yml)
109
+ - [`../workflows/buildkite.yml`](../workflows/buildkite.yml)
110
+ - [`../workflows/gitlab-ci.yml`](../workflows/gitlab-ci.yml)
111
+ - [`../workflows/bitbucket-pipelines.yml`](../workflows/bitbucket-pipelines.yml)
112
+
113
+ ## CI gotchas
114
+
115
+ - `--strict-blocking` enables strict diff behavior (`new + unchanged`) for blocking evaluation and diff-based output selection.
116
+ - `--sarif-scope full` requires `--reach`.
117
+ - `--sarif-grouping alert` currently applies to `--sarif-scope full`.
118
+ - Diff-based SARIF can validly be empty when there are no matching net-new alerts.
119
+ - Keep API tokens in secret stores (`SOCKET_SECURITY_API_TOKEN`), not in config files.