Skip to content

Commit

Permalink
🧹 add bom ref (#4370)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock authored Jul 22, 2024
1 parent f395906 commit f7cd077
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sbom/cyclonedx.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ func (ccx *CycloneDX) convertToCycloneDx(bom *Sbom) (*cyclonedx.BOM, error) {
Tools: &cyclonedx.ToolsChoice{
Components: &[]cyclonedx.Component{
{
Type: cyclonedx.ComponentTypeApplication,
Author: bom.Generator.Vendor,
Name: bom.Generator.Name,
Version: bom.Generator.Version,
},
},
},
Component: &cyclonedx.Component{
// BOMRef: string(bomRef),
BOMRef: uuid.New().String(),
// TODO: understand the device type
// Type: cyclonedx.ComponentTypeContainer,
Type: cyclonedx.ComponentTypeDevice,
Expand All @@ -62,6 +63,7 @@ func (ccx *CycloneDX) convertToCycloneDx(bom *Sbom) (*cyclonedx.BOM, error) {
}

components = append(components, cyclonedx.Component{
BOMRef: uuid.New().String(),
Type: cyclonedx.ComponentTypeOS,
Name: bom.Asset.Platform.Name,
Version: bom.Asset.Platform.Version,
Expand Down Expand Up @@ -104,6 +106,7 @@ func (ccx *CycloneDX) convertToCycloneDx(bom *Sbom) (*cyclonedx.BOM, error) {
}

bomPkg := cyclonedx.Component{
BOMRef: uuid.New().String(), // temporary, we need to store the relationships next
Type: cyclonedx.ComponentTypeLibrary,
Name: pkg.Name,
Version: pkg.Version,
Expand Down

0 comments on commit f7cd077

Please sign in to comment.