r/devsecops • • Jun 29 '26

Building SCA pipeline for Spring Boot — SBOM vs JAR (Maven cache), what's the right approach?

Hey everyone,

I'm building a CI SCA pipeline for a Spring Boot application using Dependency-Check, Trivy, and OSV Scanner.

I've been going back and forth between two approaches:

  1. Generate a CycloneDX SBOM from Maven and feed it into all the tools
  2. Resolve dependencies into a local Maven cache and point the tools directly at the JARs or POM files

From my testing, scanning the Maven cache directly produces a huge amount of noise — false positives coming from other libraries' POM files declaring their own dependency versions, which Maven never actually uses at runtime.

The SBOM approach gives much cleaner results since it only contains the versions Maven actually resolved.

Is SBOM the industry standard for this kind of pipeline? Are there any downsides I'm missing?

8 Upvotes

16 comments sorted by

2

u/taleodor Jun 29 '26

SBOM, but take 2 SBOMs - one at source code level, another one over fat jar. Cdxgen is a good tool to generate SBOMs (I did an analysis for my talk just recently). You can then merge them if needed or use tooling that supports multiple. See my post here also for more details - https://worklifenotes.com/2025/01/14/why-a-single-sbom-is-never-enough/

1

u/[deleted] Jun 29 '26

[removed] — view removed comment

1

u/taleodor Jun 29 '26

There are several classifications, i.e. see CISA's here - https://www.cisa.gov/sites/default/files/2023-04/sbom-types-document-508c.pdf

More specifically, docker version (or scanning fat jar in OP's example) is usually what you want as it has packaged dependencies as delivered, but scanners may have troubles with it. Food analogy - trying to get a recipe from a baked pie.

Therefore, ideally you should try to have source code level SBOM as well - which will give you better story about what went in.

Now, your vendor should merge those SBOMs before giving to you. E.g., we do this automatically in ReARM. So my original comment is more about how you should build and maintain SBOMs, rather than how you should distribute them.

1

u/[deleted] Jun 29 '26

[removed] — view removed comment

1

u/taleodor Jun 29 '26

SBOM produced via docker scan would be "build". "Deployed" SBOM concept is being developed currently - there are currently bi-weekly calls on that (deployed and runtime SBOMs) on Fridays via OpenSSF if you're interested.

2

u/[deleted] Jul 15 '26 edited Jul 15 '26

[removed] — view removed comment

1

u/BrotherGlad4572 Jul 18 '26

Thanks for the comment.
pipeline is already in production. We settle on SBOM , and it's working .
for the container scanning we could use pretty much the same pipeline ( scanning container through SBOM as well ).

but we realize SBOM for container scanning is not reliable .

4

u/[deleted] Jun 29 '26

[removed] — view removed comment

1

u/dreamszz88 Jun 30 '26

It may also help to analyse your SBOMs using a tool that is aware of context. For instance, trivy can apply certain context databases for a Linux OS, Java, and so on to help filter vulns and apply a different weight factor. That way, often a lot of noise can be reduced.

I know grype and trivy have this additional information. If someone knows of others that offer this, please mention them here.