Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 8505262

Browse files
committed
[client] Fix threat actor import
1 parent 14ac085 commit 8505262

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pycti/entities/opencti_threat_actor.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,15 @@ def import_from_stix2(self, **kwargs):
287287
type = stix_object["x_opencti_type"].lower()
288288
elif self.opencti.get_attribute_in_extension("type", stix_object) is not None:
289289
type = self.opencti.get_attribute_in_extension("type", stix_object).lower()
290-
elif "individual" in stix_object["resource_level"].lower():
290+
elif (
291+
"resource_level" in stix_object
292+
and stix_object["resource_level"].lower() == "individual"
293+
):
291294
type = "threat-actor-individual"
292295
else:
293296
type = "threat-actor-group"
294297

295-
if "threat-actor-group" in type:
296-
return self.threat_actor_group.import_from_stix2(**kwargs)
297-
if "threat-actor-individual" in type:
298+
if type == "threat-actor-individual":
298299
return self.threat_actor_individual.import_from_stix2(**kwargs)
300+
else:
301+
return self.threat_actor_group.import_from_stix2(**kwargs)

0 commit comments

Comments
 (0)