What is the difference between an SBOM from source and an SBOM from a container image?
IntermediateConceptSBOM
Answer
Short answer
A source SBOM is built from the repository's manifests and lockfiles — it lists the app's declared dependencies. An image SBOM is built from the final container image — it includes the app's dependencies plus OS packages and anything added during the build. The image SBOM reflects what actually ships; the source SBOM is available earlier.
Comparison
| Source SBOM | Image SBOM | |
|---|---|---|
| Command | syft dir:. / trivy fs --format cyclonedx . |
syft shop-api:1.4.0 / trivy image --format cyclonedx |
| Includes OS packages | ❌ | ✅ |
| Includes build-time-only deps | Possibly (devDependencies) | Only what's in the image |
| Available | Before build | After build |
| Best for | Early PR checks, licence review | Release record, runtime vulnerability tracking |
Common practice
Generate the image SBOM as the official record for each release (and attest it to the image); use source scanning for fast PR feedback.
What to say in the interview
"Source SBOMs come from lockfiles and are available early; image SBOMs come from the built image and include OS packages and only what actually ships. The image SBOM is our release record, attested to the image digest."
More on SBOM
What is an SBOM and how do you generate one?BeginnerWhat is an SBOM and why does it matter?BeginnerWhat are SPDX and CycloneDX?BeginnerHow do you generate an SBOM with Syft?BeginnerHow do you scan an SBOM for vulnerabilities with Grype or Trivy?BeginnerWhat should an SBOM contain? (NTIA minimum elements)Intermediate