11# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
22# See LICENSE.txt for complete terms.
33
4+ from mixbox import fields
5+
46import stix
57from stix .utils import deprecated
68from stix .common import Activity , Confidence , Statement , VocabString
1012)
1113from stix .common import vocabs
1214import stix .bindings .campaign as campaign_binding
13- from stix .common .structured_text import StructuredTextList , StructuredTextListField
14- from stix .base import ElementField , AttributeField
15+ from stix .common .structured_text import StructuredTextList
1516from stix .common .information_source import InformationSource
1617
1718class AssociatedCampaigns (GenericRelationshipList ):
@@ -32,8 +33,8 @@ class Attribution(GenericRelationshipList):
3233
3334"""
3435class Attribution(stix.Entity):
35- threat_actors = ElementField ("Attributed_Threat_Actor", RelatedThreatActor, multiple=True, key_name="threat_actors")
36- scope = AttributeField ("scope")
36+ threat_actors = fields.TypedField ("Attributed_Threat_Actor", RelatedThreatActor, multiple=True, key_name="threat_actors")
37+ scope = fields.TypedField ("scope")
3738
3839 def __init__(self, scope=None, *args):
3940 self._fields = {}
@@ -111,19 +112,19 @@ class Campaign(stix.BaseCoreComponent):
111112 _ALL_VERSIONS = ("1.0" , "1.0.1" , "1.1" , "1.1.1" , "1.2" )
112113 _ID_PREFIX = 'campaign'
113114
114- descriptions = StructuredTextListField ("Description" , StructuredTextList , key_name = "description" )
115- activity = ElementField ("Activity" , Activity , multiple = True )
116- associated_campaigns = ElementField ("Associated_Campaigns" , AssociatedCampaigns )
117- attribution = ElementField ("Attribution" , Attribution , multiple = True )
118- confidence = ElementField ("Confidence" , Confidence )
119- # references = ElementField ("Reference", multiple=True)
120- status = ElementField ("Status" , VocabString )
121- intended_effects = ElementField ("Intended_Effect" , Statement , multiple = True , key_name = "intended_effects" )
122- names = ElementField ("Names" , Names )
123- related_incidents = ElementField ("Related_Incidents" , RelatedIncidents )
124- related_indicators = ElementField ("Related_Indicators" , RelatedIndicators )
125- related_packages = ElementField ("Related_Packages" , RelatedPackageRefs )
126- information_source = ElementField ("Information_Source" , InformationSource )
115+ descriptions = fields . TypedField ("Description" , StructuredTextList , key_name = "description" )
116+ activity = fields . TypedField ("Activity" , Activity , multiple = True )
117+ associated_campaigns = fields . TypedField ("Associated_Campaigns" , AssociatedCampaigns )
118+ attribution = fields . TypedField ("Attribution" , Attribution , multiple = True )
119+ confidence = fields . TypedField ("Confidence" , Confidence )
120+ # references = fields.TypedField ("Reference", multiple=True)
121+ status = fields . TypedField ("Status" , VocabString )
122+ intended_effects = fields . TypedField ("Intended_Effect" , Statement , multiple = True , key_name = "intended_effects" )
123+ names = fields . TypedField ("Names" , Names )
124+ related_incidents = fields . TypedField ("Related_Incidents" , RelatedIncidents )
125+ related_indicators = fields . TypedField ("Related_Indicators" , RelatedIndicators )
126+ related_packages = fields . TypedField ("Related_Packages" , RelatedPackageRefs )
127+ information_source = fields . TypedField ("Information_Source" , InformationSource )
127128
128129 def __init__ (self , id_ = None , idref = None , timestamp = None , title = None ,
129130 description = None , short_description = None ):
0 commit comments