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

Commit af90237

Browse files
committed
[client] Handle marking definitions
1 parent 916fdbb commit af90237

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pycti/entities/opencti_marking_definition.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def import_from_stix2(self, **kwargs):
243243
):
244244
definition_type = stix_object["x_opencti_definition_type"]
245245
definition = stix_object["x_opencti_definition"]
246-
else:
246+
elif "definition_type" in stix_object:
247247
definition_type = stix_object["definition_type"]
248248
definition = None
249249
if stix_object["definition_type"] == "tlp":
@@ -272,6 +272,14 @@ def import_from_stix2(self, **kwargs):
272272
definition = stix_object["name"]
273273
elif "name" in stix_object:
274274
definition = stix_object["name"]
275+
elif "name" in stix_object:
276+
if ":" in stix_object["name"]:
277+
definition_type = stix_object["name"].split(":")[0]
278+
else:
279+
definition_type = "statement"
280+
definition = stix_object["name"]
281+
else:
282+
return None
275283

276284
# Replace TLP:WHITE
277285
if definition == "TLP:WHITE":

0 commit comments

Comments
 (0)