How to secure the software supply chain


Secure the software supply chain by establishing trust at the source, inventorying and evaluating dependencies, hardening the build pipeline, protecting and signing artifacts, and verifying them before deployment.

Why software supply chain security matters

Software is assembled from source code, open source packages, build tools, CI/CD configuration, containers, plugins, and deployment infrastructure. A weakness in any link can affect the integrity, confidentiality, or availability of the software that follows.

A supply chain security program makes that chain visible and verifiable. It helps teams answer practical questions:

  • What code and dependencies went into this release?
  • Which versions and transitive packages were used?
  • Which pipeline, runner, identity, and inputs produced the artifact?
  • Was the artifact changed after it was built?
  • Should this artifact be allowed into the next environment?

This is the security operating model behind DevSecOps: put security checks and evidence into the development and delivery workflow, while keeping human review and accountable decisions in place.

Security is not the same as compliance. A software bill of materials (SBOM), scan, signature, or provenance statement can support a control framework, but a team must map its own requirements to controls, configure them appropriately, retain evidence, and validate its obligations.

Common software supply chain attack patterns

Defend against the attack paths most likely to break trust between source, build, artifact, and deployment.

Attack patternWhat the attacker tries to doDefensive practices
Dependency confusionCause a build to select a malicious public package with the same name as an intended private dependency, by giving it a higher version number or exploiting registry resolution order.Use explicit package source configuration, trusted registries, dependency allowlists, lockfiles, review of new packages, and scanning of direct and transitive dependencies.
TyposquattingPublish a package whose name resembles a legitimate dependency and rely on a spelling mistake or hurried installation.Review package names and maintainers, pin versions, verify provenance where available, restrict registries, and monitor newly introduced dependencies.
CI/CD or pipeline compromiseAlter pipeline configuration, inject commands, expose credentials, abuse runners, or replace an artifact during the build.Protect pipeline configuration, minimize token and variable exposure, isolate runners where needed, review changes, restrict who can run or approve sensitive jobs, and record build provenance.
Maintainer or upstream takeoverCompromise a trusted project, maintainer account, release process, or update channel.Use multi-person review for sensitive changes, monitor dependency updates, verify release provenance and signatures, and maintain a response path for revocation or rollback.
Build or artifact tamperingModify a build input or output after review so the deployed artifact differs from the one that was tested.Generate traceable build metadata, hash and sign artifacts, verify signatures and attestations at promotion or deployment, and limit write access to artifact stores.

No control eliminates all risk. Controls should be layered so that a missed package review does not also mean an unreviewed pipeline change, an unverifiable artifact, and an unrestricted deployment.

A source-to-deploy security workflow

Use the following workflow to make each transition in the supply chain explicit.

1. Establish trusted sources and change control

Start with the repositories, branches, package sources, base images, build tools, and deployment definitions that your teams rely on. Define who can change them and what review is required.

At minimum:

  • Protect the branches and tags used for releases
  • Require review for application code, dependency files, container definitions, and CI/CD configuration
  • Prefer pinned or otherwise controlled versions for build tools, actions, images, and dependencies
  • Separate routine development permissions from release and production permissions
  • Document exceptions and give them an owner and an expiration date

The exact controls depend on your repository model, package ecosystems, release process, and risk tolerance. The objective is to reduce unreviewed changes before they enter the build.

2. Create an SBOM and control dependencies

An SBOM is an inventory of the components in a software artifact. Use it to establish a baseline, identify direct and transitive dependencies, and support response when a new vulnerability or malicious package is discovered.

Use a format that fits the systems that consume the inventory. SPDX and CycloneDX are widely used SBOM formats; choose one or both based on your ecosystem, tooling, and exchange requirements. Use CISA SBOM guidance as a companion reference for defining the information and operating practices your organization needs.

GitLab dependency scanning can detect project dependencies and report them in CycloneDX SBOM reports in CI/CD pipelines. You can also scan SBOM components against the GitLab advisory database and continuously rescan when new advisories are published. Configure the supported lockfiles, dependency graphs, or manifest inputs for each ecosystem rather than assuming that one file covers every dependency.

An SBOM is an inventory, not a verdict. Pair it with vulnerability analysis, package source controls, maintainer and release review, license review where relevant, and a defined process for prioritizing and remediating findings.

3. Harden the CI/CD build

Treat the pipeline as production infrastructure. A compromised pipeline can turn a reviewed source change into an untrusted artifact, even when the application code itself looks safe.

Harden the build by:

  • Limiting who can modify pipeline configuration and who can approve production-facing jobs
  • Using least-privilege identities, short-lived credentials, and a dedicated secrets-management approach where possible
  • Preventing untrusted code or forked changes from accessing sensitive variables and deployment credentials
  • Pinning or controlling versions of reusable pipeline components, build images, plugins, and tools
  • Separating build, test, signing, and deployment permissions when the risk justifies it
  • Keeping runner images and runner hosts maintained, monitored, and isolated according to the sensitivity of the workload
  • Recording enough inputs and metadata to reproduce or investigate a build

GitLab's pipeline security guidance frames pipeline integrity around reproducibility, auditability, and version control. Use those principles to decide which inputs, approvals, identities, and outputs your organization must retain as evidence.

4. Protect, attest, and sign artifacts

Build outputs should carry enough evidence for a verifier to understand what was built, how it was built, and whether the output is the one that passed the required checks.

For each releasable artifact, consider recording:

  • A content digest and artifact identity
  • The source revision and repository reference
  • The build definition, toolchain, and relevant inputs
  • The builder identity, runner or platform context, and build time
  • The checks that ran and their result
  • The signature or attestation needed by the next environment

Provenance describes the origin and construction of an artifact. A signature helps a verifier establish that an authorized identity signed a particular artifact or statement. They are related but not interchangeable: a signed statement is only useful when the verifier understands the identity, claims, trust policy, and artifact it covers.

GitLab documents using Sigstore and Cosign for keyless signing and verification of container images and build artifacts in GitLab CI/CD. Keyless signing can use short-lived credentials and an identity from the pipeline, but it still requires deliberate trust configuration and verification at the point of use.

5. Verify before promotion and deployment

Move from generating evidence to enforcing a decision. Before an artifact is promoted or deployed, verify that it is the expected artifact, came from an allowed source, passed the required checks, and has acceptable vulnerability and policy status.

A deployment gate might evaluate:

  • Signature and provenance validity
  • Builder, repository, branch, tag, or workflow identity
  • Required review or approval state
  • SBOM presence and component policy
  • Vulnerability severity, exploitability, and exception status
  • Artifact digest and registry location
  • Environment-specific requirements such as separation of duties

Do not treat a green scan as proof that an artifact is safe. Scanners have coverage boundaries, vulnerability databases change, and risk decisions require context. Keep a documented exception process and re-evaluate exceptions as the software and threat environment change.

SLSA, Sigstore, provenance, and in-toto: How they fit together

These technologies address different questions in the chain.

ConceptPrimary questionHow to use it
SLSAHow strong are the guarantees around how an artifact was produced?Use SLSA guidance to define progressively stronger expectations for build integrity, provenance, and protection against tampering.
ProvenanceWhat source, builder, inputs, and process produced this artifact?Generate machine-readable build metadata and make it available to the systems that verify or promote artifacts.
SigstoreHow can an artifact or statement be signed without relying on long-lived private-key management?Use an appropriate Sigstore workflow, such as Cosign, then verify the signature and identity claims before use.
in-totoHow can a supply chain describe and verify a set of signed steps or attestations?Use in-toto concepts when you need link metadata, attestations, or a policy that evaluates multiple steps in a chain.

SLSA is a set of incrementally adoptable supply chain security guidelines. Confirm the runner, artifact, configuration, and product-availability details that apply to your deployment before treating that capability as an organizational control.

A practical adoption order is:

  • Generate provenance for a representative build
  • Make the provenance available beside the artifact and protect its association with the artifact digest
  • Sign the provenance or artifact with a verifiable identity
  • Verify the signature, builder, source, and policy before promotion
  • Increase the required SLSA level or attestation coverage as the process becomes repeatable

Supply chain security when agents build software

AI agents add inputs to the supply chain: the tools they call, the packages they install, and the code they write. Run agent work in an isolated environment, pull dependencies through a controlled source, and verify the artifact digest and provenance before deployment. The Isolate and Release stages of the GitLab Security Standard describe these controls for agent-driven delivery.

Control-to-tool map

Use this table as a starting point for design discussions, not as a claim that a product configuration automatically satisfies a standard or regulatory requirement.

Security controlGitLab capability to evaluateNeutral reference or design lens
Inventory components and dependenciesDependency scanning with CycloneDX SBOM reports; supported lockfile, dependency graph, or manifest inputsSPDX, CycloneDX, and CISA SBOM guidance
Identify known dependency vulnerabilitiesDependency scanning and advisory matching; continuous rescanning where configured and availableVulnerability-management process, risk-based prioritization, and remediation SLAs
Protect pipeline inputs and secretsPipeline security controls, protected configuration, least-privilege identities, and secrets-management integrationsSLSA build requirements; secure CI/CD architecture
Make builds traceableCI/CD metadata and runner-generated artifact provenance capabilitiesSLSA provenance; in-toto attestations
Sign artifacts or attestationsGitLab CI/CD integration with Sigstore and Cosign for keyless signing and verificationSigstore trust model; certificate and transparency-log verification
Verify before deploymentPolicy and deployment-gate logic that checks artifact identity, provenance, signatures, vulnerabilities, and approvalsSLSA verification; in-toto policy evaluation; environment separation
Respond to newly disclosed riskUpdated advisory data, rescanning, ownership, exception expiry, and incident-response playbooksVulnerability response and software recall or rollback procedures

The right implementation depends on your languages, package managers, runner model, artifact types, deployment platforms, and risk profile. Validate support and tier requirements for the GitLab edition and version you operate.

Benefits and trade-offs

A mature approach to software supply chain security can improve visibility, make release decisions more repeatable, and reduce the time needed to investigate what changed. It can also create friction if teams introduce controls without defining ownership, exceptions, and developer-friendly workflows.

Plan for these trade-offs:

  • More evidence can mean more storage, retention, and access-control requirements.
  • Stronger pinning and verification can slow dependency updates unless update automation and exception paths are clear.
  • Isolated or ephemeral runners can reduce blast radius but may increase infrastructure and maintenance work.
  • Deployment gates can prevent risky releases but need accurate policy, escalation, and rollback paths.
  • A single organization-wide threshold may be too blunt for different applications, environments, and threat models.

Measure coverage and decision quality, not just the number of scans. Useful measures include the percentage of production artifacts with an SBOM, the percentage with verified provenance, time to remediate high-priority dependency risk, the age of open exceptions, and the percentage of deployments that passed the intended verification policy.

A 30/90/180-day implementation roadmap

First 30 days: Establish visibility and ownership

  • Inventory production applications, repositories, package sources, build pipelines, runners, registries, and deployment environments.
  • Generate an initial SBOM for representative applications and identify unsupported ecosystems or missing inputs.
  • Identify direct and transitive dependency risk, including private package sources and base images.
  • Protect release branches, tags, pipeline configuration, and sensitive variables.
  • Define owners for dependencies, pipeline security, artifact integrity, and deployment policy.
  • Document the highest-risk attack paths and create an exception process with expiration dates.

By 90 days: Enforce repeatable controls

  • Expand SBOM and dependency scanning coverage to the applications that matter most.
  • Add review and policy checks for new dependencies, package sources, vulnerable components, and risky pipeline changes.
  • Record source revision, build inputs, artifact digest, and builder identity for release artifacts.
  • Pilot provenance generation and Sigstore or equivalent signing for one artifact class.
  • Verify signatures and provenance in a non-production environment before promotion.
  • Establish vulnerability ownership, remediation targets, and an escalation path for exploited or malicious dependencies.

By 180 days: Verify and continuously improve

  • Require SBOM, provenance, and signature verification for defined production release paths.
  • Extend verification to containers, packages, infrastructure artifacts, and other deployable outputs as appropriate.
  • Use continuous rescanning or advisory monitoring to reassess deployed and releasable components.
  • Reduce runner and credential blast radius with isolation, short-lived identities, and separated build or signing permissions.
  • Exercise a supply chain incident scenario, including dependency removal, credential rotation, artifact revocation, rollback, and stakeholder communication.
  • Review exception age, control coverage, false positives, developer friction, and evidence quality; adjust policies based on findings.

Start with a verifiable path to production

Software supply chain security works best when it is part of the path your teams already use to build and release software. Begin with an inventory and SBOM, harden the pipeline, generate provenance, sign what you release, and verify the evidence before deployment. Then expand coverage as the organization learns where stronger controls reduce risk without creating unmanageable delivery friction.

Explore GitLab software supply chain security to see how dependency scanning, pipeline policies, and signing work together. Confirm capabilities and tier fit for your environment before you implement.

Frequently Asked Questions

Start building faster today

See what your team can do with the intelligent orchestration platform for DevSecOps.