security: Harden supply chain for GitHub Actions workflows#375
security: Harden supply chain for GitHub Actions workflows#375ascorbic merged 1 commit intoemdash-cms:mainfrom
Conversation
Pin CLA action to SHA and restrict Bonk workflow to authorized users.
|
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
| jobs: | ||
| bonk: | ||
| if: github.event.sender.type != 'Bot' | ||
| if: github.event.sender.type != 'Bot' && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR') |
| - name: "CLA Assistant" | ||
| if: (github.event.issue.pull_request && (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA')) || github.event_name == 'pull_request_target' | ||
| uses: contributor-assistant/github-action@v2.6.1 | ||
| uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1 |
There was a problem hiding this comment.
All other workflows in the repo are pinned
There was a problem hiding this comment.
Pull request overview
This PR hardens GitHub Actions supply-chain security by pinning an unpinned third-party action to an immutable commit SHA and tightening access to the Bonk assistant workflow to trusted repository affiliations.
Changes:
- Pin
contributor-assistant/github-actionin the CLA workflow from a tag (v2.6.1) to a specific commit SHA. - Restrict the Bonk workflow so it only runs for comments created by
MEMBER/OWNER/COLLABORATOR(and not bots).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/cla.yml |
Pins CLA Assistant action to a commit SHA to reduce tag-hijack risk. |
.github/workflows/bonk.yml |
Adds an author_association gate to limit who can trigger the Bonk job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I'd be happy to follow up on other recommendations (I'm using https://github.com/erezrokah/skills/blob/main/skills/supply-chain-auditor/SKILL.md), haven't done them as they have bigger impact on how dependencies are managed in the repo |
ascorbic
left a comment
There was a problem hiding this comment.
Thanks, this is great!
…s#375) Pin CLA action to SHA and restrict Bonk workflow to authorized users.

What does this PR do?
Hardens CI supply chain security by pinning an unpinned GitHub Action to its commit SHA and restricting the Bonk AI assistant workflow to authorized repository collaborators.
Changes:
cla.yml: Pincontributor-assistant/github-actionfrom tagv2.6.1to commit SHAca4a40a7d1004f18d9960b404b97e5f30a505a08bonk.yml: Addauthor_associationcheck (MEMBER/OWNER/COLLABORATOR) so only authorized users can invoke the Bonk AI assistantAdditional recommendations
The following hardening steps are also recommended but not included in this PR:
minimum-release-age(e.g.3d) to workspacepackage.jsonunderpnpm— prevents installing newly published packages before the community can detect malicious releasescooldown(e.g.default: 3) to.github/dependabot.yml— delays Dependabot PRs for new releasesminimumReleaseAgeandhelpers:pinGitHubActionDigeststorenovate.json— same cooldown for Renovate, plus automatic SHA pinning for Actionsblock-exotic-subdepsto.npmrc— prevents transitive dependencies from using install scripts, git URLs, or other exotic specifiersWhy this matters — real-world supply chain attacks
GitHub Actions tag hijacking
aquasecurity/trivy-actiontag compromise injected mining code.checkmarx/kics-github-action, injecting credential-stealing malware targeting AWS, Azure, GCP, SSH keys, and Kubernetes tokens.litellmpackages to PyPI with credential harvesting and remote code execution.npm package hijacking
flatmap-stream) that stole Bitcoin wallet keys.torchtritonto the public registry, shadowing PyTorch's internal package.Why cooldown / minimum-release-age matters
A 3-day
minimum-release-agewould have blocked all of the npm attacks above — each was detected and reverted within hours. The cooldown prevents your lockfile refresh from pulling a version before the community has time to flag it.Type of change
Checklist
pnpm typecheckpassespnpm --silent lint:json | jq '.diagnostics | length'returns 0pnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure