Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def tools(self):
"""Creates AttckTools objects
Returns:
(AttckTools) -- Returns a list of AttckTools objects
"""
tools_list = []
for tools in self.attck['objects']:
if (tools['type'] == 'tool'):
tools_list.append(AttckTools(attck_obj=self.attck, **tools))
return tools_list
def tools(self):
'''Returns all tool object as a list that are documented as being used by an Actor or Group'''
from .tools import AttckTools
tools_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'] == 'tool':
if item['target_ref'] in o['id']:
tools_list.append(AttckTools(**o))
return tools_list
def __init__(self, attck_obj = None, **kwargs):
"""Creates an AttckTools object.
The AttckTools object is based on software which have been categorized as software used in attacks
"""
self.attck_obj = attck_obj
self.id = super(AttckTools, self)._set_id(kwargs)
self.name = super(AttckTools, self)._set_attribute(kwargs, 'name')
self.alias = super(AttckTools, self)._set_attribute(kwargs, 'aliases')
self.description = super(AttckTools, self)._set_attribute(kwargs, 'description')
self.reference = super(AttckTools, self)._set_reference(kwargs)
self.created = super(AttckTools, self)._set_attribute(kwargs, 'created')
self.modified = super(AttckTools, self)._set_attribute(kwargs, 'modified')
self.stix = super(AttckTools, self)._set_attribute(kwargs, 'id')
self.type = super(AttckTools, self)._set_attribute(kwargs, 'type')
self.wiki = super(AttckTools, self)._set_wiki(kwargs)
self.contributor = super(AttckTools, self)._set_attribute(kwargs, 'contributor')