Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.attck_obj = attck_obj
self.id = super(AttckMalware, self)._set_id(kwargs)
self.created_by_ref = super(AttckMalware, self)._set_attribute(kwargs, 'created_by_ref')
self.name = super(AttckMalware, self)._set_attribute(kwargs, 'name')
self.aliases = super(AttckMalware, self)._set_list_items(kwargs, 'x_mitre_aliases')
self.platforms = super(AttckMalware, self)._set_list_items(kwargs, 'x_mitre_platforms')
self.labels = super(AttckMalware, self)._set_list_items(kwargs, 'labels')
self.description = super(AttckMalware, self)._set_attribute(kwargs, 'description')
self.external_references = super(AttckMalware, self)._set_reference(kwargs)
self.created = super(AttckMalware, self)._set_attribute(kwargs, 'created')
self.modified = super(AttckMalware, self)._set_attribute(kwargs, 'modified')
self.stix = super(AttckMalware, self)._set_attribute(kwargs, 'id')
self.type = super(AttckMalware, self)._set_attribute(kwargs, 'type')
self.wiki = super(AttckMalware, self)._set_wiki(kwargs)
self.contributor = super(AttckMalware, self)._set_list_items(kwargs, 'x_mitre_contributors')
self.revoked = super(AttckMalware, self)._set_attribute(kwargs, 'revoked')
def malwares(self):
"""Creates AttckMalware objects
Returns:
(AttckMalware) -- Returns a list of AttckMalware objects
"""
malware_list = []
for malware in self.attck['objects']:
if (malware['type'] == 'malware'):
malware_list.append(AttckMalware(attck_obj=self.attck, **malware))
return malware_list
def malwares(self):
'''Returns all malware objects as a list that are documented as being used by an Actor or Group
'''
from .malware import AttckMalware
malware_list = []
for item in self.attck_obj['objects']:
if 'source_ref' in item:
if self.stix in item['source_ref']:
for o in self.attck_obj['objects']:
if o['type'] == 'malware':
if item['target_ref'] in o['id']:
malware_list.append(AttckMalware(**o))
return malware_list