DEV Community

Clear Path Security Ltd
Clear Path Security Ltd

Posted on Originally published at clearpathsecurity.co.uk

Enforcing SBOM requirements in CI/CD pipelines

Originally published on the ClearPath Security site: https://clearpathsecurity.co.uk/enforcing-sbom-requirements-in-ci-cd-pipelines/

Software bills of materials, or SBOMs, are only useful if they are produced consistently and trusted by the teams that consume them. For technical teams, the real challenge is not whether to generate an SBOM, but how to make it a reliable control inside the delivery pipeline. That means defining what good looks like, checking it automatically, and deciding when a build should stop, continue with a warning, or require manual approval.

For UK SMEs, this is usually a pragmatic engineering problem rather than a large governance exercise. You want enough control to improve dependency visibility, support vulnerability response, and give customers or suppliers confidence in what you ship, without turning every release into a paperwork task. If you already have controls around secure software supply chain assurance, this article shows how to operationalise the SBOM part of that work in CI/CD. If you need a broader view of the control set, our article on implementing software supply chain assurance controls is a useful companion.

Key takeaways

  • Enforce SBOMs as a pipeline control, not a manual afterthought, so every releasable artefact has a validated inventory.
  • Generate the SBOM from the final build output, then validate, sign and publish it alongside the artefact.
  • Use clear policy rules for blocking failures, warnings and temporary exceptions so teams know exactly what will stop a release.
  • Standardise on a small set of SBOM formats and reusable CI templates to avoid drift across services.
  • Use SBOM data to speed up vulnerability triage and support supplier assurance, but do not treat it as a compliance guarantee.

What enforcing SBOM requirements actually means in a delivery pipeline

Enforcement does not simply mean running a tool that emits a JSON file. It means the pipeline checks that an SBOM exists, that it matches a defined format, that it covers the artefact being built, and that it is stored or attached in a way that downstream teams can actually use. In practice, enforcement usually spans three stages: pre-build, build-time, and post-build.

Where SBOM checks fit in the build, test and release stages

At pre-build stage, the pipeline can verify that dependency manifests and lockfiles are present and current. This is where you catch missing package metadata, unpinned dependencies, or a build that is not reproducible enough to support a trustworthy SBOM. During the build, the pipeline generates the SBOM from the exact artefact that is being produced, not from a source tree snapshot that may drift from the final output. After the build, the pipeline validates the SBOM, signs it if required, and publishes it alongside the artefact or container image.

The key point is that the SBOM should describe the thing you are releasing, not an approximation of it. That matters because container images, compiled binaries, and bundled front-end assets can all differ from the raw source repository. If your pipeline only scans source dependencies, you may miss packaged libraries, vendored code, or operating system packages included in the final image.

What to enforce: generation, validation, signing and publication

A practical enforcement model usually has four checks. First, generation: the pipeline must create an SBOM for every releasable artefact. Second, validation: the SBOM must conform to the chosen schema and contain the expected fields. Third, signing: the SBOM should be integrity-protected so it cannot be swapped after the build. Fourth, publication: the SBOM must be stored where release, security, and support teams can retrieve it later.

That last step is often overlooked. An SBOM that lives only in a transient build workspace is not operationally useful. If you cannot retrieve it when a vulnerability lands, or when a customer asks what is in a release, then the control has not really been implemented.

Why SBOM enforcement matters for software supply chain risk

SBOMs are most valuable when they improve decision-making. They help you see what is inside a release, including transitive dependencies, which are packages pulled in by other packages. That visibility is important because many software risks sit several layers deep in the dependency tree, where teams do not normally look.

Dependency visibility, transitive risk and release confidence

Without enforcement, SBOM generation is often inconsistent. One team publishes a CycloneDX document, another exports SPDX, and a third forgets to include it at all. That inconsistency makes it hard to compare releases, automate checks, or answer supplier questions. A pipeline gate creates a baseline: every release follows the same rules, and every artefact has a machine-readable inventory.

This also improves release confidence. If the SBOM is generated from the final build output and validated automatically, you have a stronger basis for saying that the artefact was built from known components. That does not eliminate risk, but it reduces uncertainty. For teams already thinking about provenance and build integrity, this sits naturally alongside approaches such as SLSA and signed artefacts.

How SBOM controls support vulnerability response and supplier assurance

When a new vulnerability is disclosed, the first question is often whether you are affected. An SBOM lets you answer that faster by matching the affected component against the contents of your shipped artefacts. That can shorten triage time and reduce unnecessary patching. It also helps with supplier assurance, because you can show customers or partners that you have a repeatable process for identifying what is in your software.

