Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def actors(self):
'''Returns all actor objects as a list that are documented to use this tool'''
from .actor import AttckActor
actor_list = []
for item in self.attck_obj['objects']:
if 'relationship_type' in item:
if 'uses' in item['relationship_type']:
if self.stix in item['target_ref']:
if 'intrusion-set' in item['source_ref']:
for o in self.attck_obj['objects']:
if item['source_ref'] in o['id']:
actor_list.append(AttckActor(**o))
return actor_list
def actors(self):
"""Creates AttckActor objects
Returns:
(AttckActor) -- (Returns a list of AttckActor objects)
"""
group_list = []
for group in self.attck['objects']:
if group['type'] == 'intrusion-set':
group_list.append(AttckActor(attck_obj=self.attck, **group))
return group_list
def actors(self):
'''Returns all actor objects that have been identified as using this technique'''
from .actor import AttckActor
actor_list = []
for item in self.attck_obj['objects']:
if 'relationship_type' in item:
if 'uses' in item['relationship_type']:
if self.stix in item['target_ref']:
if 'intrusion-set' in item['source_ref']:
for o in self.attck_obj['objects']:
if item['source_ref'] in o['id']:
actor_list.append(AttckActor(**o))
return actor_list
def __init__(self, attck_obj = None, **kwargs):
self.attck_obj = attck_obj
self.id = super(AttckActor, self)._set_id(kwargs)
self.created_by_ref = super(AttckActor, self)._set_attribute(kwargs, 'created_by_ref')
self.revoked = super(AttckActor, self)._set_attribute(kwargs, 'revoked')
self.name = super(AttckActor, self)._set_attribute(kwargs, 'name')
self.aliases = super(AttckActor, self)._set_list_items(kwargs, 'aliases')
self.description = super(AttckActor, self)._set_attribute(kwargs, 'description')
self.external_reference = super(AttckActor, self)._set_reference(kwargs)
self.created = super(AttckActor, self)._set_attribute(kwargs, 'created')
self.modified = super(AttckActor, self)._set_attribute(kwargs, 'modified')
self.stix = super(AttckActor, self)._set_attribute(kwargs, 'id')
self.type = super(AttckActor, self)._set_attribute(kwargs, 'type')
self.wiki = super(AttckActor, self)._set_wiki(kwargs)
self.contributor = super(AttckActor, self)._set_list_items(kwargs, 'x_mitre_contributors')
def actors(self):
'''Returns all actor objects as a list that are documented as using this malware'''
from .actor import AttckActor
actor_list = []
for item in self.attck_obj['objects']:
if 'source_ref' in item:
if self.stix in item['target_ref']:
for o in self.attck_obj['objects']:
if item['source_ref'] in o['id']:
actor_list.append(AttckActor(**o))
return actor_list