Skip to content

ci: workflow hardening (permissions + trigger fix) - #1

Merged
QuarkAssistant merged 2 commits into
productionfrom
security/workflow-hardening
May 12, 2026
Merged

ci: workflow hardening (permissions + trigger fix)#1
QuarkAssistant merged 2 commits into
productionfrom
security/workflow-hardening

Conversation

@QuarkAssistant

@QuarkAssistant QuarkAssistant commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

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

1. Default-deny workflow permissions

Defends against the GitHub Actions Cache poisoning + OIDC-token-write attack chain documented in the May 2026 TanStack supply-chain compromise.

permissions:
  contents: read

Forces any future job that needs more (e.g. release publish) to opt up explicitly.

2. Trigger-branch fix: mainproduction

The workflow listened for pull_request / push on main, but the repository's default branch (both fork and upstream Kleo-Network/kleo-connect) is production. There is no main branch. The workflow never fired, which is why PRs (including Kleo-Network#86 upstream) have been showing 0 status checks for hours.

on:
  pull_request:
    branches:
      - production   # was: main
  push:
    branches:
      - production   # was: main

Test plan

  • CI runs on this PR (proves trigger fix landed)
  • All three jobs (lint, build, test) succeed
  • No regression on existing read-only operations

Companion PR to upstream Kleo-Network/kleo-connect will be opened with the same changes.

🤖 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 marked this pull request as ready for review May 12, 2026 22:37
@QuarkAssistant QuarkAssistant changed the title ci: default-deny workflow permissions (security hardening) ci: workflow hardening (permissions + trigger fix) May 12, 2026
@QuarkAssistant
QuarkAssistant merged commit d87af96 into production May 12, 2026
2 of 3 checks passed
@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