-
-
Notifications
You must be signed in to change notification settings - Fork 67
feat: add custom properties to external references #610
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
Open
Urist-McGit
wants to merge
1
commit into
CycloneDX:1.7-dev
Choose a base branch
from
siemens:feat/ext-reference-properties
base: 1.7-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tools/src/test/resources/1.7/valid-external-reference-properties-1.7.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
"bomFormat": "CycloneDX", | ||
"specVersion": "1.7", | ||
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79", | ||
"version": 1, | ||
"components": [ | ||
{ | ||
"type": "application", | ||
"name": "dummy", | ||
"description": "this component has an external reference with properties", | ||
"externalReferences": [ | ||
{ | ||
"type": "component-analysis-report", | ||
"url": "http://example.com/extref/component-analysis-report", | ||
"properties": [ | ||
{ | ||
"name": "author", | ||
"value": "John Doe" | ||
}, | ||
{ | ||
"name": "timestamp", | ||
"value": "2025-01-27T12:27:26Z" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
tools/src/test/resources/1.7/valid-external-reference-properties-1.7.textproto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# proto-file: schema/bom-1.7.proto | ||
# proto-message: Bom | ||
|
||
spec_version: "1.7" | ||
version: 1 | ||
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" | ||
components { | ||
type: CLASSIFICATION_APPLICATION | ||
name: "dummy" | ||
description: "this component has an external reference with properties" | ||
external_references { | ||
type: EXTERNAL_REFERENCE_TYPE_COMPONENT_ANALYSIS_REPORT | ||
url: "http://example.com/extref/component-analysis-report" | ||
properties { | ||
name: "author" | ||
value: "John Doe" | ||
} | ||
properties { | ||
name: "timestamp" | ||
value: "2025-01-27T12:27:26Z" | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tools/src/test/resources/1.7/valid-external-reference-properties-1.7.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7"> | ||
<components> | ||
<component type="application"> | ||
<name>dummy</name> | ||
<description>this component has an external reference with properties</description> | ||
<externalReferences> | ||
<reference type="component-analysis-report"> | ||
<url>http://example.com/extref/component-analysis-report</url> | ||
<properties> | ||
<property name="author">John Doe</property> | ||
<property name="timestamp">2025-01-27T12:27:26Z</property> | ||
</properties> | ||
</reference> | ||
</externalReferences> | ||
</component> | ||
</components> | ||
</bom> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing to me. What if the external source has a different value for author and timestamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but what exactly do you mean by "different values for author and timestamp"? This is an example for additional properties provided in the SBOM for this report. They might be added because this metadata isn't available from the external source or just because it saves us an additional query to the external server when I need this information when handling the SBOM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take externalReferences.type == bom. If there are differences in the value for properties (say author), then there is a question about source of truth. Caller has to make an additional query to the external server.
We use annotations attribute to add/store additional information about certain attributes. Any issues with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, but how would how such additional information for an external reference differ from any other data points you provide for a component in your SBOM? Same problem would also apply for
author
orlicenses
or otherproperties
of a component and most of them could usually also be looked up on a homepage or package repository. I think the idea of an SBOM is to document your understanding of your BOM in a central place, no-one protects you from providing wrong data there.Regarding annotations: What we need is a machine-readable key/value store per external reference. Today, we mis-use the
comment
field of external references for storing such data, which obviously doesn't scale. I don't think usingannotations
would really improve that and also doesn't allow us to document these fields in our taxonomy.