:py:mod:`cyclonedx.model.vulnerability`
=======================================

.. py:module:: cyclonedx.model.vulnerability

.. autoapi-nested-parse::

   This set of classes represents the data that is possible about known Vulnerabilities.

   Prior to CycloneDX schema version 1.4, vulnerabilities were possible in XML versions ONLY of the standard through
   a schema extension: https://cyclonedx.org/ext/vulnerability.

   Since CycloneDX schema version 1.4, this has become part of the core schema.

   .. note::
       See the CycloneDX Schema extension definition https://cyclonedx.org/docs/1.7/xml/#type_vulnerabilitiesType



Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   cyclonedx.model.vulnerability.BomTargetVersionRange
   cyclonedx.model.vulnerability.BomTarget
   cyclonedx.model.vulnerability.VulnerabilityAnalysis
   cyclonedx.model.vulnerability.VulnerabilityAdvisory
   cyclonedx.model.vulnerability.VulnerabilitySource
   cyclonedx.model.vulnerability.VulnerabilityReference
   cyclonedx.model.vulnerability.VulnerabilityScoreSource
   cyclonedx.model.vulnerability.VulnerabilitySeverity
   cyclonedx.model.vulnerability.VulnerabilityRating
   cyclonedx.model.vulnerability.VulnerabilityCredits
   cyclonedx.model.vulnerability.Vulnerability




.. py:class:: BomTargetVersionRange(*, version: Optional[str] = None, range: Optional[str] = None, status: Optional[cyclonedx.model.impact_analysis.ImpactAnalysisAffectedStatus] = None)


   Class that represents either a version or version range and its affected status.

   `version` and `version_range` are mutually exclusive.

   .. note::
       See the CycloneDX schema:
       https://cyclonedx.org/docs/1.7/json/#tab-pane_vulnerabilities_items_affects_items_versions_items_oneOf_i0

   .. py:property:: version
      :type: Optional[str]

      A single version of a component or service.


   .. py:property:: range
      :type: Optional[str]

      A version range specified in Package URL Version Range syntax (vers) which is defined at
      https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst

      .. note::
          The VERSION-RANGE-SPEC from Package URL is not a formalised standard at the time of writing and this no
          validation of conformance with this draft standard is performed.


   .. py:property:: status
      :type: Optional[cyclonedx.model.impact_analysis.ImpactAnalysisAffectedStatus]

      The vulnerability status for the version or range of versions.



.. py:class:: BomTarget(*, ref: str, versions: Optional[collections.abc.Iterable[BomTargetVersionRange]] = None)


   Class that represents referencing a Component or Service in a BOM.

   Aims to represent the sub-element `target` of the complex type `vulnerabilityType`.

   You can either create a `cyclonedx.model.bom.Bom` yourself programmatically, or generate a `cyclonedx.model.bom.Bom`
   from a `cyclonedx.parser.BaseParser` implementation.

   .. note::
       See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_affects

   .. py:property:: ref
      :type: str

      Reference to a component or service by the objects `bom-ref`.


   .. py:property:: versions
      :type: SortedSet[BomTargetVersionRange]

      Zero or more individual versions or range of versions.

      Returns:
          Set of `BomTargetVersionRange`



.. py:class:: VulnerabilityAnalysis(*, state: Optional[cyclonedx.model.impact_analysis.ImpactAnalysisState] = None, justification: Optional[cyclonedx.model.impact_analysis.ImpactAnalysisJustification] = None, responses: Optional[collections.abc.Iterable[cyclonedx.model.impact_analysis.ImpactAnalysisResponse]] = None, detail: Optional[str] = None, first_issued: Optional[datetime.datetime] = None, last_updated: Optional[datetime.datetime] = None)


   Class that models the `analysis` sub-element of the `vulnerabilityType` complex type.

   .. note::
       See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_analysis

   .. py:property:: state
      :type: Optional[cyclonedx.model.impact_analysis.ImpactAnalysisState]

      The declared current state of an occurrence of a vulnerability, after automated or manual analysis.

      Returns:
          `ImpactAnalysisState` if set else `None`


   .. py:property:: justification
      :type: Optional[cyclonedx.model.impact_analysis.ImpactAnalysisJustification]

      The rationale of why the impact analysis state was asserted.

      Returns:
          `ImpactAnalysisJustification` if set else `None`


   .. py:property:: responses
      :type: SortedSet[ImpactAnalysisResponse]

      A list of responses to the vulnerability by the manufacturer, supplier, or project responsible for the
      affected component or service. More than one response is allowed. Responses are strongly encouraged for
      vulnerabilities where the analysis state is exploitable.

      Returns:
          Set of `ImpactAnalysisResponse`


   .. py:property:: detail
      :type: Optional[str]

      A detailed description of the impact including methods used during assessment. If a vulnerability is not
      exploitable, this field should include specific details on why the component or service is not impacted by this
      vulnerability.

      Returns:
          `str` if set else `None`


   .. py:property:: first_issued
      :type: Optional[datetime.datetime]


   .. py:property:: last_updated
      :type: Optional[datetime.datetime]



