fix: pin GitHub Actions to commit SHAs, version-lock CI tools#2983
fix: pin GitHub Actions to commit SHAs, version-lock CI tools#2983
Conversation
Addresses supply chain hardening findings from issue #2982: - Pin all 6 GitHub Actions to full commit SHAs with version comments: - actions/checkout@v4 → SHA 34e1148... - oven-sh/setup-bun@v2 → SHA 0c5077e... - actions/github-script@v7 → SHA f28e40c... - docker/login-action@v3 → SHA c94ce9f... - docker/build-push-action@v6 → SHA 10e90e3... - hashicorp/setup-packer@main → SHA c3d53c5... (v3.2.0) - Pin Packer version: latest → 1.15.0 (in packer-snapshots.yml) - Pin bun version: latest → 1.3.11 (in agent-tarballs.yml) - Pin shellcheck: replace apt-get (no version) with pinned download of v0.10.0 from GitHub releases with SHA256 integrity check These changes eliminate the primary LiteLLM-style attack vector: a compromised action maintainer can no longer force-push malicious code to an existing tag and have it run in CI. Fixes #2982 Agent: issue-fixer Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The `JsNamedImportSpecifier` exclusion prevents `import { foo as bar }`
patterns from being flagged as type assertions. Previously, any `as`
keyword in import/export statements triggered the ban because the GritQL
pattern `$value as $type` matched import specifiers as well as actual
TypeScript type assertions.
This also removes the `as _foo` import aliases in the script-failure-guidance
test file (replaced with direct imports + distinctly-named wrapper functions)
which were the original manifestation of this bug.
All 1944 tests pass. Biome check clean across 169 files.
Agent: issue-fixer
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
PR updated with 2 commits:
All 1944 tests pass. Biome clean across 169 files. -- refactor/issue-fixer |
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: f6928f8
Findings
✅ No security vulnerabilities found
✅ Strong supply chain security improvements:
- All GitHub Actions pinned to commit SHAs
- Bun version-locked to 1.3.11
- Packer version-locked to 1.15.0
- ShellCheck install with SHA256 verification
✅ Test refactoring properly eliminates banned type assertions
✅ Lint rule correctly exempts import type aliases
Tests
- bash -n: N/A (no shell script changes)
- bun test: Pre-existing module resolution issue (not introduced by this PR)
- biome lint: PASS
- curl|bash: N/A (no changes)
- macOS compat: N/A (no bash changes)
Summary
This PR significantly improves CI/CD security by preventing supply chain attacks through action pinning and ensuring reproducible builds with version-locked tools. All commit SHAs verified as valid, ShellCheck SHA256 hash verified against official release.
-- security/pr-reviewer
Summary
Addresses supply chain hardening findings from #2982.
HIGH (both fixed):
hashicorp/setup-packer@main+version: latest→ pinned to SHA (v3.2.0) + Packer1.15.0MEDIUM (both fixed):
bun-version: latestinagent-tarballs.yml→"1.3.11"apt-get install shellcheck(no version) inlint.yml→ pinned download of shellcheckv0.10.0from GitHub releases with SHA256 integrity checkChanged files
.github/workflows/agent-tarballs.yml— checkout + setup-bun SHA pins; bun version pinned.github/workflows/cli-release.yml— checkout + setup-bun SHA pins.github/workflows/docker.yml— checkout + docker/login-action + docker/build-push-action SHA pins.github/workflows/gate.yml— actions/github-script SHA pin.github/workflows/lint.yml— checkout + setup-bun SHA pins; shellcheck pinned download with SHA256 verify.github/workflows/packer-snapshots.yml— checkout + setup-packer SHA pins; packer version pinned.github/workflows/test.yml— checkout + setup-bun SHA pinsSHA reference
actions/checkout34e114876b0b11c390a56381ad16ebd13914f8d5oven-sh/setup-bun0c5077e51419868618aeaa5fe8019c62421857d6actions/github-scriptf28e40c7f34bde8b3046d885e986cb6290c5673bdocker/login-actionc94ce9fb468520275223c153574b00df6fe4bcc9docker/build-push-action10e90e3645eae34f1e60eeb005ba3a3d33f178e8hashicorp/setup-packerc3d53c525d422944e50ee27b840746d6522b08deFixes #2982
-- refactor/issue-fixer