Skip to content
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

fix(kics): support v1.5 of cyclone dx report format #6928

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -682,15 +682,15 @@ PDF reports are sorted by severity (from high to info), the results will have qu

## CycloneDX

Now, the CycloneDX report is only available in XML format since the vulnerability schema extension is not currently available in JSON. The guidelines used to build the CycloneDX report were the [bom schema 1.3](http://cyclonedx.org/schema/bom/1.3) and [vulnerability schema 1.0](https://github.com/CycloneDX/specification/blob/master/schema/ext/vulnerability-1.0.xsd).
Now, the CycloneDX report is only available in XML format since the vulnerability schema extension is not currently available in JSON. The guidelines used to build the CycloneDX report were the [bom schema 1.5](http://cyclonedx.org/schema/bom/1.5) and [vulnerability schema 1.0](https://github.com/CycloneDX/specification/blob/master/schema/ext/vulnerability-1.0.xsd).
**Note:** As of the latest update, the CycloneDX version utilized in the report is 1.5. However, it's important to clarify that no additional features or fields introduced in version 1.5 are currently utilized. The functionality remains consistent with the version 1.3 for KICS. Future updates will leverage the new features introduced in CycloneDX version 1.5.


You can export CycloneDX report by using `--report-formats "cyclonedx"`. The generated report file will have a prefix `cyclonedx-` and looks like the following example:

```
<?xml version="1.0" encoding="UTF-8"?>
<bom xmlns="http://cyclonedx.org/schema/bom/1.3" serialNumber="urn:uuid:031053e5-97fa-4776-bd4b-d8705b37748c" xmlns:v="http://cyclonedx.org/schema/ext/vulnerability/1.0" version="1">
<bom xmlns="http://cyclonedx.org/schema/bom/1.5" serialNumber="urn:uuid:031053e5-97fa-4776-bd4b-d8705b37748c" xmlns:v="http://cyclonedx.org/schema/ext/vulnerability/1.0" version="1">
<metadata>
<timestamp>2024-02-14T12:21:17Z</timestamp>
<tools>
Expand Down
2 changes: 1 addition & 1 deletion pkg/report/model/cyclonedx.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func InitCycloneDxReport() *CycloneDxReport {
}

return &CycloneDxReport{
XMLNS: "http://cyclonedx.org/schema/bom/1.3",
XMLNS: "http://cyclonedx.org/schema/bom/1.5",
XMLNSV: "http://cyclonedx.org/schema/ext/vulnerability/1.0",
SerialNumber: "urn:uuid:" + uuid.New().String(),
Version: 1,
Expand Down
2 changes: 1 addition & 1 deletion pkg/report/model/cyclonedx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var metadata Metadata = Metadata{
}

var initCycloneDxReport CycloneDxReport = CycloneDxReport{
XMLNS: "http://cyclonedx.org/schema/bom/1.3",
XMLNS: "http://cyclonedx.org/schema/bom/1.5",
XMLNSV: "http://cyclonedx.org/schema/ext/vulnerability/1.0",
SerialNumber: "urn:uuid:", // set to "urn:uuid:" because it will be different for every report
Version: 1,
Expand Down
Loading