Problem/Motivation
DruBOM generates SBOMs by calling the Anchore Syft and Grype binaries. That has several problems:
- Many hosts do not allow binaries or
proc_open(), so the module cannot run there. - Syft does not know Drupal: it cannot tell installed from uninstalled extensions, custom modules, or which library belongs to which extension.
- The current code fails on Drupal 11: the settings forms cause a fatal error during cache rebuild.
- The Grype integration copies its database into the private file system, and its database import does not work.
Proposed resolution
Rewrite the module so it runs entirely in PHP:
- Inventory: collectors for Composer packages, Drupal extensions, third-party asset libraries declared in
*.libraries.yml, and npm lockfiles (versions 2 and 3). Coverage gaps such as unknown versions or unsupported lockfiles are recorded, never hidden. - Intermediate representation: a format-agnostic snapshot model with JSON schemas in
schema/. - Formatters: a new
SbomFormatterplugin type. The module ships SPDX 3.0.1 JSON-LD; other formats can be added as plugins. - Security advisories: a new
AdvisoryProviderplugin type with drupal.org, Packagist and OSV providers. No provider is enabled by default; enabling one sends package names to that service. - Admin UI: Reports > Software inventory, with an overview, packages, security findings and snapshots, plus a settings page and a status report entry.
- Drush:
drubom:generate,drubom:export,drubom:analyze,drubom:providers,drubom:status. - Requirements: Drupal 11.3 or later, PHP 8.3, a private file system.
Remaining tasks
- Review the merge request.
- Yarn and pnpm lockfiles.
- Export severities and fixed versions to SPDX.
- VEX assessments on findings.
- Declare Drupal 12 compatibility once the next-major CI job passes.
User interface changes
New Reports > Software inventory pages and a settings page at /admin/config/system/drubom. The previous settings and report pages are removed.
API changes
New SbomFormatter and AdvisoryProvider plugin types. The previous Drush commands are replaced. The plugin APIs are experimental until the first release.
Data model changes
Snapshots and analysis runs are stored as files in private://drubom/, indexed in two new tables. An update hook keeps the last report of the previous version as a file in private://drubom/legacy/ and removes the Syft and Grype settings and state.
Issue fork drubom-3629895
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3629895-used-by
changes, plain diff MR !18
- 3629895-beta-status
changes, plain diff MR !17
- 3629895-project-page-docs
changes, plain diff MR !16
- 3629895-restore-project-page
changes, plain diff MR !15
- 3629895-readme-project-page
changes, plain diff MR !14
- 3629895-project-page
changes, plain diff MR !13
- 3629895--rewrite-drubom
changes, plain diff MR !12
- feat/overview
compare
- 3629895-overview
changes, plain diff MR !21
- 3629895-batch2
changes, plain diff MR !20
- 3629895-dependency-map
changes, plain diff MR !19
Comments
Comment #8
paolomainardi commentedComment #14
paolomainardi commented