@@ -428,7 +428,10 @@ def import_object(self, stix_object, update=False):
428428
429429 # Update created by ref
430430 if created_by_ref_id is not None and stix_object ['type' ] != 'marking-definition' :
431- self .opencti .update_stix_domain_entity_created_by_ref (stix_object_result ['id' ], created_by_ref_id )
431+ if stix_object ['type' ] == 'indicator' :
432+ self .opencti .update_stix_observable_created_by_ref (stix_object_result ['id' ], created_by_ref_id )
433+ else :
434+ self .opencti .update_stix_domain_entity_created_by_ref (stix_object_result ['id' ], created_by_ref_id )
432435 # Add marking definitions
433436 for marking_definition_id in marking_definitions_ids :
434437 self .opencti .add_marking_definition_if_not_exists (stix_object_result ['id' ], marking_definition_id )
@@ -448,9 +451,15 @@ def import_object(self, stix_object, update=False):
448451 return stix_object_result
449452
450453 def create_marking_definition (self , stix_object , update = False ):
454+ definition_type = stix_object ['definition_type' ]
455+ definition = stix_object ['definition' ][stix_object ['definition_type' ]]
456+ if stix_object ['definition_type' ] == 'tlp' :
457+ definition_type = 'TLP'
458+ definition = 'TLP:' + stix_object ['definition' ][stix_object ['definition_type' ]].upper ()
459+
451460 return self .opencti .create_marking_definition_if_not_exists (
452- stix_object [ ' definition_type' ] ,
453- stix_object [ ' definition' ][ stix_object [ 'definition_type' ]] ,
461+ definition_type ,
462+ definition ,
454463 stix_object ['x_opencti_level' ] if 'x_opencti_level' in stix_object else 0 ,
455464 stix_object ['x_opencti_color' ] if 'x_opencti_color' in stix_object else None ,
456465 stix_object ['x_opencti_id' ] if 'x_opencti_id' in stix_object else None ,
0 commit comments