Loading
Read a framework component of a third-party SBOM as a library
What does this MR do and why?
This MR changes component filtering to read a component typed framework as a library. This is done because some generators (like cdxgen) may report libraries as frameworks.
Normalizer#library_typedreturns a copy of a component typedframeworkwith the typelibrary, and returns any other component as it is.- A
frameworkcomponent with no package URL is listed at the default location, and one with a package URL type that is not supported is skipped, as for a library.
This MR is the third of 8 in a stack. The next one is Read the source files of a Syft or Grype SBOM (!264253) • Igor Frenkel • 19.7.
Example
A component of a cdxgen 13.0.1 SBOM of a Maven project (trimmed): commons-text is an ordinary Maven library, typed framework.
{
"type": "framework",
"name": "commons-text",
"version": "1.8",
"purl": "pkg:maven/org.apache.commons/commons-text@1.8?type=jar"
}- Before this MR: the SBOM gives 2 rows, commons-io 2.4 and core 1.0.0.
commons-text,log4j-coreandlog4j-apiare skipped.
- After this MR: 5 rows, the same two plus commons-text 1.8, log4j-api 2.14.1 and log4j-core 2.14.1.
- GitLab's own SBOM of the same project types every package
library(core/pom.xml, 5 rows), and it is unchanged.
References
Screenshots or screen recordings
No UI change.
How to set up and validate locally
- In a Rails console on a development instance run
Feature.enable(:third_party_sbom_support). - Create a project, add an SBOM of one of the kinds below and a
.gitlab-ci.ymljob that uploads it asartifacts:reports:cyclonedx, and run the pipeline. - Open the Dependency List and read the location of each row, or the
dependenciesGraphQL field (name,version,packager,location { path }).- A cdxgen 13.0.1 SBOM of a Maven project.
- Expected: 5 rows (commons-io, commons-text, core, log4j-api, log4j-core).
- An SBOM with a
frameworkcomponent of a supported package URL type and noevidence.identity.- Expected: the component is listed.
- A cdxgen 13.0.1 SBOM of a Maven project.
- Add a GitLab DS analyzer SBOM, for example the SBOM of the Maven
coremodule.- Expected: 5 rows at
core/pom.xml, package manager maven.
- Expected: 5 rows at
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Igor Frenkel