MCPcopy Create free account
hub / github.com/STIXProject/python-stix / Campaign

Class Campaign

stix/campaign/__init__.py:80–173  ·  view source on GitHub ↗

Implementation of the STIX Campaign. 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

Source from the content-addressed store, hash-verified

78
79
80class Campaign(stix.BaseCoreComponent):
81 """Implementation of the STIX Campaign.
82
83 Args:
84 id_ (optional): An identifier. If ``None``, a value will be generated
85 via ``mixbox.idgen.create_id()``. If set, this will unset the
86 ``idref`` property.
87 idref (optional): An identifier reference. If set this will unset the
88 ``id_`` property.
89 timestamp (optional): A timestamp value. Can be an instance of
90 ``datetime.datetime`` or ``str``.
91 description: A description of the purpose or intent of this object.
92 short_description: A short description of the intent
93 or purpose of this object.
94 title: The title of this object.
95
96 """
97 _binding = campaign_binding
98 _binding_class = _binding.CampaignType
99 _namespace = "http://docs.oasis-open.org/cti/ns/stix/campaign-1"
100 _version = "1.2.1"
101 _ALL_VERSIONS = ("1.0", "1.0.1", "1.1", "1.1.1", "1.2", "1.2.1")
102 _ID_PREFIX = 'campaign'
103
104 descriptions = fields.TypedField("Description", StructuredTextList)
105 activity = fields.TypedField("Activity", Activity, multiple=True)
106 associated_campaigns = fields.TypedField("Associated_Campaigns", AssociatedCampaigns)
107 attribution = fields.TypedField("Attribution", Attribution, multiple=True)
108 confidence = fields.TypedField("Confidence", Confidence)
109 # references = fields.TypedField("Reference", multiple=True)
110 status = VocabField("Status", CampaignStatus)
111 intended_effects = StatementField("Intended_Effect", Statement, vocab_type=vocabs.IntendedEffect, multiple=True, key_name="intended_effects")
112 names = fields.TypedField("Names", Names)
113 related_incidents = fields.TypedField("Related_Incidents", RelatedIncidents)
114 related_indicators = fields.TypedField("Related_Indicators", RelatedIndicators)
115 related_packages = fields.TypedField("Related_Packages", RelatedPackageRefs)
116 related_ttps = fields.TypedField("Related_TTPs", RelatedTTPs)
117 information_source = fields.TypedField("Information_Source", InformationSource)
118
119 def __init__(self, id_=None, idref=None, timestamp=None, title=None,
120 description=None, short_description=None):
121
122 super(Campaign, self).__init__(
123 id_=id_,
124 idref=idref,
125 timestamp=timestamp,
126 title=title,
127 description=description,
128 short_description=short_description
129 )
130
131 self.related_ttps = RelatedTTPs()
132 self.related_incidents = RelatedIncidents()
133 self.related_indicators = RelatedIndicators()
134 self.related_packages = RelatedPackageRefs()
135
136
137 def add_intended_effect(self, value):

Callers 4

test_add_campaignMethod · 0.90
test_campaignMethod · 0.90
mainFunction · 0.90

Calls 2

VocabFieldClass · 0.90
StatementFieldClass · 0.90

Tested by 3

test_add_campaignMethod · 0.72
test_campaignMethod · 0.72