For organisations that supply into regulated or security-conscious environments, this is increasingly relevant. It supports conversations about secure development expectations, and it can complement supplier checks described in our article on verifying supplier compliance with secure software requirements. It is not a guarantee of compliance, but it is a strong operational control.

Define the policy before you automate the gate

Before you add a pipeline job, define the policy it will enforce. If the policy is vague, the automation will be inconsistent. The policy should state what artefacts need SBOMs, which formats are accepted, what minimum metadata is required, and which failures are blocking versus advisory.

Minimum fields, accepted formats and versioning expectations

At a minimum, define the fields you need for downstream use. That usually includes the artefact name, version, supplier or publisher, component list, package identifiers, and build or release reference. If you use container images, include the image digest and the package manager or base image details where possible. If you use multiple languages or build systems, define how each one maps into the SBOM schema.

Choose one or two accepted formats and standardise on them. CycloneDX and SPDX are the most common choices. CycloneDX is often easier for application security workflows, while SPDX is widely used for software licensing and supply chain use cases. The important thing is consistency. If you accept multiple formats, document which one is authoritative and how conversion is handled.

Versioning matters too. The SBOM should be tied to a specific build, not a moving branch or a generic release label. If you rebuild the same source later, the SBOM should either be identical or explain the differences clearly. That is especially important where build timestamps, package mirrors, or base image updates can change the output.

Deciding what should block a build versus trigger a warning

Not every SBOM issue needs to fail the pipeline. Missing SBOM generation for a production release should usually be a hard fail. A malformed document, schema mismatch, or missing required field should also block release. By contrast, a warning may be enough if the SBOM is complete but includes a package with incomplete upstream metadata, provided you have a documented exception path.

The policy should distinguish between technical failure and risk acceptance. For example, a temporary exception for a legacy component may be acceptable if it is time-bound, approved, and tracked. What you want to avoid is a pipeline that silently ignores problems because the team has become used to bypassing the gate.

Designing the CI/CD control points

Good SBOM enforcement is usually layered. You do not want a single late-stage check that fails after a long build has already consumed time and compute. Instead, use control points that catch issues early and confirm the final artefact before release.

Pre-build checks for dependency metadata and lockfiles

Start by checking that the repository contains the dependency files you expect. For Node.js, that may mean package-lock.json or pnpm-lock.yaml. For Python, it may mean requirements.txt, poetry.lock, or a pinned dependency manifest. For Go, you may want to verify go.sum and module versions. For Java, that may mean a lockfile or a resolved dependency report from Maven or Gradle.

These checks are not the SBOM itself, but they are important because they reduce ambiguity. If dependencies are not pinned, the build may resolve different versions on different days, which undermines reproducibility. A simple script can fail the build if the lockfile is missing, stale, or not committed. That is a useful precondition for reliable SBOM generation.

Build-time SBOM generation and post-build verification

Generate the SBOM from the built artefact, not just the source repository. For container images, that usually means running the SBOM tool against the image digest or exported filesystem. For binaries, it may mean scanning the packaged release directory. For multi-stage builds, ensure the final image is the one being analysed, not an intermediate layer.

After generation, validate the SBOM against the schema and compare it to the artefact metadata. Check that the package count is plausible, that the version matches the release tag, and that the file is not empty or truncated. If you sign artefacts, verify that the SBOM is linked to the same build identity or provenance record. This is where controls around provenance and signing become useful, because they help you prove that the SBOM belongs to the artefact you are shipping.

Tooling patterns for SBOM generation and validation

There is no single correct toolchain. The right choice depends on your build platform, language mix, and release process. The main requirement is that the tool can run non-interactively in CI, produce a machine-readable output, and be integrated into your release gates.

Using Syft, CycloneDX or SPDX in a pipeline

Syft is a common choice for generating SBOMs from container images, directories, and archives. It can output CycloneDX or SPDX, which makes it flexible for different downstream consumers. A typical pattern in a container pipeline is to build the image, tag it with the commit SHA, and then generate the SBOM from that exact image reference.

For example, a pipeline step might look like this:

syft packages oci:registry.example.com/app:${GIT_SHA} -o cyclonedx-json > sbom.cdx.json
Enter fullscreen mode Exit fullscreen mode

That is only the generation step. You should then validate the file, store it as a build artefact, and attach it to the release record. If your organisation prefers SPDX, use the same pattern but keep the output format consistent across services.

Validating SBOM completeness, schema and package coverage

Validation should cover more than JSON syntax. Check the schema, required fields, and whether the SBOM covers the expected package types. For example, if your application bundles operating system packages in a container image, the SBOM should include them. If it does not, the build should fail or at least raise a high-priority warning.