.. py:class:: VulnerabilityAdvisory(*, url: cyclonedx.model.XsUri, title: Optional[str] = None)


   Class that models the `advisoryType` complex type.

   .. note::
       See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_advisories

   .. py:property:: title
      :type: Optional[str]

      The title of this advisory.


   .. py:property:: url
      :type: cyclonedx.model.XsUri

      The url of this advisory.



.. py:class:: VulnerabilitySource(*, name: Optional[str] = None, url: Optional[cyclonedx.model.XsUri] = None)


   Class that models the `vulnerabilitySourceType` complex type.

   This type is used for multiple purposes in the CycloneDX schema.

   .. note::
       See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_source

   .. py:property:: name
      :type: Optional[str]

      Name of this Source.


   .. py:property:: url
      :type: Optional[cyclonedx.model.XsUri]

      The url of this Source.



.. py:class:: VulnerabilityReference(*, id: str, source: VulnerabilitySource)


   Class that models the nested `reference` within the `vulnerabilityType` complex type.

   Vulnerabilities may benefit from pointers to vulnerabilities that are the equivalent of the vulnerability specified.
   Often times, the same vulnerability may exist in multiple sources of vulnerability intelligence, but have different
   identifiers. These references provide a way to correlate vulnerabilities across multiple sources of vulnerability
   intelligence.

   .. note::
       See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_references

   .. note::
       Properties ``id`` and ``source`` are mandatory.

       History:
       * In v1.4 JSON scheme, both properties were mandatory
         https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.4.schema.json#L1455-L1474
       * In v1.4 XML schema, both properties were optional
         https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.4.xsd#L1788-L1797
       * In v1.5 XML schema, both were mandatory
         https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.5.xsd#L3364-L3374

       Decision:
       Since CycloneDXCoreWorkingGroup chose JSON schema as the dominant schema, the one that serves as first spec
       implementation, and since XML schema was "fixed" to work same as JSON schema, we'd consider it canon/spec that
       both properties were always mandatory.

   .. py:property:: id
      :type: str

      The identifier that uniquely identifies the vulnerability in the associated Source. For example: CVE-2021-39182.


   .. py:property:: source
      :type: VulnerabilitySource

      The source that published the vulnerability.



