Skip to content

MDEV-41072 Update MariaDB Server SBOM generation to CISA 2026 Minimum Elements - #5681

Open
vaintroub wants to merge 1 commit into
11.8from
bb-11.8-MDEV-41072
Open

vaintroub wants to merge 1 commit into
11.8from
bb-11.8-MDEV-41072

Conversation

@vaintroub

Copy link
Copy Markdown
Member

Summary

  • SBOM metadata.authors[0].name now uses CPACK_PACKAGE_VENDOR instead of a hardcoded string.
  • SBOM metadata.authors[0].email is now derived from CPACK_PACKAGE_CONTACT (parsed to pull a valid email out of the "Display Name " RFC 5322 mailbox format, or accept a bare email), instead of being hardcoded.
  • Added SBOM_GET_CONTACT_EMAIL() in cmake/generate_sbom.cmake, which fails the CMake configure with a clear error if CPACK_PACKAGE_CONTACT doesn't contain a valid email, since the SBOM schema requires a real address.

Test plan

  • Verified the email-extraction regex standalone via cmake -P for: "Name <email>" form, bare "email" form, and an invalid contact string (confirmed it fails with FATAL_ERROR).
  • Full CMake configure to confirm the generated sbom.json has the expected supplier/authors fields.

🤖 Generated with Claude Code

@vaintroub vaintroub changed the title MDEV-41072 use CPACK_PACKAGE_VENDOR/CONTACT for SBOM author MDEV-41072 Update MariaDB Server SBOM generation to CISA 2026 Minimum Elements Sep 15, 2026
@vaintroub
vaintroub requested review from vuvova and a lite review from Copilot September 16, 2026 09:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two moderate issues remain regarding email validation and JSON escaping.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates MariaDB SBOM metadata to use configured package ownership/contact information and identify the SBOM generation tool.

Changes:

  • Derives author name and email from CPack metadata.
  • Validates the configured contact email.
  • Adds SBOM generator tool metadata.
File summaries
File Summary
cmake/sbom.json.in Uses configured author metadata and adds tool metadata; vendor values require JSON escaping.
cmake/generate_sbom.cmake Extracts and validates contact email; the validation pattern requires correction.
Review details

Suppressed comments (1)

cmake/sbom.json.in:36

  • [should-fix] CPACK_PACKAGE_VENDOR is inserted verbatim into JSON. Because this CMake value can be overridden, a vendor such as Acme "DB" produces invalid JSON in this new authors.name field (and the existing component.supplier.name has the same issue). Escape the value for JSON before configure_file and use the escaped form in both places.
        "name": "@CPACK_PACKAGE_VENDOR@"
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cmake/generate_sbom.cmake
# can be found, since the SBOM schema requires the author's email to be a
# real address.
FUNCTION(SBOM_GET_CONTACT_EMAIL varname)
SET(email_regex "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]+$")
- set SBOM author to ${CPACK_PACKAGE_VENDOR}
- extract email address from ${CPACK_PACKAGE_CONTACT}
- add metadata.tools.components describing the generator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants