Skip to content

add support for CDX1.5 #843

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

Merged
merged 18 commits into from
Jun 27, 2023
44 changes: 42 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,47 @@

All notable changes to this project will be documented in this file.

## unreleased
## unreleased: 3.0.0 --

Added support for [_CycloneDX_ Specification-1.5](https://github.com/CycloneDX/specification/releases/tag/1.5).
Added functionality regarding [_CycloneDX_ BOM-Link](https://cyclonedx.org/capabilities/bomlink/).

### API changes v3 - the details

* BREAKING
* Interface `Spec.Protocol` now defines a new mandatory method `supportsVulnerabilityRatingMethod()` (via [#843])
This is only a breaking change, if you custom-implemented this interface downstream; internal usage is non-breaking.
* Changed
* `Serialize.{JSON,Xml}.Normalize.VulnerabilityRatingNormalizer.normalize()` will omit unsupported values for `Models.Vulnerability.Rating.method` (via [#843])
This utilizes the new `Spec.Protocol.supportsVulnerabilityRatingMethod()`.
* Added
* Namespace `Enums`
* Enum `ComponentType` got new members ([#505] via [#843])
New: `Data`, `DeviceDriver`, `MachineLearningModel`, `Platform`
* Enum `ExternalReferenceType` got new members ([#505] via [#843])
New: `AdversaryModel`, `Attestation`, `CertificationReport`, `CodifiedInfrastructure`, `ComponentAnalysisReport`, `Configuration`, `DistributionIntake`, `DynamicAnalysisReport`, `Evidence`, `ExploitabilityStatement`, `Formulation`, `Log`, `MaturityReport`, `ModelCard`, `POAM`, `PentestReport`, `QualityMetrics`, `RiskAssessment`, `RuntimeAnalysisReport`, `SecurityContact`, `StaticAnalysisReport`, `ThreatModel`, `VulnerabilityAssertion`
* Enum `Vulnerability.RatingMethod` got new members ([#505] via [#843])
New: `CVSSv4`, `SSVC`
* Namespace `Spec`
* Enum `Version` got new member `v1dot5` to reflect _CycloneDX_ Specification-1.5 ([#505] via [#843])
* Constant `SpecVersionDict` got new entry to reflect _CycloneDX_ Specification-1.5 ([#505] via [#843])
* New constant `Spec1dot5` to reflect _CycloneDX_ Specification-1.5 ([#505] via [#843])
* Constants `Spec1dot{2,3,4}` got a new method `supportsVulnerabilityRatingMethod()` (via [#843])
* Interface `Protocol` has a new method `supportsVulnerabilityRatingMethod()` (via [#843])
* Namespace `Types`
* New types and predicates to reflect _CycloneDX_ BOM-Link (via [#843])
Type definitions: `BomLink`, `BomLinkDocument`, `BomLinkElement`
Predicates: `isBomLink()`, `isBomLinkDocument()`, `isBomLinkElement()`
* Namespace `Validation`
* Class `JsonValidator` supports _CycloneDX_ Specification-1.5 now ([#505] via [#843])
* Class `JsonStrictValidator` supports _CycloneDX_ Specification-1.5 now ([#505] via [#843])
* Class `XmlValidator` supports _CycloneDX_ Specification-1.5 now ([#505] via [#843])
* Misc
* Added functional and integration tests for _CycloneDX_ Specification-1.5 ([#505] via [#843])
* Fetched latest stable schema definition files for offline usage (via [#843])

[#505]: https://github.com/CycloneDX/cyclonedx-javascript-library/issues/505
[#843]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/843

## 2.1.0 -- 2023-06-10

Expand Down Expand Up @@ -41,7 +81,7 @@ Added `ComponentEvidence` capabilities.
* Serializers and `Component`-Normalizers will take `Models.Component.evidence` into account ([#516] via [#753])
* Serializers and `Bom`-Normalizers will take `Models.Bom.vulnerabilities` into account ([#164] via [#722])
* Misc
Internal rework, modernization, refactoring.
* Internal rework, modernization, refactoring

### API changes v2 - the details

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ written in _TypeScript_ and compiled for the target.
* Builders for the following use cases:
* Specific to _Node.js_: create deep data models `Tool` or `Component` from PackageJson-like data structures
* Implementation of the [_CycloneDX_ Specification][CycloneDX-spec] for the following versions:
* `1.5`
* `1.4`
* `1.3`
* `1.2`
Expand Down
6 changes: 4 additions & 2 deletions res/schema/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Resources: Schema files

some schema for offline use as download via [script](../../tools/schema-downloader/download.js).
original sources: <https://github.com/CycloneDX/specification/tree/master/schema>
original sources: <https://github.com/CycloneDX/specification/blob/1.5>

Currently using version
[ef71717ae0ecb564c0b4c9536d6e9e57e35f2e69](https://github.com/CycloneDX/specification/tree/ef71717ae0ecb564c0b4c9536d6e9e57e35f2e69/schema)
[c320fc0f0b46873864927d9d5684eea7ba439728](https://github.com/CycloneDX/specification/commit/c320fc0f0b46873864927d9d5684eea7ba439728)

| file | note |
|------|------|
Expand All @@ -13,9 +13,11 @@ Currently using version
| [`bom-1.2.SNAPSHOT.xsd`](bom-1.2.SNAPSHOT.xsd) | applied changes: 1 |
| [`bom-1.3.SNAPSHOT.xsd`](bom-1.3.SNAPSHOT.xsd) | applied changes: 1 |
| [`bom-1.4.SNAPSHOT.xsd`](bom-1.4.SNAPSHOT.xsd) | applied changes: 1 |
| [`bom-1.5.SNAPSHOT.xsd`](bom-1.5.SNAPSHOT.xsd) | applied changes: 1 |
| [`bom-1.2.SNAPSHOT.schema.json`](bom-1.2.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.3.SNAPSHOT.schema.json`](bom-1.3.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.4.SNAPSHOT.schema.json`](bom-1.4.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.5.SNAPSHOT.schema.json`](bom-1.5.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.2-strict.SNAPSHOT.schema.json`](bom-1.2-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.3-strict.SNAPSHOT.schema.json`](bom-1.3-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`spdx.SNAPSHOT.xsd`](spdx.SNAPSHOT.xsd) | |
Expand Down
9 changes: 8 additions & 1 deletion res/schema/bom-1.1.SNAPSHOT.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ limitations under the License.
</xs:documentation>
</xs:annotation>

<xs:simpleType name="refType">
<xs:annotation>
<xs:documentation>Identifier-DataType for interlinked elements.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>

<xs:complexType name="componentsType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="component" type="bom:component"/>
Expand Down Expand Up @@ -201,7 +208,7 @@ limitations under the License.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="bom-ref" type="xs:string">
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the component elsewhere in the BOM.
Expand Down
13 changes: 8 additions & 5 deletions res/schema/bom-1.2-strict.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
}
},
"definitions": {
"refType": {
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down Expand Up @@ -260,7 +264,7 @@
"pattern": "^[-+a-z0-9.]+/[-+a-z0-9.]+$"
},
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref should be unique.",
"default": "",
Expand Down Expand Up @@ -858,16 +862,15 @@
"additionalProperties": false,
"properties": {
"ref": {
"type": "string",
"format": "string",
"$ref": "#/definitions/refType",
"title": "Reference",
"description": "References a component by the components bom-ref attribute"
},
"dependsOn": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
"$ref": "#/definitions/refType"
},
"title": "Depends On",
"description": "The bom-ref identifiers of the components that are dependencies of this dependency object."
Expand All @@ -883,7 +886,7 @@
"additionalProperties": false,
"properties": {
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref should be unique.",
"default": "",
Expand Down
12 changes: 8 additions & 4 deletions res/schema/bom-1.2.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
}
},
"definitions": {
"refType": {
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down Expand Up @@ -248,7 +252,7 @@
"pattern": "^[-+a-z0-9.]+/[-+a-z0-9.]+$"
},
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref should be unique.",
"default": "",
Expand Down Expand Up @@ -832,7 +836,7 @@
],
"properties": {
"ref": {
"type": "string",
"$ref": "#/definitions/refType",
"format": "string",
"title": "Reference",
"description": "References a component by the components bom-ref attribute"
Expand All @@ -841,7 +845,7 @@
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
"$ref": "#/definitions/refType"
},
"title": "Depends On",
"description": "The bom-ref identifiers of the components that are dependencies of this dependency object."
Expand All @@ -856,7 +860,7 @@
],
"properties": {
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref should be unique.",
"default": "",
Expand Down
13 changes: 10 additions & 3 deletions res/schema/bom-1.2.SNAPSHOT.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ limitations under the License.
</xs:documentation>
</xs:annotation>

<xs:simpleType name="refType">
<xs:annotation>
<xs:documentation>Identifier-DataType for interlinked elements.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>

<xs:complexType name="metadata">
<xs:sequence minOccurs="0" maxOccurs="1">
<xs:element name="timestamp" type="xs:dateTime" minOccurs="0">
Expand Down Expand Up @@ -395,7 +402,7 @@ limitations under the License.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="bom-ref" type="xs:string">
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the component elsewhere in the BOM.
Expand Down Expand Up @@ -1144,7 +1151,7 @@ limitations under the License.
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="dependency" type="bom:dependencyType"/>
</xs:sequence>
<xs:attribute name="ref" type="xs:string" use="required">
<xs:attribute name="ref" type="bom:refType" use="required">
<xs:annotation>
<xs:documentation>References a component or service by the its bom-ref attribute</xs:documentation>
</xs:annotation>
Expand Down Expand Up @@ -1302,7 +1309,7 @@ limitations under the License.
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute name="bom-ref" type="xs:string">
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the service elsewhere in the BOM.
Expand Down
12 changes: 8 additions & 4 deletions res/schema/bom-1.3-strict.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
}
},
"definitions": {
"refType": {
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down Expand Up @@ -266,7 +270,7 @@
"pattern": "^[-+a-z0-9.]+/[-+a-z0-9.]+$"
},
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref should be unique."
},
Expand Down Expand Up @@ -851,15 +855,15 @@
"additionalProperties": false,
"properties": {
"ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "Reference",
"description": "References a component by the components bom-ref attribute"
},
"dependsOn": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
"$ref": "#/definitions/refType"
},
"title": "Depends On",
"description": "The bom-ref identifiers of the components that are dependencies of this dependency object."
Expand All @@ -875,7 +879,7 @@
"additionalProperties": false,
"properties": {
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref should be unique."
},
Expand Down
12 changes: 8 additions & 4 deletions res/schema/bom-1.3.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
}
},
"definitions": {
"refType": {
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down Expand Up @@ -254,7 +258,7 @@
"pattern": "^[-+a-z0-9.]+/[-+a-z0-9.]+$"
},
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref should be unique."
},
Expand Down Expand Up @@ -825,15 +829,15 @@
],
"properties": {
"ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "Reference",
"description": "References a component by the components bom-ref attribute"
},
"dependsOn": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
"$ref": "#/definitions/refType"
},
"title": "Depends On",
"description": "The bom-ref identifiers of the components that are dependencies of this dependency object."
Expand All @@ -848,7 +852,7 @@
],
"properties": {
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref should be unique."
},
Expand Down
Loading