Skip to content

Commit f79f30f

Browse files
qazbnm456claude
andcommitted
ci: least-privilege token + SHA-pin the third-party setup-uv action
Borrowed from awesome-web-security's CI hardening posture: - Add `permissions: contents: read` at the workflow level. The job only checks out code and runs tests — it never pushes, tags, comments on PRs, or opens issues. Specifying `permissions:` also drops every unlisted scope to `none`, so a compromised dependency/action in the test run can't use the GITHUB_TOKEN to write to the repo. - Pin the third-party `astral-sh/setup-uv` to its commit SHA (v5.4.2) instead of the moving `@v5` tag, so a repointed tag can't inject code that runs with this workflow's token. GitHub-owned `actions/checkout` stays on `@v4` (matching awesome-web-security: SHA-pin third-party, tag GitHub-first-party). Cache still works (the Actions cache service uses a separate scoped token, not `contents`); the rlm-kit git dep is public so read-only checkout suffices. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d060fd0 commit f79f30f

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
branches: [main]
88
pull_request:
99

10+
# Least privilege: this workflow only checks out code and runs tests — it never
11+
# writes to the repo, comments on PRs, or opens issues. Pin the token to read so a
12+
# compromised dependency/action in the test run can't push, tag, or open a PR.
13+
permissions:
14+
contents: read
15+
1016
concurrency:
1117
group: ci-${{ github.ref }}
1218
cancel-in-progress: true
@@ -22,7 +28,11 @@ jobs:
2228
- uses: actions/checkout@v4
2329

2430
- name: Install uv
25-
uses: astral-sh/setup-uv@v5
31+
# Third-party action pinned to a commit SHA for supply-chain integrity
32+
# (a moving major tag could be repointed at malicious code that runs with
33+
# this workflow's token). GitHub-owned actions (checkout) stay on a major
34+
# tag. Bump the SHA and the trailing version comment together.
35+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
2636
with:
2737
enable-cache: true
2838

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ set of hard-won conventions instead of re-deriving them worse.
6060
the host-side authority), `.claude/rules/handoff.md`.
6161
- **CI** (`.github/workflows/ci.yml`) — runs the pipeline + wiring suite (core + studio console) on
6262
Python 3.11/3.12 via `uv sync --all-extras --all-packages`, plus the studio frontend's node core-tests;
63-
no live model, network, or Deno needed. `cve-reverser --version` now prints the package version.
63+
no live model, network, or Deno needed. `cve-reverser --version` now prints the package version. Runs
64+
least-privilege (`permissions: contents: read` — it only checks out and tests, never writes) with the
65+
third-party `astral-sh/setup-uv` action SHA-pinned (GitHub-owned `actions/checkout` stays on a major tag).
6466
- **Studio frontend split** — the ~1.5k-line `app.js` DOM IIFE sheds its trajectory-replay drawer into
6567
`trajectory.js` (a factory handed the shared helpers + getters for the live run-id / busy state it only
6668
READS; the pure replay math already lived in `replay-core.js`), with a node contract test asserting the

0 commit comments

Comments
 (0)