0%
Security Engineering for Software Teams
Thinking About Security
Cryptography You Will Actually Use
Identity
Vulnerability Classes
Infrastructure and Cloud
Detection and Response
Build Pipeline Integrity
The build pipeline turns source code into the artifacts that run in production. It reads code, fetches dependencies, compiles, tests, packages, signs and often deploys. Because everything shipped passes through it, the pipeline is one of the most valuable targets in an organisation. An attacker who controls a build can insert code into every release without touching the reviewed source. This section explains why pipelines are attractive targets and where they are typically weak.
What a pipeline can do
A modern continuous integration and delivery pipeline has remarkable power. It can read every repository it builds, write to artifact registries, push container images, publish packages, sign releases and deploy to production clusters and cloud accounts. It often holds credentials for all of these. In many organisations, the pipeline has more access to production than any single engineer. That concentration of power is exactly what makes it a target.
Why attackers target builds
Compromising a build gives an attacker reach that is hard to achieve any other way. Code inserted during the build is signed and shipped as a legitimate release. Customers and downstream systems trust it because it comes from the expected publisher. Well known supply chain incidents have shown attackers modifying build systems so that released software contained backdoors, while the source code in the repository remained clean and passed every review.
Source is not the artifact
Code review protects the source repository, but production runs artifacts. If anything between reviewed source and the final artifact can change the output, review alone gives a false sense of security. Build scripts, pipeline configuration, build tools, base images, dependencies and runners all influence the artifact. Pipeline integrity means ensuring that the artifact faithfully represents reviewed source built by a trusted process.
Pipeline configuration is code
Pipeline definitions usually live in the repository as workflow files. Anyone who can change them can change what the build does, including exfiltrating secrets or modifying artifacts. Many organisations protect application code with reviews but allow workflow changes with less scrutiny, or allow pull requests to run modified workflows with access to secrets. Treating pipeline configuration as sensitive code is a core control.
Secrets in pipelines
Pipelines need credentials to fetch private dependencies, push artifacts and deploy. These secrets are often long lived, broadly scoped and available to every job in a repository. Leaked secrets in build logs, secrets exposed to untrusted code and secrets copied between many repositories are among the most common causes of pipeline incidents. Reducing their number, scope and lifetime is one of the highest value improvements.
Untrusted input in builds
Pipelines process input that may be controlled by outsiders: pull requests from forks, issue titles, branch names, commit messages and dependency packages. If a workflow interpolates such input into shell commands or runs fork code with access to secrets, an outsider can execute commands in a trusted context. Open source projects are particularly exposed, but internal repositories that accept contributions from many teams face similar risks.
Shared and persistent runners
Build runners execute jobs. When runners are shared between projects or persist between jobs, one job can leave behind files, processes or cached data that affect the next. A malicious or compromised job could plant a modified compiler or poisoned cache that later trusted builds use. Self hosted runners on long lived machines are especially risky when they serve untrusted workloads.
Artifact registries
After the build, artifacts are stored in registries. If registry credentials are leaked or permissions are too broad, an attacker can overwrite an image tag or package version with a tampered one. Deployments that pull by mutable tags, without verifying digests or signatures, will deploy whatever the tag currently points to.
The deploy step
The final step decides what runs in production. If deployment accepts any artifact from any source, controls earlier in the pipeline can be bypassed by building elsewhere and pushing directly. Verification at deploy time, checking that the artifact was built by the trusted pipeline from approved source, closes this gap and is the anchor for the rest of the controls.
Insider and mistake risks
Not every pipeline risk comes from outside attackers. Engineers with broad access can make changes that bypass review, intentionally or under pressure during an incident. Mistakes, such as printing a secret in a debug step or granting a workflow write access to every repository, are common. Controls should make the safe path easy and unsafe changes visible, rather than assuming everyone with access is perfectly careful.
Blast radius
Pipelines often build many services with shared templates, shared runners and shared credentials. A weakness in a shared component can affect hundreds of repositories at once. This is also an opportunity: improving shared templates and platform features raises the security of every service that uses them. Platform teams that own the pipeline can deliver large risk reductions with focused work.
Frameworks that help
Industry frameworks describe pipeline security expectations. Supply chain levels for software artifacts, known as SLSA, define increasing levels of build integrity, from documented builds to hardened, isolated builds with signed provenance. Secure software development frameworks from standards bodies list practices for protecting the build environment. These frameworks give teams a shared vocabulary and a roadmap rather than a checklist to satisfy once.
Visibility first
Many organisations do not know how many pipelines they run, which runners exist, which secrets each pipeline holds or which pipelines can deploy to production. An inventory of pipelines, runners, credentials and deployment paths is the first step. It often reveals forgotten pipelines with powerful credentials, personal tokens used by automation and deployment paths that bypass the standard process.
Monitoring pipeline activity
Pipelines generate audit events: workflow changes, runner registrations, secret access, artifact pushes and deployments. Collecting these in the security logging platform enables detection of unusual activity, such as a workflow edited and run from a new branch, secrets accessed by an unexpected job or an image pushed outside the pipeline. Without such monitoring, pipeline compromises can go unnoticed for months.
Pipelines change constantly
Unlike production infrastructure, which usually changes through careful releases, pipelines are edited by many teams every day. New workflows are added, steps are copied from examples online, plugins are installed to solve a quick problem and permissions are widened to get a job working. Each small change can add risk, and few organisations review them with the same care as application changes. This constant churn means pipeline security is never finished; it needs guardrails that apply automatically to new and changed workflows.
Who can influence a build
Listing everyone and everything that can influence a build is a useful exercise. It includes developers who can push to branches, reviewers who approve changes, administrators who can change protection rules, maintainers of third party actions and plugins, maintainers of every dependency, the CI provider, the team that manages runner images and anyone holding registry or signing credentials. Each is a potential path for tampering. Reducing and protecting this list is the essence of pipeline integrity.
Build pipelines can read source, hold powerful credentials, write artifacts and deploy to production, so compromising one taints every release. Treat pipeline configuration as sensitive code, reduce secrets, keep untrusted input away from trusted contexts, isolate runners and verify artifacts at deploy time.