Skip to content

chore(cyclonedx): emit metadata.tools in the 1.6 components form - #1102

Merged
sonukapoor merged 3 commits into
OWASP:mainfrom
XiaoZ-0218:fix/cyclonedx-tools-1097
Sep 9, 2026
Merged

chore(cyclonedx): emit metadata.tools in the 1.6 components form#1102
sonukapoor merged 3 commits into
OWASP:mainfrom
XiaoZ-0218:fix/cyclonedx-tools-1097

Conversation

@XiaoZ-0218

Copy link
Copy Markdown
Contributor

Summary

  • Migrate metadata.tools from the deprecated CycloneDX 1.6 array (vendor/name/version) to the modern tools.components object (type/name/version/publisher).
  • Pin the new shape in tests/cyclonedx.test.ts so a regression back to the legacy array fails.

Fixes #1097

Dependency-Track note

Issue #1097 asked to verify the documented consumer before shipping. Dependency-Track already models both legacy and component/service-based tool metadata (see DependencyTrack/dependency-track#6785: "Dependency-Track already models both legacy and component/service-based tool metadata"), so this output should remain ingestible.

Test plan

  • CycloneDX unit tests (17 passed)
  • CI on this PR

Replace the deprecated tools array (vendor/name/version) with
tools.components using type, name, version, and publisher so the
BOM stays valid when CycloneDX drops the legacy shape in 1.7.

Fixes OWASP#1097

@sonukapoor sonukapoor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is the right fix, and it closes a gap I left open in #1093.

When we moved specVersion to 1.6 there, metadata.tools kept the 1.4 array
shape. That is deprecated in 1.6, so we were emitting a document that declared
one version and described its tooling in the form of an older one. Moving to
tools.components with publisher instead of vendor makes the two agree.

I like that the tests assert vendor is absent rather than only checking the
new shape is present. That is the assertion that actually fails if someone
reintroduces the old form alongside the new one.

Verified locally: full suite green at 1792, build clean, and a real scan now
emits tools: {"components": [...]} with publisher: "OWASP".

@sonukapoor
sonukapoor merged commit c2ea410 into OWASP:main Sep 9, 2026
6 checks passed
@sonukapoor

Copy link
Copy Markdown
Collaborator

Merged - thank you @XiaoZ-0218! This will ship in v1.34.0, which I am cutting shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(cyclonedx): metadata.tools uses the shape deprecated in 1.6

2 participants