SBOM generation and consumption: Syft, Grype and CycloneDX in CI

Latest Comments

No comments to show.
Abstract CI pipeline dashboard showing software dependency inventory, SBOM generation and vulnerability scanning workflow

Software bills of materials, or SBOMs, are becoming a practical control rather than a niche supply chain artefact. For a technical team, an SBOM is a machine-readable inventory of the components in a build, including direct and transitive dependencies, package versions, and in some cases the relationship between components. That makes it useful for vulnerability management, supplier assurance, incident response and release governance.

For UK SMEs, the value is usually operational before it is strategic. An SBOM helps you answer questions that otherwise take time and guesswork: what shipped, what changed, what is affected by a new CVE, and whether a supplier can evidence what is inside their software. If you already use secure development practices, this sits naturally alongside dependency scanning, build provenance and release approvals. It also complements broader software supply chain controls, as discussed in software supply chain assurance controls.

The important shift is from generating SBOMs once in a while to consuming them as part of the delivery pipeline. Generation gives you an artefact. Consumption turns that artefact into a control: scanning it, comparing it against policy, retaining it with the release record, and using it to drive remediation. That is where tools such as Syft, Grype and CycloneDX fit together.

Key takeaways

  • Generate SBOMs from the final release artefact, not just the source tree, so the inventory matches what is actually shipped.
  • Use CycloneDX as a portable interchange format when you need SBOMs to move cleanly between build, scan and governance tools.
  • Treat Grype as a consumer of SBOM data, then use severity, exploitability and asset context to prioritise remediation.
  • Store, version and, where appropriate, sign SBOMs alongside release artefacts so they remain useful for investigations and assurance.
  • Measure SBOM coverage, freshness and remediation lead time to confirm the process is improving release confidence rather than adding noise.

What an SBOM is and where it fits in the software supply chain

An SBOM is a structured list of software components and their metadata. In practice, that can include package names, versions, licences, hashes, relationships, and the source from which the component was derived. The exact fields depend on the format and the tool that produced it, but the core idea is the same: make the build transparent enough that another tool, team or supplier can reason about it.

Why SBOMs matter for engineering, security and procurement teams

Engineering teams use SBOMs to understand what is actually in a release, especially when a repository contains multiple services, language ecosystems or container layers. Security teams use them to map known vulnerabilities to deployed software without waiting for manual triage. Procurement and supplier assurance teams use them to ask for evidence that is more specific than a generic security statement.

That matters because dependency risk is often hidden. A package you did not add directly may still be present through a transitive dependency, and a container image may contain operating system packages that are not obvious from the application manifest. An SBOM does not remove that risk, but it makes it visible enough to manage. It also supports the kind of supplier scrutiny covered in verifying supplier compliance with secure software requirements.

What changes when you move from generating SBOMs to consuming them

Generation is a build step. Consumption is an operational process. If you only generate SBOMs, they can become another file in object storage. If you consume them, they become part of your vulnerability workflow, release gates and evidence trail.

That means you need to decide who reads the SBOM, what they do with it, and what happens when a scan finds a problem. In mature pipelines, the SBOM is generated automatically, stored with the build artefacts, scanned by one or more consumers, and linked to the release record. The output should be actionable, not just archived.

Syft, Grype and CycloneDX: how the tools fit together

Syft is used to generate SBOMs from source trees, container images and build outputs. Grype consumes SBOMs and identifies known vulnerabilities in the components listed. CycloneDX is one of the most common SBOM formats used to move data between tools. Together, they give you a practical generation and consumption flow.

Using Syft to generate an SBOM from source, container images and build outputs

Syft can inspect a directory, a container image, a tarball or other artefacts and produce an SBOM from what it finds. That flexibility matters because not every pipeline builds the same way. A monorepo may produce several services from one codebase. A containerised application may need the SBOM generated from the image rather than the repository, because the final runtime contents are what matter.

A common pattern is to generate the SBOM after the build has produced a versioned artefact, not before. That way, the SBOM reflects the exact release candidate. For example, if you build a container image, scan the image digest rather than the source tree. If you package a Python wheel or npm artefact, scan the packaged output rather than the working directory. This reduces drift between what was reviewed and what was shipped.

Syft can output multiple formats, but for CI use it is often best to standardise on one canonical format and one canonical location. That makes downstream automation simpler and avoids teams inventing their own naming conventions. If you already use container image signing, the SBOM should be treated as a sibling artefact to provenance and signature data, not as a replacement for them.

Using CycloneDX as a portable SBOM format for downstream tools

