Version: 1.2.0.0

stix.exploit_target Module

Overview

The stix.exploit_target module implements ExploitTarget.

This denotes the specific vulnerability, weakness, or software configuration that creates a security risk.

Classes

class stix.exploit_target.ExploitTarget(id_=None, idref=None, timestamp=None, title=None, description=None, short_description=None)

Bases: stix.base.BaseCoreComponent

Implementation of STIX Exploit Target.

Parameters:
  • id_ (optional) – An identifier. If None, a value will be generated via stix.utils.create_id(). If set, this will unset the idref property.
  • idref (optional) – An identifier reference. If set this will unset the id_ property.
  • title (optional) – A string title.
  • timestamp (optional) – A timestamp value. Can be an instance of datetime.datetime or str.
  • description (optional) – A string description.
  • short_description (optional) – A string short description.
add_configuration(value)

Adds a configuration to the configurations list property.

Note

If None is passed in no value is added

Parameters:value – A configuration value.
Raises:ValueError – If the value param is of type Configuration
add_description(description)

Adds a description to the descriptions collection.

This is the same as calling “foo.descriptions.add(bar)”.

add_short_description(description)

Adds a description to the short_descriptions collection.

This is the same as calling “foo.short_descriptions.add(bar)”.

add_vulnerability(value)

Adds a vulnerability to the vulnerabilities list property.

Note

If None is passed in no value is added

Parameters:value – A Vulnerability object..
Raises:ValueError – if the value param is of type Vulnerability
add_weakness(value)

Adds a weakness to the weaknesses list property.

Note

If None is passed in no value is added

Parameters:value – A Weakness object.

Raises: ValueError if the value param is of type Weakness

configuration

A list of Configuration objects. This behaves like a MutableSequence type.

Default Value: None

Returns:A list of – class:.Configuration objects.
Raises:ValueError – If set to a value that is not None and not an instance of Configuration.
description

A single description about the contents or purpose of this object.

Default Value: None

Note

If this object has more than one description set, this will return the description with the lowest ordinality value.

Returns:An instance of – class:.StructuredText
descriptions

A StructuredTextList object, containing descriptions about the purpose or intent of this object.

This is typically used for the purpose of providing multiple descriptions with different classificaton markings.

Iterating over this object will yield its contents sorted by their ordinality value.

Default Value: Empty StructuredTextList object.

Note

IF this is set to a value that is not an instance of StructuredText, an effort will ne made to convert it. If this is set to an iterable, any values contained that are not an instance of StructuredText will be be converted.

Returns:An instance of StructuredTextList
find(id_)

Searches the children of a Entity implementation for an object with an id_ property that matches id_.

id_

The id_ property serves as an identifier. This is automatically set during __init__().

Default Value: None

Note

Both the id_ and idref properties cannot be set at the same time. Setting one will unset the other!

Returns:A string id.
idref

The idref property must be set to the id_ value of another object instance of the same type. An idref does not need to resolve to a local object instance.

Default Value: None.

Note

Both the id_ and idref properties cannot be set at the same time. Setting one will unset the other!

Returns:The value of the idref property
information_source

Contains information about the source of this object.

Default Value: None

Returns:An instance of InformationSource
Raises:ValueError – If set to a value that is not None and not an instance of InformationSource
short_description

A single short description about the contents or purpose of this object.

Default Value: None

Note

If this object has more than one short description set, this will return the description with the lowest ordinality value.

Returns:An instance of – class:.StructuredText
short_descriptions

A StructuredTextList object, containing short descriptions about the purpose or intent of this object.

This is typically used for the purpose of providing multiple short descriptions with different classificaton markings.

Iterating over this object will yield its contents sorted by their ordinality value.

Default Value: Empty StructuredTextList object.

Note

IF this is set to a value that is not an instance of StructuredText, an effort will ne made to convert it. If this is set to an iterable, any values contained that are not an instance of StructuredText will be be converted.

Returns:An instance of – class:.StructuredTextList
timestamp

The timestam property declares the time of creation and is automatically set in __init__().

This property can accept datetime.datetime or str values. If an str value is supplied, a best-effort attempt is made to parse it into an instance of datetime.datetime.

Default Value: A datetime.dateime instance with a value of the date/time when __init__() was called.

Note

If an idref is set during __init__(), the value of timestamp will not automatically generated and instead default to the timestamp parameter, which has a default value of None.

Returns:An instance of datetime.datetime.
version

The schematic version of this component. This property will always return None unless it is set to a value different than self.__class__._version.

Note

This property refers to the version of the schema component type and should not be used for the purpose of content versioning.

Default Value: None

Returns:The value of the version property if set to a value different than self.__class__._version
vulnerabilities

A collection of Vulnerability objects. This behaves like a MutableSequence type.

Default Value: None

Returns:A list of – class:.Vulnerability
Raises:ValueError – If set to a value that is not None and not an instance of Vulnerability
weaknesses

A collection of Weakness objects. This behaves like a MutableSequence type.

Default Value: None

Returns:A list of – class:.Weakness objects.
Raises:ValueError – If set to a value that is not None and not an instance of Weakness
class stix.exploit_target.PotentialCOAs(coas=None, scope=None)

Bases: stix.common.related.GenericRelationshipList

A list of Potential_COA objects, defaults to empty array

class stix.exploit_target.RelatedExploitTargets(related_exploit_targets=None, scope=None)

Bases: stix.common.related.GenericRelationshipList

A list of RelatedExploitTargets objects, defaults to empty array