CycloneDX / cyclonedx-php-composer

Create CycloneDX Software Bill of Materials (SBOM) from PHP Composer projects
https://cyclonedx.org/
Apache License 2.0
49 stars 7 forks source link

Add support for dependency graph introduced in v1.2 of the spec #5

Closed coderpatros closed 3 years ago

coderpatros commented 4 years ago

see https://cyclonedx.org/use-cases/#dependency-graph

stevespringett commented 4 years ago

The Laravel SBOM example will need to be updated to spec v1.2 once this ticket is complete.

jkowalleck commented 3 years ago

@coderpatros

i am not too famliar wth the 1.2 specs. could you help me find the "dependency graph" element in the XSD and JSON SCHEMA ?

coderpatros commented 3 years ago

@jkowalleck it’s at the BOM level https://cyclonedx.org/docs/1.2/#type_dependenciesType

jkowalleck commented 3 years ago

The Laravel SBOM example will need to be updated to spec v1.2 once this ticket is complete.

see https://github.com/CycloneDX/sbom-examples/tree/master/laravel-7.12.0 (related: #58 )

jkowalleck commented 3 years ago

based on https://cyclonedx.org/use-cases/#dependency-graph


[DRAFT]

the following might be wrong, need to read SPEC details.... some notes:

this might lead to non-reproducible outputs, if bom-ref change on each runtime... maybe leverage the packageURL as a constant value? or generate a constant hash somehow?

jkowalleck commented 3 years ago

attention. keep alias packages in mind and how they should be handled.

jkowalleck commented 3 years ago

implementation aids: composer why might have a dep tree implemented composer show --locked --tree displays a dep tree - so it must utilize some tree maker somehow. see if composer's tree makers are public(non-internal) and can me used as a library.