From 5748645734dfe6ed8293dd874ebf071ee2f2fb0f Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Wed, 8 Apr 2020 16:38:30 +0300 Subject: [PATCH] Actual stix2 import bugfix --- .../monkey_island/cc/services/attack/mitre_api_interface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/services/attack/mitre_api_interface.py b/monkey/monkey_island/cc/services/attack/mitre_api_interface.py index cbe0d911d..ad4419be5 100644 --- a/monkey/monkey_island/cc/services/attack/mitre_api_interface.py +++ b/monkey/monkey_island/cc/services/attack/mitre_api_interface.py @@ -1,6 +1,6 @@ from typing import List, Dict -from stix2 import FileSystemSource, Filter, CourseOfAction, AttackPattern, core +from stix2 import FileSystemSource, Filter, CourseOfAction, AttackPattern, v20 class MitreApiInterface: @@ -32,14 +32,14 @@ class MitreApiInterface: return all_techniques @staticmethod - def get_stix2_external_reference_id(stix2_data: core.STIXDomainObject) -> str: + def get_stix2_external_reference_id(stix2_data: v20._DomainObject) -> str: for reference in stix2_data['external_references']: if reference['source_name'] == "mitre-attack" and 'external_id' in reference: return reference['external_id'] return '' @staticmethod - def get_stix2_external_reference_url(stix2_data: core.STIXDomainObject) -> str: + def get_stix2_external_reference_url(stix2_data: v20._DomainObject) -> str: for reference in stix2_data['external_references']: if 'url' in reference: return reference['url']