r/devsecops • u/asadeddin • May 14 '26
How to secure your GitHub Actions against supply chain attacks
We've all been seeing the news and it's clear that GitHub Actions isn’t just CI anymore. It's now part of your supply chain. It builds packages, publishes releases, deploys infra, and often has access to the credentials attackers want.
We put together a practical checklist for locking it down, but the highest-impact controls are pretty simple:
- Set default
GITHUB_TOKENpermissions to read-only. - Pin third-party actions to full commit SHAs, not tags like u/v4.
- Be very careful with
pull_request_target, especially on public repos and fork PRs. - Treat PR titles, branch names, issue bodies, labels, comments, and commit messages as untrusted input.
- Use OIDC for cloud access instead of long-lived AWS/GCP/Azure secrets.
- Don’t put untrusted code and privileged credentials in the same workflow context.
- Avoid broad artifact uploads like
path: .. - Don’t use self-hosted runners for public repos unless you really know what you’re doing.
- Add CODEOWNERS/review requirements for
.github/workflows/. - Continuously lint workflow YAML for risky triggers, unpinned actions, and script injection.
Full checklist here:
https://corgea.com/learn/github-actions-security-checklist
39
Upvotes
2
u/Few_Response_7028 May 14 '26
I like your list but i think cooldown was a huge omission. No hate tho.
4
u/amouat May 15 '26 edited May 15 '26
At Chainguard we're working on a catalog of hardened actions that basically meet all this criteria: https://github.com/chainguard-actions We take common public actions (e.g. Docker, Hashicorp) and run them through a checklist pretty similar to this.
It is a commercial product, but some of the actions are public e.g: https://github.com/chainguard-actions/cosign-installer
As described in the readme, each action:
uses:and container image reference pinned to an immutable SHAHARDENING.mdreport documenting exactly what was checked and fixedThe idea is to prevent common threats like tag hijacking, dependency confusion,
pull_request_targetabuse, and secret exfiltration.3
u/0DSavior May 15 '26
2
u/Express-Pack-6736 May 19 '26
The supply chain extends past your repo. Its the base image you pulled, the dependencies it installed, the IAM role the deployment assumed, and the s3 bucket the artifacts landed in. Orca connects those dots. We found a pipeline that was secure end to end during the build but the deployment step was using credentials that hadnt been rotated since the pipeline was created two years ago.