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

feat(results): update cyclonedx reports to support v1.5 #6841

Merged
merged 8 commits into from
Jan 17, 2024
6 changes: 4 additions & 2 deletions pkg/report/model/cyclonedx.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ func InitCycloneDxReport() *CycloneDxReport {
},
},
}

// Update cycloneDX version to 1.5 (from 1.3 to 1.5 nothing needed to change since we only create 1 bom at a time,
// more changes to come)
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 Expand Up @@ -268,5 +269,6 @@ func BuildCycloneDxReport(summary *model.Summary, filePaths map[string]string) *

bom.Components.Components = append(bom.Components.Components, component)
}

return bom
}
3 changes: 2 additions & 1 deletion pkg/report/model/cyclonedx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ var metadata Metadata = Metadata{
},
}

// Update XMLNS version to 1.5 from 1.3
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