Skip to content

Commit ed9918d

Browse files
committed
feat: add custom properties to external references
With this property external references can be annotated with additional metadata in a machine-readable format. Signed-off-by: Christoph Steiger <[email protected]>
1 parent a0a6f8f commit ed9918d

6 files changed

+89
-0
lines changed

schema/bom-1.7.proto

+2
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ message ExternalReference {
218218
optional string comment = 3;
219219
// Optional integrity hashes for the external resource content
220220
repeated Hash hashes = 4;
221+
// Specifies optional, custom, properties
222+
repeated Property properties = 5;
221223
}
222224

223225
enum ExternalReferenceType {

schema/bom-1.7.schema.json

+6
Original file line numberDiff line numberDiff line change
@@ -1827,6 +1827,12 @@
18271827
"items": {"$ref": "#/definitions/hash"},
18281828
"title": "Hashes",
18291829
"description": "The hashes of the external reference (if applicable)."
1830+
},
1831+
"properties": {
1832+
"type": "array",
1833+
"title": "Properties",
1834+
"description": "Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.",
1835+
"items": {"$ref": "#/definitions/property"}
18301836
}
18311837
}
18321838
},

schema/bom-1.7.xsd

+10
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,16 @@ limitations under the License.
15971597
</xs:sequence>
15981598
</xs:complexType>
15991599
</xs:element>
1600+
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
1601+
<xs:annotation>
1602+
<xs:documentation>Provides the ability to document properties in a name/value store.
1603+
This provides flexibility to include data not officially supported in the standard
1604+
without having to use additional namespaces or create extensions. Property names
1605+
of interest to the general public are encouraged to be registered in the
1606+
CycloneDX Property Taxonomy - https://github.com/CycloneDX/cyclonedx-property-taxonomy.
1607+
Formal registration is optional.</xs:documentation>
1608+
</xs:annotation>
1609+
</xs:element>
16001610
</xs:sequence>
16011611
<xs:attribute name="type" type="bom:externalReferenceType" use="required">
16021612
<xs:annotation>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.7",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"components": [
8+
{
9+
"type": "application",
10+
"name": "dummy",
11+
"description": "this component has an external reference with properties",
12+
"externalReferences": [
13+
{
14+
"type": "component-analysis-report",
15+
"url": "http://example.com/extref/component-analysis-report",
16+
"properties": [
17+
{
18+
"name": "author",
19+
"value": "John Doe"
20+
},
21+
{
22+
"name": "timestamp",
23+
"value": "2025-01-27T12:27:26Z"
24+
}
25+
]
26+
}
27+
]
28+
}
29+
]
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# proto-file: schema/bom-1.7.proto
2+
# proto-message: Bom
3+
4+
spec_version: "1.7"
5+
version: 1
6+
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
7+
components {
8+
type: CLASSIFICATION_APPLICATION
9+
name: "dummy"
10+
description: "this component has an external reference with properties"
11+
external_references {
12+
type: EXTERNAL_REFERENCE_TYPE_COMPONENT_ANALYSIS_REPORT
13+
url: "http://example.com/extref/component-analysis-report"
14+
properties {
15+
name: "author"
16+
value: "John Doe"
17+
}
18+
properties {
19+
name: "timestamp"
20+
value: "2025-01-27T12:27:26Z"
21+
}
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
3+
<components>
4+
<component type="application">
5+
<name>dummy</name>
6+
<description>this component has an external reference with properties</description>
7+
<externalReferences>
8+
<reference type="component-analysis-report">
9+
<url>http://example.com/extref/component-analysis-report</url>
10+
<properties>
11+
<property name="author">John Doe</property>
12+
<property name="timestamp">2025-01-27T12:27:26Z</property>
13+
</properties>
14+
</reference>
15+
</externalReferences>
16+
</component>
17+
</components>
18+
</bom>

0 commit comments

Comments
 (0)