Commit f79f30f
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
0 commit comments