cyclonedx.model.definition

Module Contents

Classes

CreId

Helper class that allows us to perform validation on data strings that must conform to

Requirement

A requirement comprising a standard.

Level

Level of compliance for a standard.

Standard

A standard of regulations, industry or organizational-specific standards, maturity models, best practices,

Definitions

The repository for definitions

class cyclonedx.model.definition.CreId(id: str)

Bases: py_serializable.helpers.BaseHelper

Helper class that allows us to perform validation on data strings that must conform to Common Requirements Enumeration (CRE) identifier(s).

property id: str
classmethod serialize(o: Any) → str

general purpose serializer

classmethod deserialize(o: Any) → _T_CreId

general purpose deserializer

classmethod json_normalize(o: Any, *, view: Optional[Type[py_serializable.ViewType]], prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Optional[Any]

json specific normalizer

classmethod json_serialize(o: Any) → Union[str, Any]

json specific serializer

classmethod json_denormalize(o: Any, *, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

json specific denormalizer

Parameters:
  • tCls – the class that was desired to denormalize to

  • pCls – tha prent class - as context

classmethod json_deserialize(o: Any) → Any

json specific deserializer

classmethod xml_normalize(o: Any, *, element_name: str, view: Optional[Type[py_serializable.ViewType]], xmlns: Optional[str], prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Optional[Union[xml.etree.ElementTree.Element, Any]]

xml specific normalizer

classmethod xml_serialize(o: Any) → Union[str, Any]

xml specific serializer

classmethod xml_denormalize(o: xml.etree.ElementTree.Element, *, default_ns: Optional[str], prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

xml specific denormalizer

classmethod xml_deserialize(o: Union[str, Any]) → Any

xml specific deserializer

class cyclonedx.model.definition.Requirement(*, bom_ref: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, identifier: Optional[str] = None, title: Optional[str] = None, text: Optional[str] = None, descriptions: Optional[collections.abc.Iterable[str]] = None, open_cre: Optional[collections.abc.Iterable[CreId]] = None, parent: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, properties: Optional[collections.abc.Iterable[cyclonedx.model.Property]] = None, external_references: Optional[collections.abc.Iterable[cyclonedx.model.ExternalReference]] = None)

A requirement comprising a standard.

property bom_ref: cyclonedx.model.bom_ref.BomRef

An optional identifier which can be used to reference the requirement elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.

Returns:

BomRef

property identifier: Optional[str]
Returns:

The identifier of the requirement.

property title: Optional[str]
Returns:

The title of the requirement.

property text: Optional[str]
Returns:

The text of the requirement.

property descriptions: SortedSet[str]
Returns:

A SortedSet of descriptions of the requirement.

property open_cre: SortedSet[CreId]

CRE is a structured and standardized framework for uniting security standards and guidelines. CRE links each section of a resource to a shared topic identifier (a Common Requirement). Through this shared topic link, all resources map to each other. Use of CRE promotes clear and unambiguous communication among stakeholders.

Returns:

The Common Requirements Enumeration (CRE) identifier(s). CREs must match regular expression: ^CRE:[0-9]+-[0-9]+$

property parent: Optional[cyclonedx.model.bom_ref.BomRef]
Returns:

The optional bom-ref to a parent requirement. This establishes a hierarchy of requirements. Top-level requirements must not define a parent. Only child requirements should define parents.

property properties: SortedSet[Property]

Provides the ability to document properties in a key/value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions.

Return:

Set of Property

property external_references: SortedSet[ExternalReference]

Provides the ability to document external references related to the component or to the project the component describes.

Returns:

Set of ExternalReference

class cyclonedx.model.definition.Level(*, bom_ref: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, identifier: Optional[str] = None, title: Optional[str] = None, description: Optional[str] = None, requirements: Optional[collections.abc.Iterable[Union[str, cyclonedx.model.bom_ref.BomRef]]] = None)

Level of compliance for a standard.

property bom_ref: cyclonedx.model.bom_ref.BomRef

An optional identifier which can be used to reference the level elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.

Returns:

BomRef

property identifier: Optional[str]
Returns:

The identifier of the level.

property title: Optional[str]
Returns:

The title of the level.

property description: Optional[str]
Returns:

The description of the level.

property requirements: SortedSet[BomRef]
Returns:

A SortedSet of requirements associated with the level.

class cyclonedx.model.definition.Standard(*, bom_ref: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, name: Optional[str] = None, version: Optional[str] = None, description: Optional[str] = None, owner: Optional[str] = None, requirements: Optional[collections.abc.Iterable[Requirement]] = None, levels: Optional[collections.abc.Iterable[Level]] = None, external_references: Optional[collections.abc.Iterable[cyclonedx.model.ExternalReference]] = None)

A standard of regulations, industry or organizational-specific standards, maturity models, best practices, or any other requirements.

Note

See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/xml/#type_standard

property bom_ref: cyclonedx.model.bom_ref.BomRef

An optional identifier which can be used to reference the standard elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.

Returns:

BomRef

property name: Optional[str]
Returns:

The name of the standard

property version: Optional[str]
Returns:

The version of the standard

property description: Optional[str]
Returns:

The description of the standard

property owner: Optional[str]
Returns:

The owner of the standard, often the entity responsible for its release.

property requirements: SortedSet[Requirement]
Returns:

A SortedSet of requirements comprising the standard.

property levels: SortedSet[Level]
Returns:

A SortedSet of levels associated with the standard. Some standards have different levels of compliance.

property external_references: SortedSet[ExternalReference]
Returns:

A SortedSet of external references associated with the standard.

class cyclonedx.model.definition.Definitions(*, standards: Optional[collections.abc.Iterable[Standard]] = None)

The repository for definitions

Note

See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/xml/#type_definitionsType

property standards: SortedSet[Standard]
Returns:

A SortedSet of Standards