You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Harden CI/CD supply chain security across all workflows (#1328)
## Summary
Addresses critical, high, and medium findings from a comprehensive CI/CD
supply chain security audit.
### CRITICAL
- **`claude-code-review.yml`**: Fixed privilege escalation risk — was
checking out PR head branch ref (mutable) with `pull-requests: write` +
`issues: write` + `id-token: write`. Now checks out by commit SHA. Moved
all `github.event.*` expressions from inline `run:` steps to `env:`
blocks.
### HIGH
- **`dco-check.yml`**: Fixed script injection —
`github.event.pull_request.head.repo.full_name`, `.base.ref`,
`.base.sha`, `.head.sha` were injected directly into shell `run:` steps.
An attacker could craft a fork repo name with shell metacharacters. All
now passed via `env:` blocks.
### MEDIUM
- **All 22 workflows**: Added explicit `permissions:` blocks (15 were
missing, inheriting overly-broad repo defaults)
- **`updateVersion.yml`**: Moved `workflow_dispatch` inputs from inline
`${{ }}` to `env:` blocks
- **`slt.yml`**: Token now passed via `env:` block instead of inline in
`run:` command
- **`releaseFreeze.yml`**: Moved PR number to `env:` block, added
`permissions: contents: read`
- **`checkNextChangelog.yml`**: Moved PR number to `env:` block
- **Added `CODEOWNERS`**: Requires review for `.github/workflows/`
changes
- **Added `dependabot.yml`**: Automated monitoring for GitHub Actions
and Maven dependency updates
### Permissions Summary
| Permission | Workflows |
|---|---|
| `contents: read` | 18 workflows (tests, CI, checks) |
| `contents: write` | 3 workflows (release, release-thin, updateVersion)
|
| `issues: write, pull-requests: write` | 1 workflow (closeStale) |
| Scoped per-job | 2 workflows (claude, claude-code-review) |
NO_CHANGELOG=true
## Test plan
- [ ] Verify `dco-check` triggers correctly on a PR from a fork
- [ ] Verify `claude-code-review` still functions with SHA-based
checkout
- [ ] Verify `releaseFreeze` check passes on PRs
- [ ] Verify `checkNextChangelog` check passes on PRs
- [ ] Verify `closeStale` can still label/close issues and PRs
- [ ] Verify release workflows can still create GitHub releases
(`contents: write`)
This pull request was AI-assisted by Isaac.
---------
Signed-off-by: Gopal Lal <[email protected]>
0 commit comments