Many teams also add a coverage check. That means comparing the SBOM against the package manager output, the image contents, or a dependency manifest to confirm that the major components are represented. This is especially useful in polyglot repositories where one scanner may miss a language ecosystem or a vendored directory. The goal is not perfect completeness in theory, but dependable coverage in practice.

How to fail a pipeline safely when SBOM requirements are not met

Pipeline failure should be predictable and informative. If a build fails because the SBOM is missing, the developer should know exactly why and what to fix. A good failure message is part of the control, because it reduces the temptation to bypass the gate.

Hard fails for missing or malformed SBOMs

Use hard fails for conditions that make the SBOM unusable. That includes no SBOM file, invalid schema, missing artefact linkage, or a mismatch between the SBOM and the release version. These are not minor issues. They mean the release cannot be trusted to carry the required inventory.

Hard fails should be reserved for conditions that matter. If every small inconsistency blocks the pipeline, teams will start looking for ways around the control. Keep the rules strict but sensible. The objective is to stop unsafe releases, not to create friction for its own sake.

Soft fails, exceptions and manual approval paths

Some situations need a softer path. A legacy service may not yet support full SBOM generation, or a third-party build step may produce incomplete metadata. In those cases, create a manual approval workflow with a time limit, named owner, and remediation plan. The exception should be visible in the pipeline logs and in whatever risk register or ticketing system you use.

Do not let exceptions become permanent by accident. If you need a manual approval path, make it explicit that it is temporary and reviewed regularly. This is one of the easiest ways to keep the control practical without normalising weak practice.

Signing, storing and distributing SBOMs

An SBOM is only as trustworthy as its handling after generation. If it can be altered, detached from the artefact, or lost after release, then its value drops quickly. That is why signing and storage are part of enforcement, not optional extras.

Attaching SBOMs to build artefacts and container images

Where possible, attach the SBOM to the artefact itself or store it in the same release bundle. For container images, many teams store the SBOM in the registry as an attached artefact or alongside the image digest. For packaged software, include it in the release archive and in the internal artefact repository. The important thing is that the SBOM is easy to retrieve by release identifier.

If you already use release manifests, include a pointer to the SBOM location. That makes it easier for support, security, and procurement teams to find the right file without searching through build logs.

Using provenance and signatures to reduce tampering risk

Signing the SBOM helps prove that it has not been changed since the build. If you also sign the artefact and record provenance, you can link the SBOM to the exact build process that produced it. That reduces the risk of tampering and makes later verification much simpler. It also supports stronger release governance, because you can show that the inventory and the artefact came from the same controlled pipeline.

This is particularly useful if you are already working with signed container images or provenance records. The SBOM then becomes part of a broader trust chain rather than a standalone document.

Handling third-party dependencies and transitive packages

Third-party and transitive dependencies are where SBOM work often becomes messy. Some upstream packages have incomplete metadata, some private packages are mirrored internally, and some repositories vendor code directly into the tree. Your policy needs to account for those realities.

What to do when upstream metadata is incomplete

If upstream metadata is incomplete, do not ignore it. Record the gap, decide whether it blocks release, and document the reason if you accept it. In some cases, you may need to enrich the SBOM with internal metadata or map the package to a known internal identifier. The key is traceability. You should be able to explain what the component is, where it came from, and why it was accepted.

For high-risk components, incomplete metadata may justify a release hold until the issue is resolved. For lower-risk components, a warning and follow-up task may be enough. The decision should be based on business impact and exposure, not on convenience.

How to treat private packages, vendored code and monorepos

Private packages should be treated as first-class components in the SBOM, with internal source and version references. Vendored code should not disappear just because it is copied into the repository. If you ship it, it belongs in the inventory. In monorepos, define the boundary of each releasable artefact so the SBOM reflects the actual package or service being delivered.

That boundary definition matters because a monorepo can contain many services, libraries, and build outputs. If you do not define the release unit clearly, your SBOMs will be noisy or incomplete. This is one reason why teams often pair SBOM enforcement with a clear software release model and dependency ownership structure.

Using SBOMs to support vulnerability management

Once SBOMs are enforced in the pipeline, they become useful operational data. They can feed vulnerability management, incident response, and supplier conversations. The value comes from using them, not just producing them.

Matching SBOM contents to CVE intelligence and advisories

When a new vulnerability is announced, compare the affected package names and versions against your SBOM inventory. This can be automated in the pipeline or in a separate security workflow. If the affected component appears in a release artefact, you know which services need review. If it does not, you can often rule out impact more quickly.

