Esempio n. 1
0
 def add_no_mitigations_info(self, mitigation: CourseOfAction):
     mitigation_external_ref_id = MitreApiInterface.get_stix2_external_reference_id(mitigation)
     if mitigation_external_ref_id.startswith('T') and len(self.mitigations) == 0:
         mitigation_mongo_object = Mitigation.get_from_stix2_data(mitigation)
         mitigation_mongo_object['description'] = mitigation_mongo_object['description'].splitlines()[0]
         mitigation_mongo_object['url'] = ''
         self.mitigations.append(mitigation_mongo_object)
Esempio n. 2
0
 def mitigations_from_attack_pattern(attack_pattern: AttackPattern):
     return AttackMitigations(technique_id=MitreApiInterface.get_stix2_external_reference_id(attack_pattern),
                              mitigations=[])
Esempio n. 3
0
 def add_mitigation(self, mitigation: CourseOfAction):
     mitigation_external_ref_id = MitreApiInterface.get_stix2_external_reference_id(mitigation)
     if mitigation_external_ref_id.startswith('M'):
         self.mitigations.append(Mitigation.get_from_stix2_data(mitigation))
Esempio n. 4
0
 def get_from_stix2_data(mitigation: CourseOfAction):
     name = mitigation['name']
     description = mitigation['description']
     url = MitreApiInterface.get_stix2_external_reference_url(mitigation)
     return Mitigation(name=name, description=description, url=url)