ci: default-deny workflow permissions + restore trigger branches - #92
Closed
QuarkAssistant wants to merge 2 commits into
Closed
ci: default-deny workflow permissions + restore trigger branches#92QuarkAssistant wants to merge 2 commits into
QuarkAssistant wants to merge 2 commits into
Conversation
Defends against the GitHub Actions Cache poisoning + OIDC-token-extraction attack chain documented in the May 2026 TanStack supply-chain compromise: without an explicit top-level permissions block, a malicious dependency running during build could acquire write scopes via the runner's GITHUB_TOKEN and modify repository state. Setting permissions: contents: read at the workflow level forces any job that needs more (e.g. a future release publish) to opt up explicitly, making elevated scopes auditable in the workflow file. No behavior change for the existing three jobs (lint/build/test), which only consume the repository contents. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The repository's default branch is `production` (not `main`). The CI workflow was configured to fire on push/pull_request to `main`, which does not exist, so CI has not run on any PR for the lifetime of this file. Visible symptom: PRs against `production` show 0 status checks. Fix: align the trigger branch list with the repository's actual default branch so lint/build/test run on every PR and push as intended. Combined with the default-deny permissions block from the previous commit, CI is now both functional and hardened. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related CI/security fixes to
.github/workflows/ci.yml:1. Restore trigger branches (
main→production). The workflow listens forpull_request/pushonmain, but this repo's default branch isproductionand there is nomainbranch. CI has not been firing on any PR or push. Visible symptom: open PRs in this repo (including #86 from QuarkAssistant) show 0 status checks reported. Fixing the trigger restores lint/build/test on every PR.2. Add default-deny workflow permissions (
contents: read). Defends against the GitHub Actions Cache poisoning + OIDC-token-write attack chain documented in the May 2026 TanStack supply-chain compromise. Without an explicit top-levelpermissions:block, a malicious dependency executed during build could acquire write scopes via the runner'sGITHUB_TOKEN. Default-deny at the workflow level forces any job that needs more (e.g. a future release publish) to opt up explicitly, making elevated scopes auditable in the workflow file itself.Diff
.github/workflows/ci.yml, +6 / -2 lines:No behavior change for the three existing jobs (
lint,build,test); they only consume repository contents.Test plan
productionshow status checks🤖 Generated with Claude Code