You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from mitreattack.stix20 import MitreAttackData
mitre_attack_data = MitreAttackData("enterprise-attack.json")
attack_pattern_object = mitre_attack_data.get_object_by_stix_id("attack-pattern--7f32230b-d4ac-502c-a37c-e85b6aa6664d")
I expect the attack_pattern_object to be an object representing the following technique: "Resource Hijacking".
Actual Behavior
I am getting the following error:
File "...\lib\site-packages\mitreattack\stix20\custom_attack_objects.py", line 50, in StixObjectFactory
if "type" in data and data["type"] in stix_type_to_custom_class:
TypeError: argument of type 'NoneType' is not iterable
Possible Solution
Fix the get_object_by_stix_id() method to actually return an object representing an attack pattern.
The text was updated successfully, but these errors were encountered:
Thanks for opening up an issue. It appears that no object was found with STIX ID attack-pattern--7f32230b-d4ac-502c-a37c-e85b6aa6664d which caused the StixObjectFactory to throw an error. A PR has been opened to include some additional checking which will return None if no objects with the given ID exist in the dataset rather than throwing an error.
Also want to mention that if you are using the ATT&CK Enterprise dataset, it doesn't look like any objects have that STIX ID. Maybe you're looking for Resource Hijacking: attack-pattern--cd25c1b4-935c-4f0e-ba8d-552f28bc4783?
Expected Behavior
When I run the following code:
I expect the
attack_pattern_object
to be an object representing the following technique: "Resource Hijacking".Actual Behavior
I am getting the following error:
File "...\lib\site-packages\mitreattack\stix20\custom_attack_objects.py", line 50, in StixObjectFactory
if "type" in data and data["type"] in stix_type_to_custom_class:
TypeError: argument of type 'NoneType' is not iterable
Possible Solution
Fix the
get_object_by_stix_id()
method to actually return an object representing an attack pattern.The text was updated successfully, but these errors were encountered: