@@ -24,6 +24,7 @@ def __init__(self, opencti):
2424 updated_at
2525 ... on Organization {
2626 organization_class
27+ reliability
2728 }
2829 createdByRef {
2930 node {
@@ -38,6 +39,7 @@ def __init__(self, opencti):
3839 modified
3940 ... on Organization {
4041 organization_class
42+ reliability
4143 }
4244 }
4345 relation {
@@ -226,6 +228,7 @@ def create_raw(self, **kwargs):
226228 marking_definitions = kwargs .get ("markingDefinitions" , None )
227229 tags = kwargs .get ("tags" , None )
228230 organization_class = kwargs .get ("organization_class" , None )
231+ reliability = kwargs .get ("reliability" , None )
229232
230233 if name is not None and description is not None :
231234 self .opencti .log ("info" , "Creating Identity {" + name + "}." )
@@ -254,6 +257,7 @@ def create_raw(self, **kwargs):
254257 }
255258 """
256259 input_variables ["organization_class" ] = organization_class
260+ input_variables ["reliability" ] = reliability
257261 result_data_field = "organizationAdd"
258262 else :
259263 query = """
@@ -296,9 +300,11 @@ def create(self, **kwargs):
296300 marking_definitions = kwargs .get ("markingDefinitions" , None )
297301 tags = kwargs .get ("tags" , None )
298302 organization_class = kwargs .get ("organization_class" , None )
303+ reliability = kwargs .get ("reliability" , None )
299304 update = kwargs .get ("update" , False )
300305 custom_attributes = """
301306 id
307+ stix_id_key
302308 entity_type
303309 name
304310 description
@@ -308,6 +314,7 @@ def create(self, **kwargs):
308314 }
309315 ... on Organization {
310316 organization_class
317+ reliability
311318 }
312319 createdByRef {
313320 node {
@@ -373,6 +380,16 @@ def create(self, **kwargs):
373380 value = organization_class ,
374381 )
375382 object_result ["organization_class" ] = organization_class
383+ # reliability
384+ if (
385+ self .opencti .not_empty (reliability )
386+ and "reliability" in object_result
387+ and object_result ["reliability" ] != reliability
388+ ):
389+ self .opencti .stix_domain_entity .update_field (
390+ id = object_result ["id" ], key = "reliability" , value = reliability ,
391+ )
392+ object_result ["reliability" ] = reliability
376393 return object_result
377394 else :
378395 return self .create_raw (
@@ -389,6 +406,7 @@ def create(self, **kwargs):
389406 markingDefinitions = marking_definitions ,
390407 tags = tags ,
391408 organization_class = organization_class ,
409+ reliability = reliability ,
392410 )
393411
394412 """
@@ -446,6 +464,9 @@ def import_from_stix2(self, **kwargs):
446464 organization_class = stix_object [CustomProperties .ORG_CLASS ]
447465 if CustomProperties .ORG_CLASS in stix_object
448466 else None ,
467+ reliability = stix_object [CustomProperties .RELIABILITY ]
468+ if CustomProperties .RELIABILITY in stix_object
469+ else None ,
449470 update = update ,
450471 )
451472 else :
@@ -494,12 +515,15 @@ def to_stix2(self, **kwargs):
494515 identity ["modified" ] = self .opencti .stix2 .format_date (entity ["modified" ])
495516 if self .opencti .not_empty (entity ["alias" ]):
496517 identity ["aliases" ] = entity ["alias" ]
497- if (
498- entity ["entity_type" ] == "organization"
499- and "organization_class" in entity
500- and self .opencti .not_empty (entity ["organization_class" ])
501- ):
502- identity [CustomProperties .ORG_CLASS ] = entity ["organization_class" ]
518+ if entity ["entity_type" ] == "organization" :
519+ if "organization_class" in entity and self .opencti .not_empty (
520+ entity ["organization_class" ]
521+ ):
522+ identity [CustomProperties .ORG_CLASS ] = entity ["organization_class" ]
523+ if "reliability" in entity and self .opencti .not_empty (
524+ entity ["reliability" ]
525+ ):
526+ identity [CustomProperties .RELIABILITY ] = entity ["reliability" ]
503527 identity [CustomProperties .IDENTITY_TYPE ] = entity ["entity_type" ]
504528 identity [CustomProperties .ID ] = entity ["id" ]
505529 return self .opencti .stix2 .prepare_export (
0 commit comments