Security in the Pipeline

The CI/CD pipeline is one of the most privileged systems in an engineering organization — it has access to source code, secrets, and the keys to production — which makes it a prime target. Worse, it can become the delivery mechanism for an attack: compromise the pipeline and you compromise everything it ships. This post is about securing the pipeline itself and building security into it, the heart of DevSecOps.

Earlier posts built a fast, reliable, version-controlled pipeline. This one hardens it. Pipeline security has two faces: securing the pipeline (it’s a high-value target) and security in the pipeline (shifting security checks left, into the flow). Both matter, and the recent wave of software-supply-chain attacks has made them urgent rather than optional.

The pipeline is a privileged target

Step back and consider what the pipeline can touch: it reads all your source code, holds credentials to deploy to production, often has access to cloud accounts, package registries, and signing keys. It is, in effect, a machine with the combined privileges of your whole engineering org — and it runs code automatically on every commit.

That makes it an attacker’s dream. If an attacker can influence what the pipeline runs — by compromising a dependency, a build tool, a pipeline config, or a token — they can inject malicious code into your builds, steal your secrets, or deploy their code to your production. This is the software supply chain attack surface, and it has produced some of the most damaging breaches of recent years precisely because it turns your trusted delivery system into the attacker’s delivery system. Securing the pipeline is therefore not a nice-to-have; the pipeline’s privilege makes it a first-class part of your attack surface.

Securing the pipeline itself

Protecting the pipeline as the privileged system it is:

The theme mirrors the guardrails principle from AI security: assume a job could be compromised and limit what it can reach — least privilege, isolation, short-lived credentials.

Shifting security left: security in the pipeline

The other half is building automated security checks into the pipeline so vulnerabilities are caught early — “shifting left,” moving security from a late manual audit to an automated early gate:

The value of putting these in the pipeline is that security becomes continuous and automatic rather than a rare manual gate — every change is checked, and problems are found when they’re cheap to fix (at authoring time) rather than after release. The discipline point: tune these to fail on genuine high-severity findings and surface the rest as warnings, or alert fatigue makes developers ignore them — the same fail-safe-but-usable balance from guardrails.

Supply chain integrity: provenance and signing

The frontier of pipeline security is proving that what you shipped is what you built — supply chain integrity:

Together these let you prove the integrity of your delivery, not just assert it — the direct defense against the supply-chain attacks that make the pipeline such a tempting target. They’re increasingly expected (and in some sectors, required), and they’re the natural endpoint of taking pipeline security seriously: not just guarding the pipeline, but producing cryptographic evidence of what it did.

Key takeaways

Further reading

Sources & References

Provenance and supply-chain integrity levels