Implementation of the STIX TTP. Args: id_ (optional): An identifier. If ``None``, a value will be generated via ``mixbox.idgen.create_id()``. If set, this will unset the ``idref`` property. idref (optional): An identifier reference. If set this will unset
| 21 | |
| 22 | |
| 23 | class TTP(stix.BaseCoreComponent): |
| 24 | """Implementation of the STIX TTP. |
| 25 | |
| 26 | Args: |
| 27 | id_ (optional): An identifier. If ``None``, a value will be generated |
| 28 | via ``mixbox.idgen.create_id()``. If set, this will unset the |
| 29 | ``idref`` property. |
| 30 | idref (optional): An identifier reference. If set this will unset the |
| 31 | ``id_`` property. |
| 32 | timestamp (optional): A timestamp value. Can be an instance of |
| 33 | ``datetime.datetime`` or ``str``. |
| 34 | description: A description of the purpose or intent of this object. |
| 35 | short_description: A short description of the intent |
| 36 | or purpose of this object. |
| 37 | title: The title of this object. |
| 38 | |
| 39 | """ |
| 40 | _binding = ttp_binding |
| 41 | _binding_class = _binding.TTPType |
| 42 | _namespace = "http://docs.oasis-open.org/cti/ns/stix/ttp-1" |
| 43 | _version = "1.2.1" |
| 44 | _ALL_VERSIONS = ("1.0", "1.0.1", "1.1", "1.1.1", "1.2", "1.2.1") |
| 45 | _ID_PREFIX = "ttp" |
| 46 | |
| 47 | behavior = fields.TypedField("Behavior", Behavior) |
| 48 | related_ttps = fields.TypedField("Related_TTPs", RelatedTTPs) |
| 49 | intended_effects = StatementField("Intended_Effect", Statement, vocab_type=vocabs.IntendedEffect, multiple=True) |
| 50 | resources = fields.TypedField("Resources", Resource) |
| 51 | victim_targeting = fields.TypedField("Victim_Targeting", VictimTargeting) |
| 52 | exploit_targets = fields.TypedField("Exploit_Targets", ExploitTargets) |
| 53 | related_packages = fields.TypedField("Related_Packages", RelatedPackageRefs) |
| 54 | kill_chain_phases = fields.TypedField("Kill_Chain_Phases", KillChainPhasesReference) |
| 55 | information_source = fields.TypedField("Information_Source", InformationSource) |
| 56 | |
| 57 | def __init__(self, id_=None, idref=None, timestamp=None, title=None, |
| 58 | description=None, short_description=None): |
| 59 | |
| 60 | super(TTP, self).__init__( |
| 61 | id_=id_, |
| 62 | idref=idref, |
| 63 | timestamp=timestamp, |
| 64 | title=title, |
| 65 | description=description, |
| 66 | short_description=short_description |
| 67 | ) |
| 68 | |
| 69 | self.related_packages = RelatedPackageRefs() |
| 70 | self.exploit_targets = ExploitTargets() |
| 71 | self.related_ttps = RelatedTTPs() |
| 72 | self.kill_chain_phases = KillChainPhasesReference() |
| 73 | |
| 74 | |
| 75 | def add_related_ttp(self, value): |
| 76 | """Adds an Related TTP to the :attr:`related_ttps` list |
| 77 | property of this :class:`TTP`. |
| 78 | |
| 79 | The `TTP` parameter must be an instance of |
| 80 | :class:`.RelatedTTP` or :class:`TTP`. |