voltone / sbom

Mix task to generate a Software Bill-of-Materials (SBoM) in CycloneDX format
BSD 3-Clause "New" or "Revised" License
36 stars 16 forks source link

Sbom missing primary component #7

Open TraceyOnim opened 2 years ago

TraceyOnim commented 2 years ago

when feeding bom.xml into other SBOM tools, they complain the file fails cyclonedx checks. This is because its missing the primary component(component in the metadata) i.e

<metadata>
        <timestamp>2022-02-28T07:23:43.664Z</timestamp>
        <tools>
            <tool>
                <vendor>CycloneDX</vendor>
                <name>Node.js module</name>
                <version>3.4.1</version>
            </tool>
        </tools>
        <component type="library">
            <name>NO-NAME-PACKAGE</name>
            <version/>
            <description>
                <![CDATA[ ]]>
            </description>
            <licenses>
                <license>
                    <id>MIT</id>
                </license>
            </licenses>
        </component>
    </metadata>

The example above is a generated bom file with a primary component

TraceyOnim commented 2 years ago

@voltone please let me know if this makes sense, or if there is a reason behind the primary component not being included in the metadata and can it be doable

voltone commented 2 years ago

Hmm, according to the spec this element is optional:

  <xs:element name="component" type="bom:component" minOccurs="0">
    <xs:annotation>
      <xs:documentation>The component that the BOM describes.</xs:documentation>
    </xs:annotation>
  </xs:element>

It might make sense to add it, but I don't think other tools should fail to process a file that doesn't include it. Does the other tool support CycloneDX 1.1? That might work around the issue for now...

sigu commented 2 years ago

What is this The component that the BOM describes , is it the application or library that we are running the bom from?

joshprice commented 1 year ago

@joestein pointed out that this currently prevents GUAC from ingesting Elxiir SBoMs. See this issue for more info https://github.com/guacsec/guac/issues/1162