Skip to content

Commit d989b06

Browse files
committed
Refresh Ruff enforcement against current main
2 parents b0cad54 + 2ab48d9 commit d989b06

40 files changed

Lines changed: 3327 additions & 535 deletions

‎.github/workflows/docker-stable.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
13
name: Mark Release as Stable
24
on:
35
workflow_dispatch:

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ jobs:
126126
# Attach an SPDX SBOM generated from the built image, next to the
127127
# provenance attestation the action already adds.
128128
sbom: true
129+
# `stable` follows `latest`. To point it at an older release, run
130+
# docker-stable.yml.
129131
tags: |
130132
socketdev/cli:latest
133+
socketdev/cli:stable
131134
socketdev/cli:${{ env.VERSION }}
132135
build-args: |
133136
CLI_VERSION=${{ env.VERSION }}

‎CHANGELOG.md‎

Lines changed: 217 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 2.13.1
3+
## 2.15.11
44

55
### Fixed
66

@@ -19,8 +19,222 @@
1919
- Duplicate SBOM package diagnostics use debug logging, keeping stdout available
2020
for machine-readable reports.
2121
- Configuration warnings and errors use the CLI's configured logger.
22-
- Manifest links use the configured source-control type, including when a Socket
23-
organization slug contains a source-control provider's name.
22+
23+
## 2.15.10
24+
25+
### Added
26+
27+
- Set `SOCKET_COANA_MIRROR_URL` to download the reachability engine through a
28+
mirror of `storage.googleapis.com/socket-coana-cli`.
29+
30+
### Changed: update the Docker image's PyPy to 8.1.1
31+
32+
- The amd64 Docker image now ships PyPy `8.1.1` (Python 3.12), up from PyPy
33+
`8.0.1`.
34+
35+
### Changed: bump pinned Coana CLI to 15.15.12
36+
37+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.11` to
38+
`15.15.12`. See the
39+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
40+
for engine changes.
41+
42+
## 2.15.9
43+
44+
### Changed: bump pinned Coana CLI to 15.15.11
45+
46+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.10` to
47+
`15.15.11`. See the
48+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
49+
for engine changes.
50+
51+
## 2.15.8
52+
53+
### Changed: bump pinned Coana CLI to 15.15.10
54+
55+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.9` to
56+
`15.15.10`. See the
57+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
58+
for engine changes.
59+
60+
## 2.15.7
61+
62+
### Changed: bump pinned Coana CLI to 15.15.9
63+
64+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.8` to
65+
`15.15.9`. See the
66+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
67+
for engine changes.
68+
69+
## 2.15.6
70+
71+
### Changed: bump pinned Coana CLI to 15.15.8
72+
73+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.7` to
74+
`15.15.8`. See the
75+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
76+
for engine changes.
77+
78+
## 2.15.5
79+
80+
### Changed: bump pinned Coana CLI to 15.15.7
81+
82+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.6` to
83+
`15.15.7`. See the
84+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
85+
for engine changes.
86+
87+
## 2.15.4
88+
89+
### Changed: bump pinned Coana CLI to 15.15.6
90+
91+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.5` to
92+
`15.15.6`. See the
93+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
94+
for engine changes.
95+
96+
## 2.15.3
97+
98+
### Changed: bump pinned Coana CLI to 15.15.5
99+
100+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.4` to
101+
`15.15.5`. See the
102+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
103+
for engine changes.
104+
105+
## 2.15.2
106+
107+
### Changed: bump pinned Coana CLI to 15.15.4
108+
109+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.3` to
110+
`15.15.4`. See the
111+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
112+
for engine changes.
113+
114+
## 2.15.1
115+
116+
### Changed: bump pinned Coana CLI to 15.15.3
117+
118+
- Bumped the pinned reachability engine (the Coana CLI) from `15.15.2` to
119+
`15.15.3`. See the
120+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
121+
for engine changes.
122+
123+
## 2.15.0
124+
125+
### Upgrade notes
126+
127+
- `--reach-enable-analysis-splitting` is deprecated and no longer has an
128+
effect. With it, a reachability analysis that failed or timed out was
129+
retried in smaller batches. Jobs that pass it now run one analysis, as jobs
130+
without it already did, so their results can differ. The flag still parses,
131+
so existing CI commands keep working. Remove it when convenient.
132+
133+
### Changed
134+
135+
- Reachability always passes `--disable-analysis-splitting` to the Coana CLI,
136+
including for a Coana version picked with `--reach-version`.
137+
138+
## 2.14.0
139+
140+
### Upgrade notes
141+
142+
- Without a GitHub or GitLab SCM adapter, `--strict-blocking` now compares scans
143+
even when no manifest changed. This includes default-branch pushes and scans of
144+
non-git paths. These runs can now fail on Block findings or comparison errors
145+
and need the [API token scopes for comparison runs](docs/troubleshooting.md#api-token-permissions).
146+
- If you use the GitHub Actions example, replace the combined workflow with the
147+
[PR workflow](workflows/github-actions.yml) and require its `socket-security`
148+
check. Install the [push workflow](workflows/github-actions-push.yml) in the
149+
same change: the PR workflow doesn't run on pushes, so without it the
150+
default-branch baseline stops updating and PR comparisons run against an old
151+
scan. Install the
152+
[ignore-command workflow](workflows/github-actions-comments.yml) if you use PR
153+
ignore commands.
154+
155+
### Changed
156+
157+
- Updated the Socket Python SDK (`socketdev`) to 3.6.4. This can increase
158+
advisory counts in full-scan JSON, SARIF, and GitLab security reports, and
159+
in the existing findings shown in GitLab security and FOSSA diff reports.
160+
- Skipped GitHub events and GitLab pipeline sources now warn that no scan ran.
161+
162+
### Fixed
163+
164+
- `--strict-blocking` counts distinct advisories on unchanged dependencies and
165+
lists findings that persist after a version change in the Existing alerts
166+
table. When a finding has both Warn and Block actions, Block takes precedence.
167+
- SARIF reports use advisory IDs to distinguish findings on the same package
168+
and manifest.
169+
- Comparisons with missing or invalid package lists fail with exit `3` by
170+
default. `--exit-code-on-api-error` can remap the code, and
171+
`--disable-blocking` takes precedence.
172+
- `--strict-blocking` checks existing Block findings on code-only changes.
173+
GitHub and GitLab pull request comments show those findings under Existing
174+
alerts.
175+
- With `--scm github`, reopened pull requests and pull requests marked ready for
176+
review run the PR scan.
177+
- GitHub pull request comment runs exit `0` and leave the Socket security
178+
comment unchanged when there are no Socket ignore commands to process.
179+
- Under `--strict-blocking --disable-blocking`, the PR/MR comment and console
180+
summary no longer say that existing Block alerts fail the run.
181+
- The "This package" link in GitHub and GitLab security comments opens the
182+
affected package version on socket.dev. License findings for different
183+
namespaces appear in separate rows, and generated ignore commands identify
184+
the package by its scope or namespace.
185+
- Large PR/MR security comments fit within GitHub's size limit and show how many
186+
new or existing findings were omitted. Policy checks and reports use all findings.
187+
188+
### Documentation
189+
190+
- The [CI guide](docs/ci-cd.md#required-github-checks) describes GitHub required
191+
checks and the GitHub Actions workflow migration.
192+
- The README's upgrade notes for 2.13 and 2.14 are combined into one short
193+
[section](README.md#upgrading-from-212-or-earlier).
194+
- Clarified that `--include-module-folders` discovers dependency manifests.
195+
Added a guide to scanning packages installed outside the lockfile with a
196+
CycloneDX SBOM.
197+
198+
## 2.13.2
199+
200+
### Added
201+
202+
- Security and license alerts on a transitive dependency now name the direct
203+
dependency that introduced it, under the manifest link. Up to five are listed.
204+
205+
### Changed
206+
207+
- Manifest file links in PR comments and reports pick the source host only from
208+
`--scm`. The fallback that guessed GitHub, GitLab, or Bitbucket from the Socket
209+
diff URL never produced a link and has been removed.
210+
- Each release now also tags `socketdev/cli:stable`, so `stable` and `latest`
211+
both point at the newest release. Previously `stable` moved only when someone
212+
promoted a release by hand. Pin `socketdev/cli:<version>` for reproducible CI
213+
runs.
214+
215+
### Fixed
216+
217+
- Scoped npm packages and Maven artifacts named as the introducing dependency
218+
keep their scope or group ID (`npm/@acme/widgets@1.2.0`, not
219+
`npm/widgets@1.2.0`).
220+
221+
## 2.13.1
222+
223+
### Documentation
224+
225+
- New [API token permissions](docs/troubleshooting.md#api-token-permissions) guide:
226+
the scopes `socketcli` needs, what happens without each one, and the API calls
227+
behind them.
228+
- Add `diff-scans:create` and `diff-scans:list` to CI tokens. Without them, scan
229+
comparisons fall back to a less resilient path with only a warning.
230+
- Documented how the baseline scan for a comparison is chosen.
231+
- Listed all four accepted token environment variables in priority order.
232+
233+
### Changed: bump the Socket Python SDK to 3.6.3
234+
235+
- Bumped the pinned Socket Python SDK (`socketdev`) from `3.6.2` to `3.6.3`.
236+
The release fixes `settings.integration_events()`, which the CLI does not
237+
call, so CLI behavior is unchanged.
24238

25239
## 2.13.0
26240

‎Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ RUN if [ "$DOTNET_VERSION" = "6" ]; then \
8989
# This is a custom build of PyPy3.12 for Alpine on x86-64.
9090
ARG TARGETARCH # Passed by Docker buildx
9191
RUN if [ "$TARGETARCH" = "amd64" ]; then \
92-
PYPY_URL="https://github.com/BarrensZeppelin/alpine-pypy/releases/download/alp3.24.2-pypy3.12-8.0.1/pypy3.12-v8.0.1-linux64-alpine3.24.tar.gz" && \
93-
PYPY_SHA256="b6d5dd429c6394f1710a52e3e20d5c9198547caff9528547c457d3f2ed37db09" && \
92+
PYPY_URL="https://github.com/BarrensZeppelin/alpine-pypy/releases/download/alp3.24.4-pypy3.12-8.1.1/pypy3.12-v8.1.1-linux64-alpine3.24.tar.gz" && \
93+
PYPY_SHA256="c6c630c7a37a97977014cdd6252a6331fb2cfccddffe15a0a5590480f4741c2c" && \
9494
curl -L -o /tmp/pypy.tar.gz "$PYPY_URL" && \
9595
echo "$PYPY_SHA256 /tmp/pypy.tar.gz" | sha256sum -c - && \
9696
mkdir -p /opt/pypy && \

‎README.md‎

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ pip install socketsecurity
1818
export SOCKET_SECURITY_API_TOKEN="<token>"
1919
```
2020

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+
2125
### 3) Run a basic scan
2226

