Skip to content

SBOM dep cpe purl - #11120

Open
sameehj wants to merge 2 commits into
wolfSSL:masterfrom
sameehj:sbom-dep-cpe-purl
Open

SBOM dep cpe purl#11120
sameehj wants to merge 2 commits into
wolfSSL:masterfrom
sameehj:sbom-dep-cpe-purl

Conversation

@sameehj

@sameehj sameehj commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

Improve SBOM generation so dependency and subcomponent identities are usable for automated vulnerability scanning (CRA / IEC 62443 style monitoring).

  • Emit registered CPE 2.3 on dependency components (CycloneDX cpe / SPDX cpe23Type), not PURL alone.
  • Emit canonical, resolvable pkg:github PURLs (lowercase namespace/name; real release tags such as v<version>-stable for wolfSSL).
  • Model wolfCrypt as contained in wolfSSL (CycloneDX nested component / SPDX CONTAINS), not as an external DEPENDS_ON.
  • Align scripts/gen-sbom with the wolfGlass generator: do not publish a cpe for products that are not in the NVD Official CPE Dictionary; support crypto-only builds via --crypto-only.

This supports corrected release SBOMs for integrators (e.g. wolfSSL 5.9.1) and matches the identity model used by downstream products such as wolfBoot.

Fixes zd#22297

Testing

  • Unit tests: scripts/test_gen_sbom.py (updated/extended for CPE, PURL forms, wolfCrypt containment, omit CPE when version unknown / product pending).
  • Regenerated sample CycloneDX/SPDX from the updated generator and checked:
    • non-empty component inventory where expected
    • cpe:2.3:a:wolfssl:wolfssl:… and cpe:2.3:a:wolfssl:wolfcrypt:… present
    • PURLs use lowercase pkg:github/wolfssl/… and @v…-stable where applicable
    • wolfCrypt nested under wolfSSL / SPDX CONTAINS

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

sameehj added 2 commits August 6, 2026 17:38
A dependency component carried only a PURL, so an integrator whose
vulnerability monitoring keys on NVD (as a CRA / IEC 62443 process does)
could not see the wolfSSL that a downstream product links, and wolfSSL
advisories never reached them.  Every DEP_META entry now declares the
vendor:product pair NVD registers, emitted as CycloneDX `cpe` and as an
SPDX cpe23Type external reference.  Both identifiers are version-bearing,
so neither is emitted when the version cannot be resolved: a CPE with an
empty version field matches every release of the dependency.

The PURLs did not resolve either.  purl-spec requires the namespace and
name of the `github` type to be lowercased, and the version is a git ref,
so `pkg:github/wolfSSL/wolfssl@v5.9.1` was both non-canonical and a
dangling reference: wolfSSL releases are tagged `v5.9.1-stable`.
GITHUB_TAG_FORMS records the tag form per project, since the stack is not
consistent about it (wolfSSH is `-stable`, wolfTPM is not, wolfHSM
prefixes the project name).

Ported from the wolfGlass engine, which carries the same change.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
wolfSSL's own SBOM listed wolfcrypt as something wolfssl DEPENDS_ON,
which describes a third-party library rather than a part of this release.
SPDX now records CONTAINS, matching how a downstream product's SBOM
expresses the same relationship after the generator refresh, so the two
documents agree about what wolfCrypt is.

The generator is synced from wolfGlass, which also stops publishing a
`cpe` for a product NVD has not listed yet and adds --crypto-only for
builds that compile in the crypto subset alone.  One test still asserted
that a valueless `#define X` is recorded as '1'; that was changed in 1.3
precisely because it made `#define X` and `#define X 1` indistinguishable
and misread any macro naming a quantity.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #11120

No scan targets match the changed files in this PR. Review skipped.

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.

3 participants