.. py:class:: VulnerabilityScoreSource


   Bases: :py:obj:`str`, :py:obj:`enum.Enum`

   Enum object that defines the permissible source types for a Vulnerability's score.

   .. note::
       See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_scoreSourceType

   .. note::
       No explicit carry-over from the former schema extension:
        https://github.com/CycloneDX/specification/blob/master/schema/ext/vulnerability-1.0.xsd

   .. py:attribute:: CVSS_V2
      :value: 'CVSSv2'

      

   .. py:attribute:: CVSS_V3
      :value: 'CVSSv3'

      

   .. py:attribute:: CVSS_V3_1
      :value: 'CVSSv31'

      

   .. py:attribute:: CVSS_V4
      :value: 'CVSSv4'

      

   .. py:attribute:: OWASP
      :value: 'OWASP'

      

   .. py:attribute:: SSVC
      :value: 'SSVC'

      

   .. py:attribute:: OTHER
      :value: 'other'

      

   .. py:method:: get_from_vector(vector: str) -> VulnerabilityScoreSource
      :staticmethod:

      Attempt to derive the correct SourceType from an attack vector.

      For example, often attack vector strings are prefixed with the scheme in question - such
      that __CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N__ would be the vector
      __AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N__ under the __CVSS 3__ scheme.

      Returns:
          Always returns an instance of `VulnerabilityScoreSource`. `VulnerabilityScoreSource.OTHER` is
          returned if the scheme is not obvious or known to us.


   .. py:method:: get_localised_vector(vector: str) -> str

      This method will remove any Source Scheme type from the supplied vector, returning just the vector.

      .. Note::
          Currently supports CVSS 3.x, CVSS 2.x and OWASP schemes.

      Returns:
          The vector without any scheme prefix as a `str`.


   .. py:method:: get_value_pre_1_4() -> str

      Some of the enum values changed in 1.4 of the CycloneDX spec. This method allows us to
      backport some of the changes for pre-1.4.

      Returns:
          `str`


   .. py:method:: capitalize()

      Return a capitalized version of the string.

      More specifically, make the first character have upper case and the rest lower
      case.


   .. py:method:: casefold()

      Return a version of the string suitable for caseless comparisons.


   .. py:method:: center()

      Return a centered string of length width.

      Padding is done using the specified fill character (default is a space).


   .. py:method:: count()

      S.count(sub[, start[, end]]) -> int

      Return the number of non-overlapping occurrences of substring sub in
      string S[start:end].  Optional arguments start and end are
      interpreted as in slice notation.


   .. py:method:: encode()

      Encode the string using the codec registered for encoding.

      encoding
        The encoding in which to encode the string.
      errors
        The error handling scheme to use for encoding errors.
        The default is 'strict' meaning that encoding errors raise a
        UnicodeEncodeError.  Other possible values are 'ignore', 'replace' and
        'xmlcharrefreplace' as well as any other name registered with
        codecs.register_error that can handle UnicodeEncodeErrors.


   .. py:method:: endswith()

      S.endswith(suffix[, start[, end]]) -> bool

      Return True if S ends with the specified suffix, False otherwise.
      With optional start, test S beginning at that position.
      With optional end, stop comparing S at that position.
      suffix can also be a tuple of strings to try.


   .. py:method:: expandtabs()

      Return a copy where all tab characters are expanded using spaces.

      If tabsize is not given, a tab size of 8 characters is assumed.


   .. py:method:: find()

      S.find(sub[, start[, end]]) -> int

      Return the lowest index in S where substring sub is found,
      such that sub is contained within S[start:end].  Optional
      arguments start and end are interpreted as in slice notation.

      Return -1 on failure.


   .. py:method:: format()

      S.format(*args, **kwargs) -> str

      Return a formatted version of S, using substitutions from args and kwargs.
      The substitutions are identified by braces ('{' and '}').


   .. py:method:: format_map()

      S.format_map(mapping) -> str

      Return a formatted version of S, using substitutions from mapping.
      The substitutions are identified by braces ('{' and '}').


   .. py:method:: index()

      S.index(sub[, start[, end]]) -> int

      Return the lowest index in S where substring sub is found,
      such that sub is contained within S[start:end].  Optional
      arguments start and end are interpreted as in slice notation.

      Raises ValueError when the substring is not found.


   .. py:method:: isalnum()

      Return True if the string is an alpha-numeric string, False otherwise.

      A string is alpha-numeric if all characters in the string are alpha-numeric and
      there is at least one character in the string.


   .. py:method:: isalpha()

      Return True if the string is an alphabetic string, False otherwise.

      A string is alphabetic if all characters in the string are alphabetic and there
      is at least one character in the string.


   .. py:method:: isascii()

      Return True if all characters in the string are ASCII, False otherwise.

      ASCII characters have code points in the range U+0000-U+007F.
      Empty string is ASCII too.


   .. py:method:: isdecimal()

      Return True if the string is a decimal string, False otherwise.

      A string is a decimal string if all characters in the string are decimal and
      there is at least one character in the string.


   .. py:method:: isdigit()

      Return True if the string is a digit string, False otherwise.

      A string is a digit string if all characters in the string are digits and there
      is at least one character in the string.


   .. py:method:: isidentifier()

      Return True if the string is a valid Python identifier, False otherwise.

      Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
      such as "def" or "class".


   .. py:method:: islower()

      Return True if the string is a lowercase string, False otherwise.

      A string is lowercase if all cased characters in the string are lowercase and
      there is at least one cased character in the string.


   .. py:method:: isnumeric()

      Return True if the string is a numeric string, False otherwise.

      A string is numeric if all characters in the string are numeric and there is at
      least one character in the string.


   .. py:method:: isprintable()

      Return True if the string is printable, False otherwise.

      A string is printable if all of its characters are considered printable in
      repr() or if it is empty.


   .. py:method:: isspace()

      Return True if the string is a whitespace string, False otherwise.

      A string is whitespace if all characters in the string are whitespace and there
      is at least one character in the string.


   .. py:method:: istitle()

      Return True if the string is a title-cased string, False otherwise.

      In a title-cased string, upper- and title-case characters may only
      follow uncased characters and lowercase characters only cased ones.


   .. py:method:: isupper()

      Return True if the string is an uppercase string, False otherwise.

      A string is uppercase if all cased characters in the string are uppercase and
      there is at least one cased character in the string.


   .. py:method:: join()

      Concatenate any number of strings.

      The string whose method is called is inserted in between each given string.
      The result is returned as a new string.

      Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'


   .. py:method:: ljust()

      Return a left-justified string of length width.

      Padding is done using the specified fill character (default is a space).


   .. py:method:: lower()

      Return a copy of the string converted to lowercase.


   .. py:method:: lstrip()

      Return a copy of the string with leading whitespace removed.

      If chars is given and not None, remove characters in chars instead.


   .. py:method:: partition()

      Partition the string into three parts using the given separator.

      This will search for the separator in the string.  If the separator is found,
      returns a 3-tuple containing the part before the separator, the separator
      itself, and the part after it.

      If the separator is not found, returns a 3-tuple containing the original string
      and two empty strings.


   .. py:method:: removeprefix()

      Return a str with the given prefix string removed if present.

      If the string starts with the prefix string, return string[len(prefix):].
      Otherwise, return a copy of the original string.


   .. py:method:: removesuffix()

      Return a str with the given suffix string removed if present.

      If the string ends with the suffix string and that suffix is not empty,
      return string[:-len(suffix)]. Otherwise, return a copy of the original
      string.


   .. py:method:: replace()

      Return a copy with all occurrences of substring old replaced by new.

        count
          Maximum number of occurrences to replace.
          -1 (the default value) means replace all occurrences.

      If the optional argument count is given, only the first count occurrences are
      replaced.


   .. py:method:: rfind()

      S.rfind(sub[, start[, end]]) -> int

      Return the highest index in S where substring sub is found,
      such that sub is contained within S[start:end].  Optional
      arguments start and end are interpreted as in slice notation.

      Return -1 on failure.


   .. py:method:: rindex()

      S.rindex(sub[, start[, end]]) -> int

      Return the highest index in S where substring sub is found,
      such that sub is contained within S[start:end].  Optional
      arguments start and end are interpreted as in slice notation.

      Raises ValueError when the substring is not found.


   .. py:method:: rjust()

      Return a right-justified string of length width.

      Padding is done using the specified fill character (default is a space).


   .. py:method:: rpartition()

      Partition the string into three parts using the given separator.

      This will search for the separator in the string, starting at the end. If
      the separator is found, returns a 3-tuple containing the part before the
      separator, the separator itself, and the part after it.

      If the separator is not found, returns a 3-tuple containing two empty strings
      and the original string.


   .. py:method:: rsplit()

      Return a list of the substrings in the string, using sep as the separator string.

        sep
          The separator used to split the string.

          When set to None (the default value), will split on any whitespace
          character (including \n \r \t \f and spaces) and will discard
          empty strings from the result.
        maxsplit
          Maximum number of splits.
          -1 (the default value) means no limit.

      Splitting starts at the end of the string and works to the front.


   .. py:method:: rstrip()

      Return a copy of the string with trailing whitespace removed.

      If chars is given and not None, remove characters in chars instead.


   .. py:method:: split()

      Return a list of the substrings in the string, using sep as the separator string.

        sep
          The separator used to split the string.

          When set to None (the default value), will split on any whitespace
          character (including \n \r \t \f and spaces) and will discard
          empty strings from the result.
        maxsplit
          Maximum number of splits.
          -1 (the default value) means no limit.

      Splitting starts at the front of the string and works to the end.

      Note, str.split() is mainly useful for data that has been intentionally
      delimited.  With natural text that includes punctuation, consider using
      the regular expression module.


   .. py:method:: splitlines()

      Return a list of the lines in the string, breaking at line boundaries.

      Line breaks are not included in the resulting list unless keepends is given and
      true.


   .. py:method:: startswith()

      S.startswith(prefix[, start[, end]]) -> bool

      Return True if S starts with the specified prefix, False otherwise.
      With optional start, test S beginning at that position.
      With optional end, stop comparing S at that position.
      prefix can also be a tuple of strings to try.


   .. py:method:: strip()

      Return a copy of the string with leading and trailing whitespace removed.

      If chars is given and not None, remove characters in chars instead.


   .. py:method:: swapcase()

      Convert uppercase characters to lowercase and lowercase characters to uppercase.


   .. py:method:: title()

      Return a version of the string where each word is titlecased.

      More specifically, words start with uppercased characters and all remaining
      cased characters have lower case.


   .. py:method:: translate()

      Replace each character in the string using the given translation table.

        table
          Translation table, which must be a mapping of Unicode ordinals to
          Unicode ordinals, strings, or None.

      The table must implement lookup/indexing via __getitem__, for instance a
      dictionary or list.  If this operation raises LookupError, the character is
      left untouched.  Characters mapped to None are deleted.


   .. py:method:: upper()

      Return a copy of the string converted to uppercase.


   .. py:method:: zfill()

      Pad a numeric string with zeros on the left, to fill a field of the given width.

      The string is never truncated.


   .. py:method:: name()

      The name of the Enum member.


   .. py:method:: value()

      The value of the Enum member.



.. py:class:: VulnerabilitySeverity


   Bases: :py:obj:`str`, :py:obj:`enum.Enum`

   Class that defines the permissible severities for a Vulnerability.

   .. note::
       See the CycloneDX schema: https://cyclonedx.org/docs/1.7/xml/#type_severityType

   .. py:attribute:: NONE
      :value: 'none'

      

   .. py:attribute:: INFO
      :value: 'info'

      

   .. py:attribute:: LOW
      :value: 'low'

      

   .. py:attribute:: MEDIUM
      :value: 'medium'

      

   .. py:attribute:: HIGH
      :value: 'high'

      

   .. py:attribute:: CRITICAL
      :value: 'critical'

      

   .. py:attribute:: UNKNOWN
      :value: 'unknown'

      

   .. py:method:: get_from_cvss_scores(scores: Union[tuple[float, Ellipsis], float, None]) -> VulnerabilitySeverity
      :staticmethod:

      Deprecated — Alias of :func:`cyclonedx.contrib.vulnerability.cvss.vs_from_cvss_scores()`.

      Derives the Severity of a Vulnerability from it's declared CVSS scores.

      .. deprecated:: next
          Use ``cyclonedx.contrib.vulnerability.cvss.vs_from_cvss_scores()`` instead.


   .. py:method:: capitalize()

      Return a capitalized version of the string.

      More specifically, make the first character have upper case and the rest lower
      case.


   .. py:method:: casefold()

      Return a version of the string suitable for caseless comparisons.


   .. py:method:: center()

      Return a centered string of length width.

      Padding is done using the specified fill character (default is a space).


   .. py:method:: count()

      S.count(sub[, start[, end]]) -> int

      Return the number of non-overlapping occurrences of substring sub in
      string S[start:end].  Optional arguments start and end are
      interpreted as in slice notation.


   .. py:method:: encode()

      Encode the string using the codec registered for encoding.

      encoding
        The encoding in which to encode the string.
      errors
        The error handling scheme to use for encoding errors.
        The default is 'strict' meaning that encoding errors raise a
        UnicodeEncodeError.  Other possible values are 'ignore', 'replace' and
        'xmlcharrefreplace' as well as any other name registered with
        codecs.register_error that can handle UnicodeEncodeErrors.


   .. py:method:: endswith()

      S.endswith(suffix[, start[, end]]) -> bool

      Return True if S ends with the specified suffix, False otherwise.
      With optional start, test S beginning at that position.
      With optional end, stop comparing S at that position.
      suffix can also be a tuple of strings to try.


   .. py:method:: expandtabs()

      Return a copy where all tab characters are expanded using spaces.

      If tabsize is not given, a tab size of 8 characters is assumed.


   .. py:method:: find()

      S.find(sub[, start[, end]]) -> int

      Return the lowest index in S where substring sub is found,
      such that sub is contained within S[start:end].  Optional
      arguments start and end are interpreted as in slice notation.

      Return -1 on failure.


   .. py:method:: format()

      S.format(*args, **kwargs) -> str

      Return a formatted version of S, using substitutions from args and kwargs.
      The substitutions are identified by braces ('{' and '}').


   .. py:method:: format_map()

      S.format_map(mapping) -> str

      Return a formatted version of S, using substitutions from mapping.
      The substitutions are identified by braces ('{' and '}').


   .. py:method:: index()

      S.index(sub[, start[, end]]) -> int

      Return the lowest index in S where substring sub is found,
      such that sub is contained within S[start:end].  Optional
      arguments start and end are interpreted as in slice notation.

      Raises ValueError when the substring is not found.


   .. py:method:: isalnum()

      Return True if the string is an alpha-numeric string, False otherwise.

      A string is alpha-numeric if all characters in the string are alpha-numeric and
      there is at least one character in the string.


   .. py:method:: isalpha()

      Return True if the string is an alphabetic string, False otherwise.

      A string is alphabetic if all characters in the string are alphabetic and there
      is at least one character in the string.


   .. py:method:: isascii()

      Return True if all characters in the string are ASCII, False otherwise.

      ASCII characters have code points in the range U+0000-U+007F.
      Empty string is ASCII too.


   .. py:method:: isdecimal()

      Return True if the string is a decimal string, False otherwise.

      A string is a decimal string if all characters in the string are decimal and
      there is at least one character in the string.


   .. py:method:: isdigit()

      Return True if the string is a digit string, False otherwise.

      A string is a digit string if all characters in the string are digits and there
      is at least one character in the string.


   .. py:method:: isidentifier()

      Return True if the string is a valid Python identifier, False otherwise.

      Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
      such as "def" or "class".


   .. py:method:: islower()

      Return True if the string is a lowercase string, False otherwise.

      A string is lowercase if all cased characters in the string are lowercase and
      there is at least one cased character in the string.


   .. py:method:: isnumeric()

      Return True if the string is a numeric string, False otherwise.

      A string is numeric if all characters in the string are numeric and there is at
      least one character in the string.


   .. py:method:: isprintable()

      Return True if the string is printable, False otherwise.

      A string is printable if all of its characters are considered printable in
      repr() or if it is empty.


   .. py:method:: isspace()

      Return True if the string is a whitespace string, False otherwise.

      A string is whitespace if all characters in the string are whitespace and there
      is at least one character in the string.


   .. py:method:: istitle()

      Return True if the string is a title-cased string, False otherwise.

      In a title-cased string, upper- and title-case characters may only
      follow uncased characters and lowercase characters only cased ones.


   .. py:method:: isupper()

      Return True if the string is an uppercase string, False otherwise.

      A string is uppercase if all cased characters in the string are uppercase and
      there is at least one cased character in the string.


   .. py:method:: join()

      Concatenate any number of strings.

      The string whose method is called is inserted in between each given string.
      The result is returned as a new string.

      Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'


   .. py:method:: ljust()

      Return a left-justified string of length width.

      Padding is done using the specified fill character (default is a space).


   .. py:method:: lower()

      Return a copy of the string converted to lowercase.


   .. py:method:: lstrip()

      Return a copy of the string with leading whitespace removed.

      If chars is given and not None, remove characters in chars instead.


   .. py:method:: partition()

      Partition the string into three parts using the given separator.

      This will search for the separator in the string.  If the separator is found,
      returns a 3-tuple containing the part before the separator, the separator
      itself, and the part after it.

      If the separator is not found, returns a 3-tuple containing the original string
      and two empty strings.


   .. py:method:: removeprefix()

      Return a str with the given prefix string removed if present.

      If the string starts with the prefix string, return string[len(prefix):].
      Otherwise, return a copy of the original string.


   .. py:method:: removesuffix()

      Return a str with the given suffix string removed if present.

      If the string ends with the suffix string and that suffix is not empty,
      return string[:-len(suffix)]. Otherwise, return a copy of the original
      string.


   .. py:method:: replace()

      Return a copy with all occurrences of substring old replaced by new.

        count
          Maximum number of occurrences to replace.
          -1 (the default value) means replace all occurrences.

      If the optional argument count is given, only the first count occurrences are
      replaced.


   .. py:method:: rfind()

      S.rfind(sub[, start[, end]]) -> int

      Return the highest index in S where substring sub is found,
      such that sub is contained within S[start:end].  Optional
      arguments start and end are interpreted as in slice notation.

      Return -1 on failure.


   .. py:method:: rindex()

      S.rindex(sub[, start[, end]]) -> int

      Return the highest index in S where substring sub is found,
      such that sub is contained within S[start:end].  Optional
      arguments start and end are interpreted as in slice notation.

      Raises ValueError when the substring is not found.


   .. py:method:: rjust()

      Return a right-justified string of length width.

      Padding is done using the specified fill character (default is a space).


   .. py:method:: rpartition()

      Partition the string into three parts using the given separator.

      This will search for the separator in the string, starting at the end. If
      the separator is found, returns a 3-tuple containing the part before the
      separator, the separator itself, and the part after it.

      If the separator is not found, returns a 3-tuple containing two empty strings
      and the original string.


   .. py:method:: rsplit()

      Return a list of the substrings in the string, using sep as the separator string.

        sep
          The separator used to split the string.

          When set to None (the default value), will split on any whitespace
          character (including \n \r \t \f and spaces) and will discard
          empty strings from the result.
        maxsplit
          Maximum number of splits.
          -1 (the default value) means no limit.

      Splitting starts at the end of the string and works to the front.


   .. py:method:: rstrip()

      Return a copy of the string with trailing whitespace removed.

      If chars is given and not None, remove characters in chars instead.


   .. py:method:: split()

      Return a list of the substrings in the string, using sep as the separator string.

        sep
          The separator used to split the string.

          When set to None (the default value), will split on any whitespace
          character (including \n \r \t \f and spaces) and will discard
          empty strings from the result.
        maxsplit
          Maximum number of splits.
          -1 (the default value) means no limit.

      Splitting starts at the front of the string and works to the end.

      Note, str.split() is mainly useful for data that has been intentionally
      delimited.  With natural text that includes punctuation, consider using
      the regular expression module.


   .. py:method:: splitlines()

      Return a list of the lines in the string, breaking at line boundaries.

      Line breaks are not included in the resulting list unless keepends is given and
      true.


   .. py:method:: startswith()

      S.startswith(prefix[, start[, end]]) -> bool

      Return True if S starts with the specified prefix, False otherwise.
      With optional start, test S beginning at that position.
      With optional end, stop comparing S at that position.
      prefix can also be a tuple of strings to try.


   .. py:method:: strip()

      Return a copy of the string with leading and trailing whitespace removed.

      If chars is given and not None, remove characters in chars instead.


   .. py:method:: swapcase()

      Convert uppercase characters to lowercase and lowercase characters to uppercase.


   .. py:method:: title()

      Return a version of the string where each word is titlecased.

      More specifically, words start with uppercased characters and all remaining
      cased characters have lower case.


   .. py:method:: translate()

      Replace each character in the string using the given translation table.

        table
          Translation table, which must be a mapping of Unicode ordinals to
          Unicode ordinals, strings, or None.

      The table must implement lookup/indexing via __getitem__, for instance a
      dictionary or list.  If this operation raises LookupError, the character is
      left untouched.  Characters mapped to None are deleted.


   .. py:method:: upper()

      Return a copy of the string converted to uppercase.


   .. py:method:: zfill()

      Pad a numeric string with zeros on the left, to fill a field of the given width.

      The string is never truncated.


   .. py:method:: name()

      The name of the Enum member.


   .. py:method:: value()

      The value of the Enum member.



.. py:class:: VulnerabilityRating(*, source: Optional[VulnerabilitySource] = None, score: Optional[decimal.Decimal] = None, severity: Optional[VulnerabilitySeverity] = None, method: Optional[VulnerabilityScoreSource] = None, vector: Optional[str] = None, justification: Optional[str] = None)


   Class that models the `ratingType` complex element CycloneDX core schema.

   This class previously modelled the `scoreType` complexe type in the schema extension used prior to schema version
   1.4 - see https://github.com/CycloneDX/specification/blob/master/schema/ext/vulnerability-1.0.xsd.

   .. note::
       See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_ratingType

   .. warning::
       As part of implementing support for CycloneDX schema version 1.4, the three score types defined in the schema
       extension used prior to 1.4 have been deprecated. The deprecated `score_base` should loosely be equivalent to
       the new `score` in 1.4 schema. Both `score_impact` and `score_exploitability` are deprecated and removed as
       they are redundant if you have the vector (the vector allows you to calculate the scores).

   .. py:property:: source
      :type: Optional[VulnerabilitySource]

      The source that published the vulnerability.


   .. py:property:: score
      :type: Optional[decimal.Decimal]

      The numerical score of the rating.


   .. py:property:: severity
      :type: Optional[VulnerabilitySeverity]

      The textual representation of the severity that corresponds to the numerical score of the rating.


   .. py:property:: method
      :type: Optional[VulnerabilityScoreSource]

      The risk scoring methodology/standard used.


   .. py:property:: vector
      :type: Optional[str]

      The textual representation of the metric values used to score the vulnerability - also known as the vector.


   .. py:property:: justification
      :type: Optional[str]

      An optional reason for rating the vulnerability as it was.



.. py:class:: VulnerabilityCredits(*, organizations: Optional[collections.abc.Iterable[cyclonedx.model.contact.OrganizationalEntity]] = None, individuals: Optional[collections.abc.Iterable[cyclonedx.model.contact.OrganizationalContact]] = None)


   Class that models the `credits` of `vulnerabilityType` complex type in the CycloneDX schema (version >= 1.4).

   This class also provides data support for schema versions < 1.4 where Vulnerabilites were possible through a schema
   extension (in XML only).

   .. note::
       See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_credits

   .. py:property:: organizations
      :type: SortedSet[OrganizationalEntity]

      The organizations credited with vulnerability discovery.

      Returns:
           Set of `OrganizationalEntity`


   .. py:property:: individuals
      :type: SortedSet[OrganizationalContact]

      The individuals, not associated with organizations, that are credited with vulnerability discovery.

      Returns:
          Set of `OrganizationalContact`



.. py:class:: Vulnerability(*, bom_ref: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, id: Optional[str] = None, source: Optional[VulnerabilitySource] = None, references: Optional[collections.abc.Iterable[VulnerabilityReference]] = None, ratings: Optional[collections.abc.Iterable[VulnerabilityRating]] = None, cwes: Optional[collections.abc.Iterable[int]] = None, description: Optional[str] = None, detail: Optional[str] = None, recommendation: Optional[str] = None, workaround: Optional[str] = None, advisories: Optional[collections.abc.Iterable[VulnerabilityAdvisory]] = None, created: Optional[datetime.datetime] = None, published: Optional[datetime.datetime] = None, updated: Optional[datetime.datetime] = None, credits: Optional[VulnerabilityCredits] = None, tools: Optional[Union[collections.abc.Iterable[cyclonedx.model.tool.Tool], cyclonedx.model.tool.ToolRepository]] = None, analysis: Optional[VulnerabilityAnalysis] = None, affects: Optional[collections.abc.Iterable[BomTarget]] = None, properties: Optional[collections.abc.Iterable[cyclonedx.model.Property]] = None)


   Class that models the `vulnerabilityType` complex type in the CycloneDX schema (version >= 1.4).

   This class also provides data support for schema versions < 1.4 where Vulnerabilites were possible through a schema
   extension (in XML only).

   .. note::
       See the CycloneDX schema: https://cyclonedx.org/docs/1.7/xml/#type_vulnerabilityType

   .. py:property:: bom_ref
      :type: cyclonedx.model.bom_ref.BomRef

      Get the unique reference for this Vulnerability in this BOM.

      Returns:
         `BomRef`


   .. py:property:: id
      :type: Optional[str]

      The identifier that uniquely identifies the vulnerability. For example: CVE-2021-39182.

      Returns:
          `str` if set else `None`


   .. py:property:: source
      :type: Optional[VulnerabilitySource]

      The source that published the vulnerability.

      Returns:
          `VulnerabilitySource` if set else `None`


   .. py:property:: references
      :type: SortedSet[VulnerabilityReference]

      Zero or more pointers to vulnerabilities that are the equivalent of the vulnerability specified. Often times,
      the same vulnerability may exist in multiple sources of vulnerability intelligence, but have different
      identifiers. References provides a way to correlate vulnerabilities across multiple sources of vulnerability
      intelligence.

      Returns:
          Set of `VulnerabilityReference`


   .. py:property:: ratings
      :type: SortedSet[VulnerabilityRating]

      List of vulnerability ratings.

      Returns:
          Set of `VulnerabilityRating`


   .. py:property:: cwes
      :type: SortedSet[int]

      A list of CWE (Common Weakness Enumeration) identifiers.

      .. note::
          See https://cwe.mitre.org/

      Returns:
          Set of `int`


   .. py:property:: description
      :type: Optional[str]

      A description of the vulnerability as provided by the source.

      Returns:
          `str` if set else `None`


   .. py:property:: detail
      :type: Optional[str]

      If available, an in-depth description of the vulnerability as provided by the source organization. Details
      often include examples, proof-of-concepts, and other information useful in understanding root cause.

      Returns:
          `str` if set else `None`


   .. py:property:: recommendation
      :type: Optional[str]

      Recommendations of how the vulnerability can be remediated or mitigated.

      Returns:
          `str` if set else `None`


   .. py:property:: workaround
      :type: Optional[str]

      A bypass, usually temporary, of the vulnerability that reduces its likelihood and/or impact.
      Workarounds often involve changes to configuration or deployments.

      Returns:
          `str` if set else `None`


   .. py:property:: advisories
      :type: SortedSet[VulnerabilityAdvisory]

      Advisories relating to the Vulnerability.

      Returns:
          Set of `VulnerabilityAdvisory`


   .. py:property:: created
      :type: Optional[datetime.datetime]

      The date and time (timestamp) when the vulnerability record was created in the vulnerability database.

      Returns:
          `datetime` if set else `None`


   .. py:property:: published
      :type: Optional[datetime.datetime]

      The date and time (timestamp) when the vulnerability record was first published.

      Returns:
          `datetime` if set else `None`


   .. py:property:: updated
      :type: Optional[datetime.datetime]

      The date and time (timestamp) when the vulnerability record was last updated.

      Returns:
          `datetime` if set else `None`


   .. py:property:: credits
      :type: Optional[VulnerabilityCredits]

      Individuals or organizations credited with the discovery of the vulnerability.

      Returns:
          `VulnerabilityCredits` if set else `None`


   .. py:property:: tools
      :type: cyclonedx.model.tool.ToolRepository

      Tools used to create this BOM.

      Returns:
          :class:`ToolRepository` object.


   .. py:property:: analysis
      :type: Optional[VulnerabilityAnalysis]

      Analysis of the Vulnerability in your context.

      Returns:
          `VulnerabilityAnalysis` if set else `None`


   .. py:property:: affects
      :type: SortedSet[BomTarget]

      The components or services that are affected by the vulnerability.

      Returns:
          Set of `BomTarget`


   .. py:property:: properties
      :type: 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`