2327
```bash
@@ -201,7 +205,7 @@ JSON:
201205

202206
Prebuilt workflow examples:
203207

204-
- [GitHub Actions](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/github-actions.yml)
208+
- GitHub Actions for [pull requests](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/github-actions.yml), [pushes](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/github-actions-push.yml), and [ignore commands](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/github-actions-comments.yml)
205209
- [Buildkite](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/buildkite.yml)
206210
- [GitLab CI](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/gitlab-ci.yml)
207211
- [Bitbucket Pipelines](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/bitbucket-pipelines.yml)
@@ -264,27 +268,29 @@ scan exit `0` on *both* findings and outages — the `soft_fail: 100` rule would
264268
never match, and real findings would stop blocking. That's usually not what you
265269
want.
266270

267-
### Upgrading to 2.13.0
268-
269-
Update pipeline rules and wrapper scripts that match specific exit codes:
270-
271-
| Outcome | Before 2.13.0 | From 2.13.0 |
272-
|---------|---------------|-------------|
273-
| Invalid flags or configuration | CLI validation: `1`; argparse: `2` | `2` for both; never suppressed by `--disable-blocking` |
274-
| Ctrl+C | `2` | `130`, or `0` with `--disable-blocking` |
275-
| Missing token or other setup failure | Fixed `2` or `3`, depending on the failure | Infrastructure-error code (`3` by default); both exit-code flags now apply |
276-
277-
Blocking findings still exit `1`. With `--strict-blocking`, existing blocking
278-
alerts can now fail jobs that previously passed. GitLab report findings also get
279-
new IDs once; see the [release notes](CHANGELOG.md#2130).
280-
281-
Configuration is validated before credentials or network setup. Use native
282-
JSON/TOML booleans such as `false`, a positive integer `timeout`, and an array of
283-
file paths for `files`. Invalid or unreadable configuration exits `2` even when
284-
credentials are missing or blocking is disabled.
285-
286-
For a compact comparison of failure-handling policies, see
287-
[Exit codes in CI](docs/ci-cd.md#exit-codes-in-ci).
271+
### Upgrading from 2.12 or earlier
272+
273+
2.13 and 2.14 change exit codes and what `--strict-blocking` checks:
274+
275+
- **Exit codes:** invalid flags or configuration exit `2`, Ctrl+C exits `130`,
276+
and setup failures such as a missing token use the infrastructure-error code
277+
(`3` by default). Blocking findings still exit `1`. See
278+
[Exit codes in CI](docs/ci-cd.md#exit-codes-in-ci).
279+
- **Config files** are validated before credentials or network setup. Use native
280+
JSON/TOML booleans, a positive integer `timeout` and an array for `files`.
281+
- **`--strict-blocking`** fails on existing Block alerts, counts each advisory
282+
separately, and compares code-only changes too, so pipelines can fail on
283+
alerts they used to pass. Without `--scm github` or `--scm gitlab`, that
284+
includes default-branch pushes, which need the `full-scans:list` and
285+
`repo:list` token scopes; see
286+
[API token permissions](docs/troubleshooting.md#api-token-permissions).
287+
- **GitHub Actions example:** if you copied it, put the
288+
[PR workflow](workflows/github-actions.yml) at the existing path and add the
289+
[push workflow](workflows/github-actions-push.yml) in the same change. See
290+
[Required GitHub checks](docs/ci-cd.md#required-github-checks).
291+
292+
GitLab report findings get new IDs once. The [release notes](CHANGELOG.md) have
293+
the details.
288294

289295
## Common gotchas
290296

0 commit comments

Comments
 (0)