CycloneDX / specification

OWASP CycloneDX is a full-stack Bill of Materials (BOM) standard that provides advanced supply chain capabilities for cyber risk reduction. SBOM, SaaSBOM, HBOM, AI/ML-BOM, CBOM, OBOM, MBOM, VDR, and VEX
https://cyclonedx.org/
Apache License 2.0
337 stars 57 forks source link

Resolve ambiguous definition of `serialNumber` #474

Open mschusterbsi opened 3 weeks ago

mschusterbsi commented 3 weeks ago

Current Behavior

serialNumber is defined as an UUID and RECOMMENDED:

Every BOM generated SHOULD have a unique serial number, even if the contents of a BOM have not changed over time. If specified, the serial number MUST conform to RFC-4122. Use of serial numbers are RECOMMENDED.

version is defined as an integer > 0:

Whenever an existing BOM is modified, either manually or through automated processes, the version of the BOM SHOULD be incremented by 1. […] This contradicts the definition of serialNumber, except one interprets these statements, as both fields have to be changed when an extant SBOM is newly generated.

Proposed Behavior

In our opinion UUIDs and hence the CycloneDX serialNumber must be static ("unequivocal in time and space" = "temporally and spatially unique"), as long as an SBOM creator records the same software component, even if these software componets are altered: e.g. new versions, files or sub-components are added or removed, etc.

Hence, we propose as the definition of serialNumber: Every BOM creator SHOULD use a unique serial number when describing a specific component, which MUST stay the same if the BOM is re-generated or the contents of this component have changed. If specified, the serial number MUST conform to RFC-4122. Use of serial numbers is RECOMMENDED.

jkowalleck commented 3 weeks ago

related: https://github.com/CycloneDX/specification/issues/363

jkowalleck commented 3 weeks ago

related: https://github.com/CycloneDX/specification/issues/97

stevespringett commented 2 weeks ago

The proposed description has some issues

Every BOM creator SHOULD use a unique serial number when describing a specific component, which MUST stay the same if the BOM is re-generated or the contents of this component have changed. If specified, the serial number MUST conform to RFC-4122. Use of serial numbers is RECOMMENDED.

Specifically with:

which MUST stay the same if the BOM is re-generated or the contents of this component have changed

This would require the BOM creator to maintain a database of all the components (first-party and third-party) and ensure they reuse the same serialNumber. This requirement could not be fulfilled by the majority of existing BOM generators, especially those integrated into CI/CD pipelines.

Is the goal of this change to make the serialNumber deterministic?

mschusterbsi commented 4 days ago

We understand that there might be technical hurdles to reuse an unique identifier. Though, we are convinced that these can be overcome in most cases.

Our aim is to be make sure that an SBOM creator uses the same serial number (or some other unique identifier for a specific SBOM) for the same primary component. The version field would be incremented for each newly created version. This allows the consumer to correlate different versions of an SBOM from the same SBOM-creator and detect changes between them.

At least we imagine the following wording, as an weaker alternative to our original suggestion (though we are not really happy with it):
Every BOM creator SHOULD use a unique serial number when describing a specific component, which SHOULD stay the same if the BOM is re-generated or the contents of this component have changed. If specified, the serial number MUST conform to RFC-4122. Use of serial numbers is RECOMMENDED.

fvsamson commented 4 days ago

When reading this discussion thread, I think I perceive a few subtle misunderstandings: