@@ -20,6 +20,8 @@ def __init__(self, opencti):
2020 graph_data
2121 indicator_pattern
2222 pattern_type
23+ detection
24+ confidence
2325 valid_from
2426 valid_until
2527 score
@@ -243,7 +245,7 @@ def read(self, **kwargs):
243245 result = self .opencti .query (query , {"id" : id })
244246 return self .opencti .process_multiple_fields (result ["data" ]["indicator" ])
245247 elif filters is not None :
246- result = self .list (filters = filters )
248+ result = self .list (filters = filters , customAttributes = custom_attributes )
247249 if len (result ) > 0 :
248250 return result [0 ]
249251 else :
@@ -390,7 +392,7 @@ def create(self, **kwargs):
390392 """
391393 object_result = None
392394 if stix_id_key is not None :
393- object_result = self .opencti . indicator . read (
395+ object_result = self .read (
394396 id = stix_id_key , customAttributes = custom_attributes
395397 )
396398 if object_result is None :
@@ -405,7 +407,7 @@ def create(self, **kwargs):
405407 customAttributes = custom_attributes ,
406408 )
407409 if object_result is not None :
408- if update or object_result ["createdByRef " ] == created_by_ref :
410+ if update or object_result ["createdByRefId " ] == created_by_ref :
409411 # name
410412 if name is not None and object_result ["name" ] != name :
411413 self .opencti .stix_domain_entity .update_field (
@@ -424,19 +426,21 @@ def create(self, **kwargs):
424426 # score
425427 if score is not None and object_result ["score" ] != score :
426428 self .opencti .stix_domain_entity .update_field (
427- id = object_result ["id" ], key = "score" , value = score
429+ id = object_result ["id" ], key = "score" , value = str ( score )
428430 )
429431 object_result ["score" ] = score
430432 # confidence
431433 if confidence is not None and object_result ["confidence" ] != confidence :
432434 self .opencti .stix_domain_entity .update_field (
433- id = object_result ["id" ], key = "confidence" , value = confidence
435+ id = object_result ["id" ], key = "confidence" , value = str ( confidence )
434436 )
435437 object_result ["confidence" ] = confidence
436438 # detection
437439 if detection is not None and object_result ["detection" ] != detection :
438440 self .opencti .stix_domain_entity .update_field (
439- id = object_result ["id" ], key = "detection" , value = detection
441+ id = object_result ["id" ],
442+ key = "detection" ,
443+ value = str (detection ).lower (),
440444 )
441445 object_result ["detection" ] = detection
442446 return object_result
0 commit comments