All articles

DevSecOps · 17 November 2026 · 4 min read

Securing your CI/CD pipeline: the supply-chain risks small teams overlook

A CI/CD pipeline is the most privileged system most small companies have and the least protected. It can read the source code, holds credentials for the cloud account, the container registry and the production servers, and runs code from dozens of third-party actions and packages on every push. An attacker who controls the pipeline does not need to break into production: the pipeline deploys for them.

How pipelines get compromised

Ten controls that matter most

1. Pin third-party actions to a full commit SHA

Tags like @v4 can be moved by whoever controls the action. A commit SHA cannot.

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Dependabot and Renovate understand this format and will propose updates with the version in the comment.

2. Default the token to read-only

permissions:
  contents: read

jobs:
  deploy:
    permissions:
      contents: read
      id-token: write   # only for the job that needs OIDC

Set the organisation default for GITHUB_TOKEN to read-only and grant write permissions per job.

3. Replace stored cloud keys with OIDC

GitHub Actions and GitLab CI can exchange a signed identity token for short-lived cloud credentials in AWS, Azure and Google Cloud. Restrict the trust policy to a specific repository and branch or environment, for example only refs/heads/main of one repository may assume the production deploy role. A leaked log then contains nothing reusable.

4. Separate build from deploy

Jobs that run on every pull request should have no production secrets at all. Put production credentials in a protected environment that only the main branch can use, with required reviewers if you deploy manually.

5. Treat untrusted code as untrusted

Never check out and run a fork’s code in pull_request_target or similar privileged triggers. Do not interpolate PR titles, branch names or issue text directly into shell commands (run: echo "${{ github.event.pull_request.title }}" is a command injection); pass them through environment variables instead.

6. Protect the branches and the pipeline definition

Require pull requests and at least one review for main, block force pushes, and use CODEOWNERS so that changes to .github/workflows/ or .gitlab-ci.yml need approval from someone responsible for security. Changing the pipeline is changing who can deploy.

7. Isolate runners

Prefer ephemeral, hosted runners. Self-hosted runners should be single-use or at least dedicated per trust level, never attached to public repositories, and never on the same machine as production. A runner with the Docker socket mounted is effectively root on its host.

8. Control dependencies

9. Scan for secrets on every push

A secret scanner in CI and push protection on the platform stop the most common leak before it spreads. See our guide to secrets management.

10. Sign and trace what you deploy

Generate build provenance (GitHub artifact attestations, SLSA provenance) and sign container images with Sigstore cosign. Deploy only images built by your pipeline, referenced by digest. This makes it possible to prove what is running in production and where it came from.

Monitor the pipeline itself

Review the audit log for new deploy keys, new secrets, changed branch protection and new self-hosted runners. These events are rare in a small team, so any unexpected one deserves a question.

Our take

If you do only three things this month: pin actions by SHA, set token permissions to read-only by default, and replace stored cloud keys with OIDC. Together they close the paths used in most real pipeline compromises we have read about, and none of them requires a new tool or budget. The deeper controls (provenance, signing, isolated runners) become important once you deploy often or serve customers who ask about supply-chain security, as NIS2 suppliers increasingly are.

Want your pipeline reviewed?

Pipeline hardening is part of our DevOps plans. See pricing or ask for the free IT audit.

More articles

Websites · 3 min readWebsite security checklist for small businesses: 12 checks in 15 minutesTwelve practical checks for a company website: HTTPS and certificates, security headers, updates, admin login, exposed files, backups and the domain itself, with what to fix first.Read the articleEmail security · 3 min readWhy are your emails going to spam? A diagnosis by symptomCustomers do not get your invoices or replies? Find the cause by symptom: missing authentication, a blacklisted server, forwarding, content or a new domain, and how to fix each one.Read the articleInfrastructure · 3 min readMoving company email to Microsoft 365 or Google Workspace without losing mailA practical plan for moving a small company’s email from hosting or an old server to Microsoft 365 or Google Workspace: preparation, DNS, migration of old mail and the cutover day.Read the article