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_typed returns a copy of a component typed framework with the type library, and returns any other component as it is.
  • A framework component 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-core and log4j-api are 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

  1. In a Rails console on a development instance run Feature.enable(:third_party_sbom_support).
  2. Create a project, add an SBOM of one of the kinds below and a .gitlab-ci.yml job that uploads it as artifacts:reports:cyclonedx, and run the pipeline.
  3. Open the Dependency List and read the location of each row, or the dependencies GraphQL 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 framework component of a supported package URL type and no evidence.identity.
      • Expected: the component is listed.
  4. Add a GitLab DS analyzer SBOM, for example the SBOM of the Maven core module.
    • Expected: 5 rows at core/pom.xml, package manager maven.

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

Merge request reports

Loading
Loading