Software Supply Chain Security
Securing dependencies and CI/CD pipelines with lockfiles, SHA-pinned GitHub Actions (with this repo as an honest example), pnpm audit, Renovate/Dependabot, SBOMs, and SLSA provenance.
TL;DR
A03:2025 Software Supply Chain Failures covers compromised packages, tampered lockfiles, and unpinned CI pipelines. Defend with --frozen-lockfile, full 40-char SHA pinning for GitHub Actions, pnpm audit + Renovate/Dependabot, SBOMs, and SLSA provenance—and audit your own workflows honestly.
Why it exists
Attackers increasingly target the build pipeline instead of the running app: hijacking a maintainer's npm token, sneaking malicious postinstall scripts into transitive dependencies, or force-pushing a malicious commit onto a popular GitHub Action tag (@v4).
Honest audit of this repo's workflows
Look at .github/workflows/ in this repository as a real-world example of what is already in place and what still needs hardening:
| Control | Current state in this repo | Gap / next step |
|---|---|---|
| Lockfile enforcement | ci.yml, quality.yml, and inbox.yml all run pnpm install --frozen-lockfile. | Keep --frozen-lockfile everywhere; consider --ignore-scripts where native builds aren't needed. |
| Action pinning | labs.yml pins to patch tags (actions/checkout@v4.2.2, hadolint/hadolint-action@v3.5.0, opentofu/setup-opentofu@v2.0.2), while ci.yml, quality.yml, and inbox.yml still use floating major tags (actions/checkout@v4, pnpm/action-setup@v4, actions/setup-node@v4). | Not SHA-pinned yet: pin every uses: across all 4 workflows to a 40-character commit SHA with a version comment. |
Least-privilege GITHUB_TOKEN | labs.yml and quality.yml set permissions: contents: read; inbox.yml sets permissions: issues: write. | ci.yml still omits an explicit permissions: contents: read block. |
# UNSAFE: floating tag can be retargeted upstream
- uses: actions/checkout@v4
# SAFE: immutable 40-char commit SHA with human-readable version comment (not run)
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1Core supply-chain controls
- Lockfiles (
pnpm-lock.yaml): Commit the lockfile, review unexpected lockfile diffs in PRs, and always install withpnpm install --frozen-lockfilein CI. - Vulnerability scanning (
pnpm audit) & automated updates: Runpnpm audit --prodin CI (note: triage CVEs in dev/build tools separately from runtime exposure) and enable Renovate or Dependabot to open small, frequent update PRs (including SHA bumps for Actions). - SBOM (CycloneDX / SPDX): Generate an SBOM during release builds so you can answer "which deployed apps include package X?" in seconds during a zero-day incident.
- Provenance / SLSA: Use signed build provenance (such as GitHub Artifact Attestations) to cryptographically bind the published artifact to the exact source commit and CI workflow.
Gotchas
- Pinning to
@v4.2.2feels "pinned" but is still mutable: Only a 40-character commit SHA is immutable in Git. - Ignoring
postinstallscripts: Malicious npm packages often execute code duringpnpm installbefore your tests even start; audit new dependencies and use--ignore-scriptswhere feasible. pnpm auditnoise: A medium-severity ReDoS in a test-only devDependency should not train the team to ignore real runtime criticals—separate prod vs dev audit policies.
Production checklist
- Every CI install uses
pnpm install --frozen-lockfile. - Every third-party GitHub Action is pinned to a 40-character commit SHA (maintained by Renovate/Dependabot).
- Every workflow declares explicit minimal
permissions:(defaultcontents: read). - Automated dependency updates and
pnpm auditrun on a schedule and on PRs. - Release artifacts emit an SBOM and signed SLSA provenance attestation.
Check yourself
Check Yourself
1. Why is actions/checkout@v4.2.2 weaker than pinning to a 40-character commit SHA?
2. What problem does an SBOM solve during a newly disclosed zero-day vulnerability (like Log4Shell)?
Sources
Related Notes
Secrets Management & CI OIDC
Environment variables vs secret managers, secret rotation, what to do if a secret is committed to Git, and replacing long-lived CI keys with OIDC.
Scrum vs Kanban vs Waterfall vs Hybrid
Compare Scrum, Kanban, Waterfall, Scrumban, and Shape Up for small engineering teams—cadence, roles, artifacts, overhead, and a practical decision guide.