Where DevSecOps Stops Software Supply Chain Attacks
Five places DevSecOps integrations reduce supply chain risk: source, dependencies, build provenance (SLSA), signing with cosign, and deploy verification.
DevSecOps integrations reduce software supply chain risk at five points: the source repository, dependency intake, the build system, artifact publishing and signing, and deployment admission. Each point gets an automated check, such as dependency review on pull requests, provenance from the build, signatures verified before deploy, and repository hygiene scored by tools like OpenSSF Scorecard.
Key takeaways
- A supply chain attack targets something you trust, such as a dependency, a build system or a published image, rather than your running application.
- GitHub's dependency review shows added, removed and updated dependencies with known vulnerabilities on each pull request, and the dependency-review-action can fail the check.
- SLSA defines build levels from L0 (no guarantees) to L3 (hardened builds); L1 requires provenance, L2 a hosted build platform with signed provenance.
- Sigstore's cosign supports keyless signing and verification tied to an OIDC identity and issuer.
- Verifying signatures and provenance at deployment time closes the loop: an artifact that was not built by your pipeline should not run.
What a supply chain attack is, in defensive terms
Modern applications are assembled from many parts the team did not write: open source packages, base container images, build plugins, CI actions and infrastructure modules. Each part is trusted implicitly once it is in the build. A supply chain attack abuses that trust by tampering with one of those parts, or with the system that assembles them, so that harmful code reaches production through a normal-looking release.
From a defender's point of view, the goal is to answer three questions for every artifact you deploy. What went into it? Who or what built it, and from which source? Has it changed since it was built? DevSecOps integrations are the automated checks that answer those questions at each stage, without relying on someone to remember to look. This article stays on the defensive side: where to place controls and what each control does.
The five integration points
| Stage | Risk being reduced | Typical integration |
|---|---|---|
| Source | Unreviewed changes, compromised accounts, risky workflow settings | Branch protection, required review, signed commits, Scorecard checks |
| Dependencies | Vulnerable or unwanted packages entering the codebase | Dependency review on pull requests, update bots, pinned versions, license policy |
| Build | Tampered builds, leaked build secrets | Hosted, isolated build runners, least-privilege tokens, provenance generation |
| Artifact | Modified or substituted images and packages | Signing, SBOM attachment, immutable registries, vulnerability scanning |
| Deploy | Running something that did not come from your pipeline | Signature and provenance verification at admission |
1. Source: protect the repository and the workflow
Everything starts with source code. If an attacker can push directly to the main branch, or change a CI workflow to exfiltrate secrets, every later control is weakened. The basic controls are well known: branch protection, required code review, restricting who can change CI configuration, and multi-factor authentication for all contributors.
OpenSSF Scorecard is a useful way to check these settings automatically. It runs 18 checks grouped into holistic security practices, source risk and build risk. Several apply directly to supply chain defence: Branch-Protection, Code-Review, Dangerous-Workflow (risky patterns in GitHub Actions), Token-Permissions (whether workflow tokens are read-only by default), Pinned-Dependencies and Signed-Releases. Running Scorecard on your own repositories, and on important dependencies you rely on, gives a quick picture of where gaps are.
CI workflows deserve particular care because they hold credentials. Give workflow tokens the least permission they need, pin third-party actions to a specific commit rather than a moving tag, and avoid workflows that run untrusted pull request code with access to secrets.
2. Dependencies: control what enters the codebase
Most application code by volume comes from dependencies, and new dependencies arrive through ordinary pull requests. That makes the pull request the natural checkpoint. GitHub's dependency review shows, on each pull request, which dependencies were added, removed or updated, with release dates, usage and known vulnerabilities, including changes to indirect dependencies in lock files.
The GitHub Actions version, the dependency-review-action, fails the check by default when it finds vulnerable packages, and can be configured with a severity threshold and license allow or deny lists. GitHub's documentation says it is available for all public repositories and needs GitHub Code Security or GitHub Advanced Security for private ones. Organisation owners can require it across repositories with rulesets.
Other habits complement this. Use lock files and pinned versions so builds are reproducible and an upstream release cannot silently change what you ship. Use an update bot to raise regular, small dependency update pull requests, which keeps you close to patched versions without large risky jumps. And remove dependencies you no longer use; every package is attack surface.
3. Build: make the build trustworthy and traceable
The build system turns source and dependencies into artifacts, so a compromised build can inject code that never appears in the repository. SLSA (Supply-chain Levels for Software Artifacts) is a framework for reasoning about build integrity. In SLSA v1.0, the build track has four levels. L0 has no guarantees. L1 requires a consistent build process and provenance that describes how the artifact was built. L2 requires a hosted build platform, with provenance signed by that platform so consumers can verify it. L3 requires a hardened build platform that isolates runs from each other and keeps the provenance signing secret out of reach of user-defined build steps. The SLSA site lists version 1.2 as the current specification, so check it for the latest wording.
In practice, moving up the levels means building on a managed or dedicated CI platform rather than developer laptops, generating provenance automatically as part of the build, and making sure the build steps you control cannot forge that provenance. Even reaching L1 is valuable: provenance answers "where did this artifact come from?" in a machine-checkable way.
Build secrets matter too. Short-lived credentials issued per job, rather than long-lived keys stored as CI variables, limit the damage if a build is compromised. Our guides on storing secrets in IaC projects and secret management in GitOps cover the patterns.
4. Artifact: sign, describe and store immutably
Once an artifact exists, you want to prove it has not changed and describe what is inside it. Signing does the first job. Sigstore's cosign supports keyless signing, where the signer authenticates with an OIDC provider and the signature is tied to that identity rather than to a long-lived private key you must protect. Verification checks both the identity and the issuer:
# Sign an image in CI (keyless, using the CI job's OIDC identity)
cosign sign registry.example.com/team/app@sha256:<digest>
# Verify before deploy, pinning the expected identity and issuer
cosign verify registry.example.com/team/app@sha256:<digest> \
--certificate-identity=<expected signer identity> \
--certificate-oidc-issuer=<expected OIDC issuer URL>
Signing by digest rather than by tag avoids ambiguity, because a tag can be moved to a different image while a digest cannot. A software bill of materials (SBOM) does the second job, listing the components inside the artifact so you can answer "are we affected?" quickly when a new vulnerability is announced. Attach SBOMs and provenance to the artifact in the registry, scan images for known vulnerabilities, and configure the registry so published tags cannot be overwritten.
5. Deploy: verify before you run
All the earlier controls produce evidence: signatures, provenance and scan results. Deployment is where that evidence is enforced. In Kubernetes, an admission controller can reject pods whose images are not signed by your pipeline's identity, do not come from approved registries, or lack required provenance. Without this step, a compromised credential could still push and run an unsigned image, and signing would be decoration.
Policy engines such as Kyverno and Gatekeeper, or built-in admission policies, are the usual places for these rules. Our articles on where admission controllers enforce policy and policy as code in pipelines cover the mechanics. As with other policy rollouts, start in audit or warn mode, fix what it finds, then enforce.
Common gaps that weaken these controls
Several gaps show up repeatedly in pipelines that look secure on paper. Signatures are created but never verified, so signing adds no protection. Images are verified by tag instead of digest, so a moved tag can point to something unexpected. Third-party CI actions are referenced by a version tag that the publisher can change, rather than pinned to a commit. Build runners are shared between trusted and untrusted jobs, such as builds of pull requests from forks. Vulnerability scans run but nobody owns the findings, so the same critical issues sit open for months.
Each gap is easy to close once noticed. The hard part is noticing, which is why automated scoring such as Scorecard and periodic reviews of pipeline configuration are worth the time. A short checklist reviewed every quarter, covering signing, verification, pinning, runner isolation and finding ownership, catches most of them before they matter.
Infrastructure code is part of the supply chain
Terraform modules, Helm charts and Ansible roles pulled from public registries are dependencies too. Pin them to versions, review changes when updating, and scan them like application code. Our article on preventing IaC misconfigurations covers scanning and policy for infrastructure code, which uses the same pipeline integration points described here.
Responding when a dependency is compromised
Prevention is never complete, so plan for the day an upstream package or image you use is reported as compromised or critically vulnerable. The integrations above make that response much faster. SBOMs stored with each artifact let you search for every image that contains the affected component, instead of asking teams to check by hand. Provenance tells you which builds and source commits produced those images. Dependency update bots can open fix pull requests across many repositories at once, and the same pipeline checks verify the fixes.
A short written runbook helps: how to search SBOMs, who decides whether to roll back or patch forward, how to block the affected version in dependency policy so it cannot be reintroduced, and how to confirm that every running workload has moved to a safe version. Practise it once with a harmless test case so the steps are familiar before a real event.
Ownership: who runs each integration
Supply chain controls touch several teams, so ownership needs to be explicit. Security usually defines the requirements: which signatures are trusted, what vulnerability severities block a merge, and what provenance level the organisation aims for. The platform or DevOps team builds the shared pipeline templates that generate provenance, sign artifacts and attach SBOMs, and runs the admission policies in clusters. Application teams fix findings in their own code and dependencies, and keep their repositories within the source protection baseline.
Putting these controls into shared templates matters for the same reason it matters for other DevSecOps checks. If each team must add signing and SBOM generation by hand, coverage will be uneven and new services will start without them. If the default pipeline does it, every service is covered from its first build, and the admission policy can safely require signatures everywhere.
Putting it together without stalling delivery
Trying to add every control at once usually fails. A more practical order is: protect the source (branch protection, required review, least-privilege workflow tokens), then add dependency review on pull requests, then generate provenance and sign artifacts in CI, then verify signatures at deployment in audit mode, and finally enforce. Run Scorecard early to see where you stand, and again later to see progress.
Measure outcomes rather than tool counts. Useful measures include the share of deployed images that are signed and verified, the time to patch a critical dependency vulnerability across services, and the number of repositories meeting your source protection baseline. Those numbers tell you whether integrations are actually reducing risk.
For Kubernetes-specific hardening, see our cluster hardening steps. The DevSecOps course covers pipeline security integrations, and the CKS course covers supply chain security in Kubernetes. Both run in the Kharadi classroom in Pune and live online.
Frequently asked questions
Where should DevSecOps controls for supply chain security go?
At five points: the source repository, dependency intake on pull requests, the build system, artifact signing and storage, and deployment admission where signatures and provenance are verified.
What is SLSA?
Supply-chain Levels for Software Artifacts, a framework for build integrity. In v1.0 the build track runs from L0 (no guarantees) through L1 (provenance exists) and L2 (hosted build with signed provenance) to L3 (hardened, isolated builds).
What does GitHub dependency review do?
It shows dependency changes in a pull request with known vulnerabilities and other details. The dependency-review-action can fail the check for vulnerable packages or disallowed licenses and block the merge if required.
What is keyless signing with cosign?
Signing where the signer proves identity through an OIDC provider instead of managing a long-lived private key. Verification checks the expected certificate identity and OIDC issuer.
Why verify signatures at deploy time?
Signing only helps if something checks it. Admission-time verification makes sure only artifacts built and signed by your pipeline can run, even if registry credentials are misused.
What does OpenSSF Scorecard check?
It runs 18 automated checks on a repository, including Branch-Protection, Code-Review, Dangerous-Workflow, Token-Permissions, Pinned-Dependencies, Signed-Releases and Vulnerabilities.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0