This is where SBOMs and vulnerability data work well together. The SBOM tells you what you shipped, and the advisory tells you what is affected. Together they reduce guesswork. For teams already using software composition analysis, the SBOM can improve precision and help distinguish direct from transitive exposure.

Prioritising remediation when affected components appear in release artefacts

Not every affected component should trigger the same response. Prioritise based on whether the vulnerable package is reachable, whether it is in a runtime path, and whether there is an exposed service boundary. A package in a test-only path is different from one in a production API. The SBOM helps you identify presence, but you still need engineering judgement to assess exploitability and business impact.

That distinction is important for SMEs with limited engineering capacity. The goal is to focus effort where it matters most, not to create a long list of theoretical issues that never get fixed.

Operationalising SBOM enforcement in GitHub Actions, GitLab CI or Azure DevOps

Most teams can implement SBOM enforcement with standard CI features. The pattern is the same across platforms: run the generator, validate the output, publish the file, and fail the job if the policy is not met.

Reusable pipeline jobs and policy-as-code approaches

Use a reusable job or template so every service inherits the same control. In GitHub Actions, that may mean a composite action or reusable workflow. In GitLab CI, it may mean an included template. In Azure DevOps, it may mean a shared YAML template. The point is to avoid hand-crafted pipeline logic in every repository.

Where possible, encode the policy as code. That makes reviews easier and reduces drift between teams. A policy-as-code approach can check for required artefacts, expected formats, and release conditions before the job completes. It also makes it easier to audit changes to the enforcement logic over time.

Secrets, permissions and runner hardening considerations

SBOM jobs often need access to registries, artefact stores, or signing keys. Keep permissions narrow. Use short-lived credentials where possible, and avoid giving the job more access than it needs. If the pipeline signs SBOMs or publishes them to a protected repository, isolate those steps and protect the runner environment accordingly.

Runner hardening matters because a compromised pipeline can tamper with artefacts, SBOMs, or provenance records. Keep build runners patched, restrict outbound network access where practical, and separate trusted release jobs from untrusted pull request jobs. If your team is already hardening CI against token theft and untrusted contributions, SBOM enforcement should sit inside that same design.

Common implementation mistakes to avoid

The most common mistake is treating SBOM generation as a one-off compliance task. If the process is not part of every release, the inventory quickly becomes stale. Another mistake is allowing manual uploads without validation. That creates a gap between what the pipeline built and what the organisation thinks it shipped.

Inconsistent formats are another problem. If one service emits CycloneDX JSON, another emits SPDX tag-value, and a third stores a PDF export, automation becomes brittle. Standardise early. Also avoid unchecked exceptions. If teams can bypass the gate too easily, the control will lose credibility.

Finally, do not assume that generating an SBOM automatically means it is accurate. Validate it against the artefact and review the output for obvious gaps. The control should be lightweight, but it still needs engineering oversight.

A practical rollout plan for SMEs

For most SMEs, the best approach is incremental. Start with one critical application and one release path. Pick a service that is representative, but not so business-critical that a few early failures would cause major disruption. Define the policy, implement generation and validation, and make sure the release team understands the failure modes.

Once that works, extend the pattern to other services. Reuse the same templates, the same accepted formats, and the same exception process. If you have multiple delivery teams, publish a short internal standard so everyone knows what is required and why. That standard should cover artefact scope, SBOM format, validation rules, storage location, and exception handling.

As the control matures, connect the SBOM output to vulnerability management and supplier assurance workflows. That is where the real value appears. You stop treating the SBOM as a document and start using it as operational evidence. If you are aligning software controls with broader governance or ISO 27001 work, this is also a sensible point to review how the pipeline evidence fits into your ISMS records and supplier assurance process. For organisations that want help designing that operating model, speak to a consultant.

In practice, the best SBOM programme is the one your engineers can run repeatedly without special effort. Keep the policy clear, keep the tooling consistent, and keep the exceptions visible. That is usually enough to turn SBOMs from a nice-to-have into a dependable part of secure software delivery.

Frequently asked questions

Do SBOM checks need to block every release?

No. Missing, malformed or unlinked SBOMs should usually block production releases, but lower-risk issues such as incomplete upstream metadata can be handled with warnings or time-bound exceptions if you have a documented approval path.

How do you enforce SBOM requirements without slowing delivery teams?

Use reusable pipeline templates, generate the SBOM automatically from the final artefact, and keep the policy narrow and predictable. The goal is to fail only on conditions that make the SBOM unusable, not on every minor inconsistency.

Top comments (0)