Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Security engineeringMixed 21 series

Anatomy of an SBOM line

An SBOM is only useful if each line names one component exactly. Five fields do that, and each one fails in its own way.

Quick reference

Name, version, licence, hash, purl: one component, five facts.

text
lodash  |  4.17.21  |  MIT  |  sha256:9f3c  |  pkg:npm/lodash@4.17.21
PartNameWhat it tells you
lodashNameHow the registry spells it. Names collide across ecosystems.
4.17.21VersionThe exact version shipped, never a range and never latest.
MITLicenceThe declared licence. It is declared, so it can be wrong.
sha256:9f3cHashThe digest of the artefact. Without it the SBOM is a list of names.
pkg:npm/lodash@4.17.21PurlA package URL naming the same component in any tool.

In one line: A name is not a component. Version, licence and hash are what make the line useful.

Generate one:

syft dir:. -o spdx-json > sbom.json

Explained

Name

How the registry spells it. Names collide across ecosystems, so the name alone never identifies anything.

Version

4.17.21, never a range and never latest. An SBOM that lists a range cannot be matched against a CVE with any confidence.

Licence

MIT here. It is a declaration, which means it can be wrong, so a licence scan follows the SBOM rather than replacing it.

Hash

The sha256 of the artefact. Without the digest the SBOM is a list of names, and a rebuilt image with the same name and version differs silently.

Purl

pkg:npm/lodash@4.17.21 is a package URL that points at the same component in any tool, so two SBOMs can be compared line by line.

Add the supplier and the dependency edges and you have something a scanner can consume. Leave the hash out and you have a spreadsheet.

The honest caveat: a complete SBOM of a build you cannot reproduce tells you what you shipped once, not what you will ship next.

The lesson: five fields, one component, or the line is only a label.

Your turn: Which field does your SBOM generator drop first?

More notes: Security engineering

Open in the notes app: search, filters, copy This note on GitHub