cyclonedx.model.bom =================== .. py:module:: cyclonedx.model.bom Classes ------- .. autoapisummary:: cyclonedx.model.bom.TlpClassification cyclonedx.model.bom.DistributionConstraints cyclonedx.model.bom.BomMetaData cyclonedx.model.bom.Bom Module Contents --------------- .. py:class:: TlpClassification Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enum object that defines the Traffic Light Protocol (TLP) classification that controls the sharing and distribution of the data that the BOM describes. .. note:: Introduced in CycloneDX v1.7 .. note:: See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_tlpClassificationType .. py:attribute:: CLEAR :value: 'CLEAR' .. py:attribute:: GREEN :value: 'GREEN' .. py:attribute:: AMBER :value: 'AMBER' .. py:attribute:: AMBER_AND_STRICT :value: 'AMBER_AND_STRICT' .. py:attribute:: RED :value: 'RED' .. py:class:: DistributionConstraints Our internal representation of the `distributionConstraints` complex type. Conditions and constraints governing the sharing and distribution of the data or components described by this BOM. .. note:: Introduced in CycloneDX v1.7 .. note:: See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_metadata .. py:attribute:: tlp :type: TlpClassification The Traffic Light Protocol (TLP) classification that controls the sharing and distribution of the data that the BOM describes. .. py:class:: BomMetaData This is our internal representation of the metadata complex type within the CycloneDX standard. .. note:: See the CycloneDX Schema for Bom metadata: https://cyclonedx.org/docs/1.7/xml/#type_metadata .. py:attribute:: timestamp :type: datetime.datetime The date and time (in UTC) when this BomMetaData was created. .. py:attribute:: component :type: Optional[cyclonedx.model.component.Component] The (optional) component that the BOM describes. .. py:attribute:: manufacturer :type: Optional[cyclonedx.model.contact.OrganizationalEntity] The organization that created the BOM. .. py:attribute:: supplier :type: Optional[cyclonedx.model.contact.OrganizationalEntity] The organization that supplied the component that the BOM describes. .. py:attribute:: distribution_constraints :type: Optional[DistributionConstraints] Conditions and constraints governing the sharing and distribution of the data. .. py:property:: lifecycles :type: cyclonedx.model.lifecycle.LifecycleRepository An optional list of BOM lifecycle stages. .. py:property:: tools :type: cyclonedx.model.tool.ToolRepository Tools used to create this BOM. .. py:property:: authors :type: SortedSet[OrganizationalContact] The person(s) who created the BOM. .. py:property:: manufacture :type: Optional[cyclonedx.model.contact.OrganizationalEntity] The organization that manufactured the component that the BOM describes (deprecated). .. py:property:: licenses :type: cyclonedx.model.license.LicenseRepository A optional list of statements about how this BOM is licensed. .. py:property:: properties :type: SortedSet[Property] Provides the ability to document properties in a key/value store. .. py:class:: Bom This is our internal representation of a bill-of-materials (BOM). Once you have an instance of `cyclonedx.model.bom.Bom`, you can pass this to an instance of `cyclonedx.output.BaseOutput` to produce a CycloneDX document according to a specific schema version and format. .. py:attribute:: serial_number :type: uuid.UUID Unique UUID for this BOM. .. py:attribute:: version :type: int The version of this BOM. .. py:attribute:: metadata :type: BomMetaData Metadata for this BOM. .. py:attribute:: definitions :type: Optional[cyclonedx.model.definition.Definitions] Definitions for this BOM. .. py:property:: components :type: SortedSet[Component] Get all the Components currently in this Bom. .. py:property:: services :type: SortedSet[Service] Get all the Services currently in this Bom. .. py:property:: external_references :type: SortedSet[ExternalReference] Provides the ability to document external references related to the BOM. .. py:property:: dependencies :type: SortedSet[Dependency] Dependencies in this BOM. .. py:property:: properties :type: SortedSet[Property] Properties for this BOM. .. py:property:: vulnerabilities :type: SortedSet[Vulnerability] Get all the Vulnerabilities in this BOM. .. py:method:: get_component_by_purl(purl: Optional[packageurl.PackageURL]) -> Optional[cyclonedx.model.component.Component] Get a Component already in the Bom by its PURL Args: purl: An instance of `packageurl.PackageURL` to look and find `Component`. Returns: `Component` or `None` .. deprecated:: next .. py:method:: get_urn_uuid() -> str Get the unique reference for this Bom. Returns: URN formatted UUID that uniquely identified this Bom instance. .. deprecated:: next .. py:method:: has_component(component: cyclonedx.model.component.Component) -> bool Check whether this Bom contains the provided Component. Args: component: The instance of `cyclonedx.model.component.Component` to check if this Bom contains. Returns: `bool` - `True` if the supplied Component is part of this Bom, `False` otherwise. .. deprecated:: next .. py:method:: get_vulnerabilities_for_bom_ref(bom_ref: cyclonedx.model.bom_ref.BomRef) -> SortedSet[Vulnerability] Get all known Vulnerabilities that affect the supplied bom_ref. Args: bom_ref: `BomRef` Returns: `SortedSet` of `Vulnerability` .. deprecated:: next Deprecated without any replacement. .. py:method:: has_vulnerabilities() -> bool Check whether this Bom has any declared vulnerabilities. Returns: `bool` - `True` if this Bom has at least one Vulnerability, `False` otherwise. .. deprecated:: next Deprecated without any replacement. .. py:method:: register_dependency(target: cyclonedx.model.dependency.Dependable, depends_on: Optional[collections.abc.Iterable[cyclonedx.model.dependency.Dependable]] = None) -> None .. py:method:: urn() -> str .. deprecated:: next Deprecated without any replacement. .. py:method:: validate() -> bool Perform data-model level validations to make sure we have some known data integrity prior to attempting output of this `Bom` Returns: `bool` .. deprecated:: next Deprecated without any replacement. .. py:method:: from_json(data: Union[dict, str, bytes]) -> Bom :classmethod: Create a Bom from JSON data. Args: data: JSON data as a dict, string, or bytes Returns: A new Bom instance .. py:method:: from_xml(data: Union[xml.etree.ElementTree.Element, str, bytes, Any]) -> Bom :classmethod: Create a Bom from XML data. Args: data: XML data as an Element, string, bytes, or file-like object Returns: A new Bom instance