open-quantum-safe / liboqs

C library for prototyping and experimenting with quantum-resistant cryptography
https://openquantumsafe.org/
Other
1.82k stars 447 forks source link

Update CBOM to CycloneDX 1.6 format #1831

Open planetf1 opened 3 months ago

planetf1 commented 3 months ago

State of current BOM:

The current BOM at docs/cbom.json mostly validates against the 1.4 spec with just 1 issue

In RFC3339 a time-offset is required, ie can be Z.

Using 2024-03-05T11:49:42.428605Z passes validation.

This change is needed in the tooling that builds/tests the BOM

Improvement to include pointer to schema

Many BOMs include a pointer to the spec ie we could add

  "$schema": "https://raw.githubusercontent.com/IBM/CBOM/main/bom-1.4-cbom-1.0.schema.json#",

Aside - as an alternative, and for testing, the following can be added in .vscode settings:

    "json.schemas": [

        {
            "fileMatch": [
                "cbom.json"
            ],
            "url": "https://raw.githubusercontent.com/IBM/CBOM/main/bom-1.4-cbom-1.0.schema.json"
        }
    ]

Cyclone DX 1.6

CBOM is now incorporated into CycloneDX 1.6, but here the schema as evolved a little

We can validate against the new spec - the example below includes the vscode definition:

    "json.schemas": [

        {
            "fileMatch": [
                "cbom.json"
            ],
            "url": "http://cyclonedx.org/schema/bom-1.6.schema.json"
        }
    ]

If $schema is included in the bom, then other tools wouldn't need to explicitly be configured, and should find the schema definition automatically

In CycloneDX 1.6 the following is noted:

Note the above is from a quick scan - need to check in more detail...

@bhess @dstebila I think it would be useful to consider this update now that the 1.6 spec is out, and we're seeing more tooling support CBOM.

Happy to work on some updates if it's helpful - or perhaps you plan to @bhess ?

bhess commented 2 months ago

Thanks @planetf1 for this issue. Do you want to move your analysis to #1753 ? I have a good grasp about the changes needed and can do a PR with the updates for 1.6.

bhess commented 2 months ago

See PR #1834 which should include the updates you propose @planetf1.

planetf1 commented 1 month ago

Fixes #1831