CycloneDX is widely used because it is designed for software composition analysis and supply chain workflows. It is compact enough for automation, expressive enough for component relationships, and supported by many scanners and governance tools. In a CI context, that portability is useful because the same SBOM can be passed between generation, scanning, storage and reporting stages.

For technical teams, the main advantage is interoperability. If one tool generates the SBOM and another consumes it, the format needs to survive that handoff without losing useful detail. CycloneDX is often a sensible default when you want a machine-readable artefact that can be reused by multiple tools. If your organisation already standardises on another format for a specific supplier or platform, that can still work, but the key is to avoid format sprawl.

Using Grype to consume SBOMs and identify known vulnerabilities

Grype is most useful when it is pointed at the artefact you actually intend to release. It can scan images directly, but it can also consume an SBOM, which is useful when you want to separate discovery from analysis. That separation helps with repeatability. You generate once, then scan the same SBOM with the same policy, even if the underlying registry or package index changes later.

In practice, this is useful for triage and auditability. If a vulnerability is reported later, you can re-run analysis against the stored SBOM and confirm whether the affected component was present in the release. That is much easier than reconstructing the build from scratch. It also supports more consistent vulnerability management, especially when paired with the remediation prioritisation approach described in using CVE and CWE data to prioritise remediation.

Choosing the right SBOM format for your pipeline

There is no universal answer, but there are sensible defaults. The best format is the one your downstream tools can consume reliably, your suppliers can exchange without friction, and your engineers can automate without special cases.

CycloneDX versus SPDX for CI use cases

CycloneDX and SPDX are both established SBOM formats. CycloneDX tends to be favoured when the primary use case is vulnerability management and software composition analysis. SPDX is often chosen when licence compliance and broader package metadata are central. For many CI pipelines, CycloneDX is the more practical choice because it maps cleanly to security tooling and release automation.

If your organisation already exchanges SPDX with customers or suppliers, there is no reason to abandon it. The important point is consistency. Pick one format for the pipeline unless you have a clear reason to support more than one. Dual-format generation can be useful, but it also increases storage, testing and maintenance overhead.

When JSON, XML or tag-value output is the better fit

For automation, JSON is usually the easiest format to work with. It is simple to parse in scripts, easy to store in object storage, and convenient for pipeline jobs that need to inspect fields or compare versions. XML can be useful where existing tooling expects it, or where a supplier workflow already uses XML-based exchange. Tag-value formats are generally less convenient for modern CI systems, but they may still appear in legacy environments.

In most SME environments, the practical answer is to standardise on JSON for internal pipelines and only convert when a partner or regulator requires a different representation. That keeps the build flow simple and reduces the chance of parsing errors.

What to standardise on for internal teams and suppliers

Standardisation should cover more than the file format. Define the naming convention, storage location, retention period, release linkage and minimum metadata. For example, decide whether every SBOM must include the build number, git commit, image digest, and timestamp. Decide whether the SBOM is stored in the artefact repository, the container registry, or both. Decide who can read it and who can modify it.

If you exchange SBOMs with suppliers, define the expected format in procurement or onboarding documentation. That avoids ambiguity later. It also makes it easier to compare supplier output against your own internal builds.

How to generate SBOMs in CI without creating noise

Good SBOM automation should be low-friction. If it creates too many false failures or slows every build, teams will work around it. The goal is to make generation routine, deterministic and tied to release artefacts.

Where to place SBOM generation in the build pipeline

The best point is usually after dependency resolution and build completion, but before publication. That gives you an SBOM for the exact artefact that is about to be released. For container images, generate after the image is built and tagged, then reference the immutable digest. For application packages, generate after packaging, not during compilation.

If you need to scan both source and output, do both, but keep the purposes separate. Source scanning can help developers spot issues early. Output scanning tells you what is actually shipped. In release governance, the latter is the artefact that matters most.

How to handle multi-language repositories and monorepos

Monorepos can produce several SBOMs, one per service or build target. That is usually better than trying to force everything into one file. A single repository may contain a Node.js frontend, a Python worker and a Go API, each with different dependency graphs and release cadences. Separate SBOMs make ownership clearer and reduce noise.

For multi-language projects, run Syft against the final artefact for each service, then store the output with a predictable naming scheme. For example, use service name, version and digest in the filename. If you need an aggregate view, build that in a later reporting step rather than trying to create one giant SBOM at generation time.

How to version, store and sign SBOM artefacts

Version the SBOM alongside the release artefact, not independently. A release should be traceable to the SBOM that describes it. Store the SBOM in immutable or at least append-only storage where possible, and keep it with the build metadata. If you already sign artefacts, consider signing the SBOM as well so that consumers can verify integrity before trusting it.

That is especially useful when SBOMs are exchanged outside the build system. A signed SBOM gives downstream teams more confidence that the file they are scanning is the one produced by your pipeline. It also supports stronger evidence handling when you need to show what was released at a given point in time.

How to consume SBOMs for vulnerability management

Once the SBOM exists, the next step is to turn it into a decision. That usually means scanning it, deduplicating findings, and prioritising what matters.

Feeding SBOMs into Grype and other scanners

Grype can consume SBOMs directly, which is useful when you want to decouple build generation from security analysis. A simple pattern is to generate the SBOM in one job, publish it as an artefact, and run the scanner in a separate job or stage. That separation makes the pipeline easier to reason about and easier to re-run.

Other tools can also consume SBOMs, including governance and reporting platforms. The main point is to avoid treating the SBOM as a dead-end file. If the data is already structured, use it to drive your vulnerability workflow rather than re-parsing package manifests from scratch.

Reducing false positives and duplicate findings

False positives often arise when the scanner sees a package that is present in the SBOM but not actually reachable in the deployed path, or when the same component appears in multiple layers or services. To reduce noise, align the scan scope with the release artefact, suppress findings only with documented justification, and review the scanner configuration regularly.

Duplicate findings are common in monorepos and container builds. A single vulnerable library may appear in several services, but not all instances carry the same risk. Use asset context, deployment exposure and ownership to avoid treating every instance as identical. This is where SBOM consumption becomes more useful than a simple package list.

Prioritising remediation using CVE severity, exploitability and asset context

Severity alone is not enough. A high-severity vulnerability in a non-exposed internal tool may be less urgent than a medium-severity issue in an internet-facing service with sensitive data. Prioritisation should combine CVE severity, exploitability, whether the component is reachable, and the business importance of the affected service.

For technical teams, a practical triage model is to classify findings by release exposure, internet exposure, known exploit availability, and whether a fix is already available. That gives you a more realistic queue than severity alone. It also helps when you need to explain remediation order to product owners or service managers.

Practical CI implementation patterns

There is no single correct pipeline design, but there are patterns that work well for smaller teams.

GitHub Actions example flow for generation and scanning

A straightforward pattern is: build, generate SBOM, upload artefact, scan SBOM, then publish or fail based on policy. In GitHub Actions, that can be implemented as separate jobs with artefact handoff. The generation job uses Syft to create a CycloneDX JSON file. The scan job downloads the artefact and runs Grype against it. If the scan fails policy, the workflow blocks release publication.

That separation is useful because it keeps the build deterministic. It also makes it easier to re-run the scan later without rebuilding the application. If you already harden your workflows against token abuse and untrusted pull requests, this fits neatly into the same control set as other pipeline protections.

Container image pipelines versus application package pipelines

Container pipelines should usually scan the image, not just the source repository. The image is the runtime artefact, and it may include base image packages, shell utilities and libraries that never appear in the application manifest. Application package pipelines should scan the packaged output, because that is what gets deployed or distributed.

If you have both, scan both. Source-level SBOMs are useful for developer feedback, but release-level SBOMs are the ones that matter for operational assurance. Keep the two outputs distinct so that teams do not confuse pre-build and post-build results.

Failing builds, warning only, or gating releases

Not every finding should fail every build. A sensible policy is to fail on newly introduced critical or high-severity issues in release branches, warn on lower-severity issues in feature branches, and allow exceptions only with explicit approval and expiry. That gives teams room to work while still protecting production releases.

For SMEs, the key is consistency. If the policy changes from one pipeline to another, developers will not know what to expect. Define the threshold once, document it, and make exceptions visible. That is more effective than trying to be strict everywhere and ending up with ignored alerts.

Managing dependency risk beyond direct packages

SBOMs are especially valuable because they expose transitive dependencies, but they do not solve every supply chain problem.

Transitive dependencies and hidden third-party risk

Many of the components that matter most are not the ones your team selected directly. They arrive through package managers, base images, build tools and nested libraries. An SBOM helps you see those dependencies, but you still need a process for deciding which ones are acceptable, which ones are pinned, and which ones require review.

That is why SBOMs should sit alongside dependency governance, not replace it. You still need version pinning, trusted registries, review of new packages, and a process for handling abandoned or vulnerable dependencies. The SBOM simply gives you better visibility into the problem.

How SBOMs support supplier assurance and asset inventory

From a supplier assurance perspective, an SBOM gives you evidence that is more precise than a questionnaire answer. It can help you compare what a supplier says they ship with what is actually present in the artefact. Internally, it can also improve asset inventory by showing which software components are in use across services and environments.

That makes SBOMs useful beyond security scanning. They can support change management, incident scoping and platform rationalisation. If you already maintain a software inventory, SBOMs can improve its accuracy and reduce manual reconciliation.

What SBOMs do not tell you on their own

An SBOM does not tell you whether code is secure, whether a component is configured safely, or whether a vulnerability is exploitable in your environment. It does not replace testing, code review, runtime monitoring or secure configuration. It is one input to a wider control set.

That is an important boundary. A clean SBOM does not mean a clean application. It only means the listed components did not match known vulnerability data at the time of scanning, or that the scanner did not flag anything relevant. You still need defence in depth.

Operational controls around SBOMs

Once SBOMs become part of your delivery process, they need the same operational discipline as other security artefacts.

Retention, access control and evidence handling

SBOMs can reveal useful internal detail about your software stack, so they should not be treated as public by default. Apply access control based on need to know, especially if the SBOM includes internal package names or build metadata. Retain them for a period that matches your release and investigation requirements, and keep them linked to the artefact they describe.

If you use SBOMs as evidence in assurance or incident response, preserve the original file, the scan output and the release record together. That makes later review much easier and reduces the risk of mismatched artefacts.

Keeping SBOMs current as dependencies change

SBOMs are snapshots. They become stale as soon as dependencies change, which means they should be regenerated on every relevant build. Do not rely on a previous release SBOM for a new build, even if the change looks small. Dependency updates, base image changes and lockfile drift can all alter the component list.

Automate regeneration and make it part of the standard pipeline. If the build changes, the SBOM should change with it. That keeps the artefact trustworthy.

Linking SBOM output to change management and release records

For technical teams, the most useful SBOMs are the ones that can be traced back to a specific change set and release approval. Link the SBOM to the commit hash, build number, artefact digest and deployment record. That creates a clean chain from code to release to vulnerability analysis.

This is especially useful when a vulnerability is disclosed after release. You can quickly identify which versions are affected, which environments are exposed, and whether a patch or rebuild is needed.

Common implementation pitfalls

Most SBOM programmes fail for ordinary reasons rather than technical ones. The usual problems are incomplete scope, too much noise and weak ownership.

Incomplete builds and missing runtime components

If you generate the SBOM too early, you may miss runtime packages, base image layers or post-build additions. That leaves you with a partial inventory that looks better than it is. Always generate from the artefact that is actually deployed or distributed.

Over-reliance on a single scanner

No scanner is perfect. Different tools have different package databases, matching logic and false positive behaviour. If the result matters, validate the output with more than one lens, especially for critical releases. At minimum, make sure your scanner configuration is tuned to your environment and reviewed regularly.

Treating SBOMs as a one-time compliance artefact

Perhaps the most common mistake is to generate an SBOM because a customer asked for one, then never use it again. That wastes the real value. The point is not to produce a document. The point is to create a reliable data source that improves release confidence, vulnerability management and supplier assurance over time.

How to measure whether your SBOM process is working

If you want the process to improve, measure it. A few practical metrics are enough to start with.

Coverage, freshness and scan quality metrics

Track the percentage of releases with a valid SBOM, the time between build completion and SBOM availability, and the proportion of releases scanned successfully without manual intervention. Also track how often the scanner finds components that were not expected. That can reveal build drift or packaging issues.

Remediation lead time and release impact

Measure how long it takes to remediate vulnerabilities discovered through SBOM scanning, and how often those findings block or delay a release. If the process is working, you should see faster triage and fewer surprises late in the release cycle.

Using findings to improve dependency governance

Over time, SBOM data should help you spot patterns. Repeatedly vulnerable packages, outdated base images, and recurring transitive dependencies all point to governance issues. Use those patterns to improve dependency approval, version pinning and supplier requirements.

That is where the control becomes strategic. The SBOM is not just a scan input. It is evidence that can improve how your team makes software decisions.

For teams that want help turning this into a repeatable control, or aligning it with broader secure development and assurance work, speak to a consultant.

Frequently asked questions

Do I need both Syft and Grype in the same pipeline?

Not necessarily in the same job, but they work well together. Syft generates the SBOM, then Grype consumes that SBOM to identify known vulnerabilities. Separating the two steps usually makes the pipeline easier to test, store and re-run.

Can CycloneDX be used for both generation and consumption?

Yes. CycloneDX is a format, not a scanner. You can generate a CycloneDX SBOM with Syft and then consume that file with Grype or other tools that understand the format. That makes it a practical choice for CI workflows.

Tags:

Comments are closed