Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def techniques(self):
'''Returns all technique objects as a list that this tool has been identified or used'''
from .technique import AttckTechnique
technique_list = []
for item in self.attck_obj['objects']:
if 'relationship_type' in item:
if 'uses' in item['relationship_type']:
if self.stix in item['source_ref']:
if 'attack-pattern' in item['target_ref']:
for o in self.attck_obj['objects']:
if item['target_ref'] in o['id']:
technique_list.append(AttckTechnique(**o))
return technique_list
def techniques(self):
"""Creates AttckTechnique objects
Returns:
(AttckTechnique) -- Returns a list of AttckTechnique objects
"""
technique_list = []
for technique in self.attck["objects"]:
if (technique['type'] == 'attack-pattern'):
technique_list.append(AttckTechnique(attck_obj=self.attck, **technique))
return technique_list
def techniques(self):
'''Returns all techniques as a list that are related to this tactic'''
from .technique import AttckTechnique
technique_list = []
for item in self.attck_obj['objects']:
if 'kill_chain_phases' in item:
for prop in item['kill_chain_phases']:
if str(prop['phase_name']).lower() == str(self.short_name).lower():
technique_list.append(AttckTechnique(**item))
return technique_list
def techniques(self):
'''Returns all technique objects as a list that are related to this mitigation object'''
from .technique import AttckTechnique
technique_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 item['target_ref'] in o['id']:
technique_list.append(AttckTechnique(**o))
return technique_list
def techniques(self):
'''Returns all technique objects as a list that are documented as using this malware'''
from .technique import AttckTechnique
technique_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 item['target_ref'] in o['id']:
technique_list.append(AttckTechnique(**o))
return technique_list
def techniques(self):
'''Returns all technique objects as a list that are documented as being used by an Actor or Group'''
from .technique import AttckTechnique
technique_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'] == 'attack-pattern':
if item['target_ref'] in o['id']:
technique_list.append(AttckTechnique(**o))
return technique_list
self.platforms = super(AttckTechnique, self)._set_list_items(kwargs, 'x_mitre_platforms')
self.permissions = super(AttckTechnique, self)._set_list_items(kwargs, 'x_mitre_permissions_required')
self.bypass = super(AttckTechnique, self)._set_list_items(kwargs, 'x_mitre_defense_bypassed')
self.effective_permissions = super(AttckTechnique, self)._set_list_items(kwargs, 'x_mitre_effective_permissions')
self.network = super(AttckTechnique, self)._set_attribute(kwargs, 'x_mitre_network_requirements')
self.remote = super(AttckTechnique, self)._set_attribute(kwargs, 'x_mitre_remote_support')
self.system_requirements = super(AttckTechnique, self)._set_attribute(kwargs, 'x_mitre_system_requirements')
self.detection = super(AttckTechnique, self)._set_attribute(kwargs, 'x_mitre_detection')
self.data_source = super(AttckTechnique, self)._set_list_items(kwargs, 'x_mitre_data_sources')
self.created = super(AttckTechnique, self)._set_attribute(kwargs, 'created')
self.modified = super(AttckTechnique, self)._set_attribute(kwargs, 'modified')
self.contributors = super(AttckTechnique, self)._set_list_items(kwargs, 'contributor')
self.stix = super(AttckTechnique, self)._set_attribute(kwargs, 'id')
self.wiki = super(AttckTechnique, self)._set_wiki(kwargs)
self.external_references = super(AttckTechnique, self)._set_reference(kwargs)
self.tactic = kwargs