DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Reducing Deployment Time by 60% on GCP: A CI/CD Pipeline Redesign Case Study
  • The DevSecOps Paradox: Why Security Automation Is Both Solving and Creating Pipeline Vulnerabilities
  • Copilot, Code, and CI/CD: Securing AI-Generated Code in DevOps Pipelines
  • Zero Trust in CI/CD Pipelines: A Practical DevSecOps Implementation Guide

Trending

  • Fact-Checking LLM Outputs Programmatically: Building a Verification Layer That Catches Hallucinations
  • Stop Poisoning Your Models: How I Built a CV Dataset Quality Toolkit I Can Reuse Forever
  • When Angular APIs Return 200 but the Frontend Is Already Failing Users
  • Context Is the New Schema
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. Securing CI/CD Pipelines Against Supply Chain Attacks: Why Artifacts and Dependencies Matter More Than Ever

Securing CI/CD Pipelines Against Supply Chain Attacks: Why Artifacts and Dependencies Matter More Than Ever

This article explains how placing the right security controls turns CI/CD from an implicit trust engine into a verifiable delivery system.

By 
Ifeoma Eleweke user avatar
Ifeoma Eleweke
·
May. 07, 26 · Analysis
Likes (0)
Comment
Save
Tweet
Share
2.2K Views

Join the DZone community and get the full member experience.

Join For Free

In highly automated engineering environments, the modern CI/CD pipeline has become a critical trust boundary. Every commit, build, and deployment represents an implicit decision to trust. If that trust is compromised, the pipeline does not just fail; it faithfully delivers compromise at scale.

While a significant amount of security effort still centers on production defenses, the most effective attacks are increasingly targeting upstream, where artifacts are created and dependencies are resolved. And one of the most preventable (yet still common) entry points is also one of the earliest: secrets leaking into source control.

This article focuses on why artifacts and dependencies deserve first-class security treatment in CI/CD systems, and how security controls such as secret scanning, SAST, SCA, container scanning, artifact signing, and DAST must be deliberately mapped to pipeline stages, not bolted on as afterthoughts.

The Pipeline Is No Longer Just a Delivery Mechanism

CI/CD pipelines were originally designed to optimize speed and consistency. Security, when present, often arrived later as static checks or manual gates. That model no longer holds.

In a modern pipeline:

  • Developers rarely write software from scratch
  • Build systems assemble code from dozens or hundreds of external dependencies
  • Artifacts are reused, promoted, cached, and redeployed across environments
  • Trust decisions are automated, not reviewed

This means that any compromised dependency or artifact instantly inherits the pipeline’s trust. And any leaked secret can quietly become a permanent access path; that is, those leaked credentials become a shortcut around every security control you’ve built.

Attackers understand this well. Rather than breaching production directly, they aim upstream:

  • Injecting malicious code into dependencies
  • Subverting build outputs
  • Exploiting unsigned or mutable artifacts
  • Abusing implicit trust between pipeline stages
  • Harvesting exposed secrets to impersonate trusted systems

The result is not a single breach, but a systemic compromise.

Why Artifacts and Dependencies Are the New Chokepoints

Dependencies: Hidden Risk at Internet Scale

Modern applications depend on open-source libraries, base images, SDKs, and shared internal packages. These dependencies:

  • Are often pulled automatically
  • Change independently of application code
  • May introduce transitive risk several layers deep

A single compromised dependency can propagate across multiple services and teams. Without continuous dependency analysis, teams may not even know what they are running, let alone whether it can be trusted.

Artifacts: Trusted by Default, Verified by None

Artifacts like JARs, containers, binaries, Helm charts, etc., are the currency of CI/CD. Once built, they are assumed to be safe.

But consider how often artifacts are:

  • Rebuilt without verification
  • Pulled from shared repositories and promoted across environments without revalidation
  • Deployed without cryptographic integrity checks

If artifacts are not immutable, traceable, and verifiable, the pipeline becomes a delivery system for whatever code happens to be present at deploy time.

The Control Everyone Forgets: Secret Scanning 

Secret scanning is often treated as a repository or CI concern (scan after push). That’s useful, but it’s already late in the chain.

If a secret gets committed and pushed:

  • It may be mirrored, indexed, cached, or scraped
  • It may persist in commit history even after “removal.”
  • Rotation is now an incident response activity, not prevention

Where Secret Scanning Belongs

The highest-impact placement is local, before push:

  • pre-commit hook: blocks secrets from being committed
  • pre-push hook: blocks secrets from reaching the remote

Then you reinforce it with:

  • server-side scanning (repo platform hooks)
  • CI scanning (as a second line of defense)

The point isn’t “one scanner.” The point is layered prevention with the earliest possible stop point. A mature pipeline treats secrets as toxic waste: detect immediately, block automatically, and rotate aggressively when leaked.

Mapping Security Controls to the Pipeline 

Security controls are most effective when applied at the correct stage, with a clear purpose. The goal is not to scan everything everywhere, but to establish trust progressively.

Pipeline Security Controls Diagram


0. Developer Stage: Secret Scanning + Fast Feedback

