Skip to content

[FEATURE] Ensure bom-ref for Component and Vulnerability have a (unique) value #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
madpah opened this issue Jan 24, 2022 · 4 comments · Fixed by #142
Closed

[FEATURE] Ensure bom-ref for Component and Vulnerability have a (unique) value #141

madpah opened this issue Jan 24, 2022 · 4 comments · Fixed by #142
Labels
enhancement New feature or request

Comments

@madpah
Copy link
Collaborator

madpah commented Jan 24, 2022

Currently our models rely on the consumer to specifiy/provide a value for a Component or Vulnerability's bom-ref.

In previous versions of this library, the purl was automatically used for this purpose (for Component) but this was removed as a Component may not have a purl.

As pointed out in sonatype-nexus-community/jake#91, for Vulnerabilities to be able to specify which Components are affected (in 1.4), Components must have a bom-ref - see here.

It's worth noting that bom-ref is optional within the schema for both Component and Vulnerability.

This Feature will look to assign a UUID as the bom-ref if a value has not been provided by the consumer.

@madpah madpah added the enhancement New feature or request label Jan 24, 2022
madpah added a commit that referenced this issue Jan 24, 2022
… not supplied ensuring they have a unique value #141

Signed-off-by: Paul Horton <[email protected]>
@damiencarol
Copy link

damiencarol commented Jan 24, 2022

@madpah can't we use PURL string as the bom-ref for component? the specification do that in the examples.
Could be better than generate a UUID and keep a trace of it, etc...
see https://github.com/CycloneDX/specification/blob/master/tools/src/test/resources/1.4/valid-vulnerability-1.4.json

madpah added a commit that referenced this issue Jan 24, 2022
* feat: `bom-ref` for Component and Vulnerability default to a UUID if not supplied ensuring they have a unique value #141

Signed-off-by: Paul Horton <[email protected]>

* doc: updated documentation to reflect change

Signed-off-by: Paul Horton <[email protected]>

* patched other tests to support UUID for bom-ref

Signed-off-by: Paul Horton <[email protected]>

* better syntax

Signed-off-by: Paul Horton <[email protected]>
@madpah
Copy link
Collaborator Author

madpah commented Jan 24, 2022

@madpah can't we use PURL string as the bom-ref for component? the specification do that in the examples. Could be better than generate a UUID and keep a trace of it, etc... see https://github.com/CycloneDX/specification/blob/master/tools/src/test/resources/1.4/valid-vulnerability-1.4.json

@damiencarol - we can't use a PURL in most circumstances, but the model provided for by this library allows that to be the case. This PR was a precursor to a full fix in jake btw.

@damiencarol
Copy link

damiencarol commented Jan 24, 2022

will test it as soon as it's ready.
FYI: I'm working on making Jake importing works for https://github.com/DefectDojo/django-DefectDojo

madpah added a commit that referenced this issue Jan 26, 2022
* feat: `bom-ref` for Component and Vulnerability default to a UUID if not supplied ensuring they have a unique value #141

Signed-off-by: Paul Horton <[email protected]>

* doc: updated documentation to reflect change

Signed-off-by: Paul Horton <[email protected]>

* patched other tests to support UUID for bom-ref

Signed-off-by: Paul Horton <[email protected]>

* better syntax

Signed-off-by: Paul Horton <[email protected]>
madpah added a commit that referenced this issue Jan 27, 2022
* WIP but a lil hand up for @madpah

Signed-off-by: Jeffry Hesse <[email protected]>

* chore: added missing license header

Signed-off-by: Paul Horton <[email protected]>

* No default values for required fields

* Add Services to BOM

* Typo fix

* aligned classes with standards, commented out Signature work for now, added first tests for Services

Signed-off-by: Paul Horton <[email protected]>

* addressed standards

Signed-off-by: Paul Horton <[email protected]>

* 1.2.0

Automatically generated by python-semantic-release

Signed-off-by: Paul Horton <[email protected]>

* feat: `bom-ref` for Component and Vulnerability default to a UUID (#142)

* feat: `bom-ref` for Component and Vulnerability default to a UUID if not supplied ensuring they have a unique value #141

Signed-off-by: Paul Horton <[email protected]>

* doc: updated documentation to reflect change

Signed-off-by: Paul Horton <[email protected]>

* patched other tests to support UUID for bom-ref

Signed-off-by: Paul Horton <[email protected]>

* better syntax

Signed-off-by: Paul Horton <[email protected]>

* 1.3.0

Automatically generated by python-semantic-release

Signed-off-by: Paul Horton <[email protected]>

* WIP but a lil hand up for @madpah

Signed-off-by: Jeffry Hesse <[email protected]>
Signed-off-by: Paul Horton <[email protected]>

* chore: added missing license header

Signed-off-by: Paul Horton <[email protected]>

* aligned classes with standards, commented out Signature work for now, added first tests for Services

Signed-off-by: Paul Horton <[email protected]>

* removed signature from this branch

Signed-off-by: Paul Horton <[email protected]>

* Add Services to BOM

* Typo fix

* addressed standards

Signed-off-by: Paul Horton <[email protected]>

* resolved typing issues from merge

Signed-off-by: Paul Horton <[email protected]>

* added a bunch more tests for JSON output

Signed-off-by: Paul Horton <[email protected]>

Co-authored-by: Paul Horton <[email protected]>
Co-authored-by: github-actions <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants