Skip to content

ci: default-deny workflow permissions + restore trigger branches - #92

Closed
QuarkAssistant wants to merge 2 commits into
Kleo-Network:productionfrom
QuarkAssistant:security/workflow-hardening
Closed

ci: default-deny workflow permissions + restore trigger branches#92
QuarkAssistant wants to merge 2 commits into
Kleo-Network:productionfrom
QuarkAssistant:security/workflow-hardening

Conversation

@QuarkAssistant

Copy link
Copy Markdown

Summary

Two related CI/security fixes to .github/workflows/ci.yml:

1. Restore trigger branches (mainproduction). The workflow listens for pull_request / push on main, but this repo's default branch is production and there is no main branch. 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-level permissions: block, a malicious dependency executed during build could acquire write scopes via the runner's GITHUB_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:

 on:
   pull_request:
     branches:
-      - main
+      - production
   push:
     branches:
-      - main
+      - production

+# Default-deny: jobs that need write scopes must opt up explicitly.
+# Prevents the GitHub Actions Cache poisoning + OIDC-token-write attack chain
+# documented in the May 2026 TanStack supply-chain compromise.
+permissions:
+  contents: read

 jobs:
   lint:
   ...

No behavior change for the three existing jobs (lint, build, test); they only consume repository contents.

Test plan

  • Workflow fires on this PR (proves trigger fix landed)
  • All three jobs (lint, build, test) succeed
  • No regression on existing functionality
  • After merge, future PRs against production show status checks

🤖 Generated with Claude Code

QuarkAssistant and others added 2 commits May 12, 2026 17:33
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>
@QuarkAssistant
QuarkAssistant deleted the security/workflow-hardening branch May 12, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant