Repository navigation
Replies: 2 comments 1 reply
|
As a starter for a discussion, I analyzed what ends up in the Debian Ghost components in
|
| Ghost | Where | Why scanners miss it |
|---|---|---|
| ~320 third-party Maven libraries (Spring, Jetty, CXF, Jackson, Netty, AWS SDK, ...) | shaded into lib/cloudstack-4.23.0.0.jar (264 MB, 193 000 classes) |
All META-INF/maven/**/pom.properties are gone and the JAR's hash matches nothing in Maven Central. syft reports a single component, cloudstack 4.23.0.0. |
| 71 native libraries (JNA, snappy-java, Netty epoll, ...), for Linux but also Windows, macOS and Solaris | inside the same shaded JAR | They are neither Java libraries nor files on the system: nothing catalogs a .so inside a JAR inside a package. |
| ~130 npm packages (Vue, Ant Design, axios, ...) | bundled by webpack into the 483 files of webapp/js |
A bundle has no package.json and no lockfile. The names are only visible in the *.js.map files that happen to be shipped, which no scanner reads. |
The 9 JARs that are found are exactly those copied as-is into lib/ (Bouncy Castle, MySQL Connector/J, Linstor, ...), next to the shaded JAR. cmk is found too, because Go binaries embed their module list. So the ghosts are not a limit of the scanners: they come from how we package.
cloudstack-common has more of them, for example code copied into the source tree rather than declared as a dependency, like noVNC and jQuery in systemvm/agent, which ends up in agent.zip and in the system VMs.
Can't the build tools tell us?
For the shaded JAR, not yet. Support for the Maven Shade Plugin in the CycloneDX Maven Plugin was requested in CycloneDX/cyclonedx-maven-plugin#472 two and a half years ago, and it is finally going forward thanks to @hboutemy in CycloneDX/cyclonedx-maven-plugin#696. That PR teaches the plugin to tell, from the packaging plugins that run, which dependencies are embedded in the artifact and which are only required (CycloneDX 1.7 isExternal). We are not there yet: the PR is still open, Shade's configuration is flexible enough to need more work, and a module that produces both a plain and a shaded JAR still gets a single SBOM.
In the meantime, I put together an experiment on top of #14570: ppkarwasz:sbom-phase1. It produces one SBOM per Maven module, which matches the JARs that debian/rules copies into each package by hash, pins the cmk download, and lists Marvin's Python requirements as external components. The plan describes how these pieces could be assembled into one SBOM per .deb.
What could make CloudStack more detectable
Some modifications of CloudStack might also be beneficial to have a more detectable set of embedded components:
- Stop shading
cloudstack.jar. The management server already starts withlib/*on the classpath, so the third-party JARs could be copied unchanged, like the 9 above. Every one of them would then be identifiable by its hash, and its signature (if any) would stay valid. This would also sidestep the Shade problem above. - Ship only the native libraries we run. Windows, macOS and Solaris binaries can't run on a Debian system, but they still show up in vulnerability reports.
- Ship an SBOM in each package, e.g.
/usr/share/doc/cloudstack-management/cloudstack-management.cdx.json, so that a scanner on the installed system can fill in what it cannot discover by itself.
|
To produce SBOMs for Debian packages (and packages for other distributions too, I assume), there is a small problem to sort out in the Package URL definition first. The
I opened package-url/purl-spec#1059 to discuss this. |
Uh oh!
There was an error while loading. Please reload this page.
#14570 generates SBOMs for the main building blocks of CloudStack (the Java modules, the UI and Marvin). That is a good basis, and I would like to discuss which SBOMs would actually be useful to downstream users, and how to produce them.
I see two candidates:
pre-build) that accompanies each source release. It would mainly flag the files that are not underApache-2.0or that come from other projects, think of it as aNOTICEfile on steroids, and give an idea of the external dependencies needed to run CloudStack. This kind of SBOM is not useful for vulnerability analysis.build) for each.deband.rpmwe publish. Ideally it is complete: every component the package contains, whatever the language (Java, JavaScript, Python, C) and however deeply nested (a JAR shaded into another JAR, a native library inside a JAR).On how to produce them: SBOM generators either read the build files (
pom.xml,package-lock.json,debian/rules, ...) to know what should be in an artifact, or scan the artifact to find what is actually in it. Both have blind spots. For example,cloudstack.jarshades bothcommons-loggingandjcl-over-slf4j, which contain the same class names, and no build file tells you which copy ended up in the JAR. My preference is for the project to publish build-based SBOMs, since users can run a scanner just as easily as we can.If you use CloudStack, or package or redistribute it, it would help to hear from you:
License compliance is not my area, so opinions on what the source SBOM should contain are especially welcome.
All reactions