Secret scanning (pre-commit / pre-push) prevents the most avoidable incident class: credential exposure. 

Pair it with lightweight, fast checks:

  • formatting/lint
  • quick static rules for obvious unsafe patterns

Effective teams implement:

  • Local scanning to block accidental leaks
  • Policy to reject secrets in history (not just in diffs)
  • Automated rotation workflows for when leaks occur

This keeps friction low while preventing high-impact mistakes.

1. Source/PR Stage: SAST + Early Feedback

Static Application Security Testing (SAST) belongs as close to code creation as possible.

Why?

  • Developers can fix issues while context is fresh
  • Findings relate directly to authored code
  • False positives can be triaged early

At this stage, SAST should:

  • Run automatically on pull requests
  • Focus on high-confidence issues
  • Be tuned to avoid pipeline noise

SAST is not about perfect security; it is more about preventing classes of defects from becoming part of the baseline.

2. Dependency Resolution Stage: SCA as a Gate, Not a Report

Software Composition Analysis (SCA) is critical at the moment dependencies are resolved.

This is where teams should:

  • Detect known vulnerabilities
  • Identify risky licenses
  • Track transitive dependencies

The key insight: SCA is not a dashboard exercise.

If vulnerable dependencies are allowed to pass unchecked, every downstream stage inherits that risk. Effective pipelines:

  • Enforce severity thresholds
  • Block known exploitable components
  • Require explicit justification for exceptions

SCA turns dependency management from a guessing game into a governed process.

3. Build Stage: Artifact Integrity and Signing

The build stage is where trust must become explicit.

Artifacts should be:

  • Built once
  • Stored immutably
  • Cryptographically signed

Artifact signing ensures that:

  • The artifact deployed is the artifact that was built
  • Any tampering is detectable
  • Trust can be verified independently of the pipeline

Build Stage Image 1

Build Stage Image 2


Without signing, pipelines rely on the environmental trust that had access, which system ran the build, what credentials were present, etc. Signing replaces those assumptions with cryptographic proof. It shifts “we think this is the build output” into “we can verify this is the build output”.

4. Image and Package Stage: Container Scanning

Container scanning is often misunderstood as a runtime control. In reality, it is build hygiene.

At this stage, scanning should:

  • Identify OS/application vulnerabilities
  • Detect outdated or abandoned packages
  • Flag high-risk base images

Image and Package Stage Image


Crucially, scanning should happen before images are promoted. Once an image becomes a “golden artifact,” its flaws become institutionalized.

5. Pre-Production: DAST as Behavioral Validation

Dynamic Application Security Testing (DAST) belongs where the application behaves like it will in production.

Unlike SAST or SCA, DAST:

  • Observes runtime behavior
  • Identifies authentication and authorization flaws
  • Detects misconfigurations not visible in code

DAST should not be expected to catch everything. Its role is to:

  • Validate assumptions
  • Confirm that defenses actually work
  • Catch systemic issues before exposure

DAST is validation, not a replacement for earlier controls.

Why These Controls Still Fail in Organizations

Many pipelines technically “have” security controls, but still fail in practice. Common reasons include:

  • Secrets are scanned only after push (too late)
  • Scans that run but do not block (informational scans)
  • Artifacts rebuilt instead of promoted (breaks traceability)
  • Unsigned images deployed via trusted registries because they’re “internal.”
  • Dependency alerts ignored due to volume

The missing element is often supply chain ownership.

Security works when teams:

  • Secrets are treated as highly sensitive, ephemeral, and continuously policed
  • Treat artifacts as security boundaries
  • Treat dependencies as external input, not internal code
  • Design pipelines that establish trust incrementally

Without this mindset, security tools become checkbox exercises.

The Real Goal: Verifiable Trust, Not Perfect Prevention

Supply chain attacks are not theoretical. They exploit automation, scale, and implicit trust, exactly what CI/CD pipelines provide.

The goal is not to eliminate all risk. It is to ensure that:

  • No credential leak can silently become a pipeline backdoor
  • Every artifact is traceable, immutable, and verifiable
  • Every dependency is accounted for
  • Every deployment can be verified

When artifacts and dependencies are treated as first-class security boundaries, pipelines stop being blind delivery systems and become controlled trust mechanisms. That shift from assumed trust to verifiable trust is the difference between “we ship fast” and “we ship safely.”

In today’s threat landscape, securing the pipeline is not optional. Securing artifacts and dependencies is foundational. And the teams that recognize this early will define what secure software delivery looks like for the next decade.

Contextual design Artifact (UML) Dependency Pipeline (software)

Opinions expressed by DZone contributors are their own.

Related

  • Reducing Deployment Time by 60% on GCP: A CI/CD Pipeline Redesign Case Study
  • The DevSecOps Paradox: Why Security Automation Is Both Solving and Creating Pipeline Vulnerabilities
  • Copilot, Code, and CI/CD: Securing AI-Generated Code in DevOps Pipelines
  • Zero Trust in CI/CD Pipelines: A Practical DevSecOps Implementation Guide

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook