Repository navigation
ci(security): add least-privilege workflow permissions (DAW-79) - #4
Conversation
tdawe1
left a comment
There was a problem hiding this comment.
Review: scdesk#4 — ci(security): add least-privilege workflow permissions (DAW-79)
Verdict: approve-ready (comment only) — no blocking findings. The 3-line change does exactly what DAW-79 asks and is safe to merge.
Scope checked: git diff origin/main...HEAD is one file, .github/workflows/ci.yml (+3/-0). YAML parses; jobs are rust, tauri-check, ui.
Spec (DAW-79)
DAW-79 acceptance for scdesk is "salvage the verified security fix into a worktree PR with test evidence, leave the primary checkout for Thomas to reset". This PR matches: top-level least-privilege token, with ticket evidence (YAML parse OK; cargo test --workspace --exclude scdesk-pulse --exclude scdesk-journal 57 passed, 0 failed; gitleaks no leaks). No scope creep — nothing beyond the permissions block.
Findings
Blocking — none
Medium — none
Low / advisory
- None that blocks merge. Cache note (info, no action needed):
rust/tauri-checkuseSwatinem/rust-cache@v2anduiusesactions/setup-node@v5withcache: npm. These cache via the Actions runtime token, so top-levelcontents: read(unspecified scopes default to none) does not break them; worst case a future cache-save warning would be non-fatal. Noactions:grant needed.
Info
.github/workflows/ci.yml:11-12—permissions: contents: readis correct and sufficient. All three jobs onlycheckout+ install toolchain/deps + runcargo test/cargo check/svelte-check. No job publishes, releases, pushes, uploads SARIF/pages, or writes back to the repo, so no additional scope (actions:,security-events:,id-token:) is needed. If a future job needs writes, add per-jobpermissions:rather than widening the top level..github/workflows/ci.yml:18,27,40—actions/checkout@v5,dtolnay/rust-toolchain@stable,Swatinem/rust-cache@v2,actions/setup-node@v5remain mutable major tags, not SHA-pinned. Pre-existing, out of scope for this diff; noting only. No secret/auth/injection surface in this diff (nosecrets.*, noGITHUB_TOKENwrites, no scripted input interpolation).- Gengo submit path: no contact. Bounded repo search for
gengo|submitfinds no matches; the diff touches only CI token scope, not app code. - Missing tests: none required. Token scope is not unit-testable; YAML parse (
yaml.safe_load,permissions == {'contents': 'read'}, 3 jobs) is the right cheap check and passes in this worktree. Optional future hardening (not this PR):actionlintorghalintin CI. - Standards: no repo-published coding standards found (
AGENTS.md/CLAUDE.md/CONTRIBUTING.mdabsent;docs/holds product parity notes only). Against the smell baseline: 3-line additive block, no naming/duplication/envy/clumps — clean. No needless complexity.
|
automerge review: ✅ approve (Review (Claude) (anthropic/claude-sonnet-5-5), head This PR adds a workflow-level
|
Summary
Salvaged the verified but uncommitted Alert Fixer fix from the primary
scdeskcheckout (DAW-79), applied unchanged in this worktree. What changed:Evidence
cargo test --workspace --exclude scdesk-pulse --exclude scdesk-journal— 57 passed, 0 failed (3+20+22+5+7 across crates, doc-tests 0).gitleaks git . --log-opts=origin/main..HEAD— no leaks found.Merge Danger
Door: two-way
Blast Radius: low — read-only token is sufficient for checkout/test jobs; add perms if a future job needs writes.
What Thomas must do
~/Projects/scdesk) to discard the now-duplicated uncommitted changes there — the primary working tree was left exactly as found by this PR work.