Secure a GitHub Actions delivery workflow
8 steps · about 3 h 2 min · Intermediate
- Threat-model the workflow and its inputs (guide, GitHub Docs, 32 min)
Identify where untrusted code, credentials and mutable dependencies cross trust boundaries.
- Reduce the workflow token permissions (guide, GitHub Docs, 20 min)
Grant only the repository operations each job needs instead of relying on broad defaults.
- Scope and mask necessary secrets (guide, GitHub Docs, 22 min)
Keep long-lived secrets out of source and expose them only to the jobs and environments that require them.
- Replace cloud keys with short-lived identity (guide, GitHub Docs, 24 min)
Use workload identity claims so a leaked static credential is not the path to cloud deployment.
- Protect the deployment environment (guide, GitHub Docs, 22 min)
Add reviewers, branch restrictions and scoped environment secrets around production promotion.
- Pin and review third-party actions (guide, GitHub Docs, 20 min)
Bind dependencies to reviewed immutable revisions and inspect what privileged steps execute.
- Review dependency changes at the gate (guide, GitHub Docs, 18 min)
Surface newly introduced packages and known risks before a pull request reaches delivery jobs.
- Attach and verify build provenance (guide, GitHub Docs, 24 min)
Finish with evidence linking the released artifact to the controlled workflow and source revision.