pycti 5.12.21__tar.gz → 5.12.23__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pycti might be problematic. Click here for more details.

Files changed (73) hide show
  1. {pycti-5.12.21 → pycti-5.12.23}/PKG-INFO +2 -2
  2. {pycti-5.12.21 → pycti-5.12.23}/pycti/__init__.py +1 -1
  3. {pycti-5.12.21 → pycti-5.12.23}/pycti/connector/opencti_connector_helper.py +13 -11
  4. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_attack_pattern.py +76 -58
  5. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_campaign.py +49 -41
  6. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_case_incident.py +62 -48
  7. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_case_rfi.py +45 -35
  8. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_case_rft.py +45 -35
  9. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_channel.py +45 -35
  10. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_course_of_action.py +43 -35
  11. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_data_component.py +43 -35
  12. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_data_source.py +48 -38
  13. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_event.py +44 -38
  14. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_external_reference.py +5 -3
  15. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_feedback.py +40 -32
  16. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_grouping.py +43 -35
  17. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_identity.py +91 -73
  18. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_incident.py +59 -47
  19. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_indicator.py +110 -84
  20. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_infrastructure.py +56 -44
  21. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_intrusion_set.py +61 -47
  22. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_language.py +30 -24
  23. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_location.py +41 -35
  24. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_malware.py +83 -63
  25. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_malware_analysis.py +87 -63
  26. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_marking_definition.py +24 -18
  27. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_narrative.py +45 -35
  28. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_note.py +51 -39
  29. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_observed_data.py +70 -48
  30. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_opinion.py +40 -32
  31. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_report.py +74 -47
  32. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_stix_core_object.py +10 -10
  33. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_stix_core_relationship.py +55 -41
  34. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_stix_cyber_observable.py +442 -318
  35. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_stix_domain_object.py +15 -13
  36. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_stix_object_or_stix_relationship.py +5 -5
  37. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_task.py +44 -36
  38. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_threat_actor_group.py +76 -56
  39. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_threat_actor_individual.py +76 -56
  40. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_tool.py +53 -41
  41. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_vulnerability.py +151 -109
  42. {pycti-5.12.21 → pycti-5.12.23}/pycti/utils/constants.py +1 -0
  43. {pycti-5.12.21 → pycti-5.12.23}/pycti/utils/opencti_stix2.py +177 -139
  44. {pycti-5.12.21 → pycti-5.12.23}/pycti/utils/opencti_stix2_update.py +20 -12
  45. {pycti-5.12.21 → pycti-5.12.23}/pycti/utils/opencti_stix2_utils.py +5 -3
  46. {pycti-5.12.21 → pycti-5.12.23}/pycti.egg-info/PKG-INFO +2 -2
  47. {pycti-5.12.21 → pycti-5.12.23}/pycti.egg-info/requires.txt +1 -1
  48. {pycti-5.12.21 → pycti-5.12.23}/setup.cfg +1 -1
  49. {pycti-5.12.21 → pycti-5.12.23}/LICENSE +0 -0
  50. {pycti-5.12.21 → pycti-5.12.23}/README.md +0 -0
  51. {pycti-5.12.21 → pycti-5.12.23}/pycti/api/__init__.py +0 -0
  52. {pycti-5.12.21 → pycti-5.12.23}/pycti/api/opencti_api_client.py +0 -0
  53. {pycti-5.12.21 → pycti-5.12.23}/pycti/api/opencti_api_connector.py +0 -0
  54. {pycti-5.12.21 → pycti-5.12.23}/pycti/api/opencti_api_playbook.py +0 -0
  55. {pycti-5.12.21 → pycti-5.12.23}/pycti/api/opencti_api_work.py +0 -0
  56. {pycti-5.12.21 → pycti-5.12.23}/pycti/connector/__init__.py +0 -0
  57. {pycti-5.12.21 → pycti-5.12.23}/pycti/connector/opencti_connector.py +0 -0
  58. {pycti-5.12.21 → pycti-5.12.23}/pycti/connector/opencti_metric_handler.py +0 -0
  59. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/__init__.py +0 -0
  60. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_kill_chain_phase.py +0 -0
  61. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_label.py +0 -0
  62. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_stix.py +0 -0
  63. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_stix_nested_ref_relationship.py +0 -0
  64. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_stix_sighting_relationship.py +0 -0
  65. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_threat_actor.py +0 -0
  66. {pycti-5.12.21 → pycti-5.12.23}/pycti/entities/opencti_vocabulary.py +0 -0
  67. {pycti-5.12.21 → pycti-5.12.23}/pycti/utils/__init__.py +0 -0
  68. {pycti-5.12.21 → pycti-5.12.23}/pycti/utils/opencti_logger.py +0 -0
  69. {pycti-5.12.21 → pycti-5.12.23}/pycti/utils/opencti_stix2_splitter.py +0 -0
  70. {pycti-5.12.21 → pycti-5.12.23}/pycti.egg-info/SOURCES.txt +0 -0
  71. {pycti-5.12.21 → pycti-5.12.23}/pycti.egg-info/dependency_links.txt +0 -0
  72. {pycti-5.12.21 → pycti-5.12.23}/pycti.egg-info/top_level.txt +0 -0
  73. {pycti-5.12.21 → pycti-5.12.23}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycti
3
- Version: 5.12.21
3
+ Version: 5.12.23
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -34,7 +34,7 @@ Requires-Dist: filigran-sseclient~=1.0.0
34
34
  Requires-Dist: stix2~=3.0.1
35
35
  Requires-Dist: cachetools~=5.3.0
36
36
  Provides-Extra: dev
37
- Requires-Dist: black~=23.12.0; extra == "dev"
37
+ Requires-Dist: black~=24.1.0; extra == "dev"
38
38
  Requires-Dist: build~=1.0.3; extra == "dev"
39
39
  Requires-Dist: isort~=5.13.0; extra == "dev"
40
40
  Requires-Dist: types-pytz~=2023.3.1.0; extra == "dev"
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "5.12.21"
2
+ __version__ = "5.12.23"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -299,11 +299,11 @@ class ListenQueue(threading.Thread):
299
299
  port=self.port,
300
300
  virtual_host=self.vhost,
301
301
  credentials=self.pika_credentials,
302
- ssl_options=pika.SSLOptions(
303
- create_mq_ssl_context(self.config), self.host
304
- )
305
- if self.use_ssl
306
- else None,
302
+ ssl_options=(
303
+ pika.SSLOptions(create_mq_ssl_context(self.config), self.host)
304
+ if self.use_ssl
305
+ else None
306
+ ),
307
307
  )
308
308
  self.pika_connection = pika.BlockingConnection(self.pika_parameters)
309
309
  self.channel = self.pika_connection.channel()
@@ -1035,12 +1035,14 @@ class OpenCTIConnectorHelper: # pylint: disable=too-many-public-methods
1035
1035
  port=self.connector_config["connection"]["port"],
1036
1036
  virtual_host=self.connector_config["connection"]["vhost"],
1037
1037
  credentials=pika_credentials,
1038
- ssl_options=pika.SSLOptions(
1039
- create_mq_ssl_context(self.config),
1040
- self.connector_config["connection"]["host"],
1041
- )
1042
- if self.connector_config["connection"]["use_ssl"]
1043
- else None,
1038
+ ssl_options=(
1039
+ pika.SSLOptions(
1040
+ create_mq_ssl_context(self.config),
1041
+ self.connector_config["connection"]["host"],
1042
+ )
1043
+ if self.connector_config["connection"]["use_ssl"]
1044
+ else None
1045
+ ),
1044
1046
  )
1045
1047
  pika_connection = pika.BlockingConnection(pika_parameters)
1046
1048
  channel = pika_connection.channel()
@@ -524,81 +524,99 @@ class AttackPattern:
524
524
  else 0
525
525
  )
526
526
  if "x_mitre_platforms" not in stix_object:
527
- stix_object[
528
- "x_mitre_platforms"
529
- ] = self.opencti.get_attribute_in_mitre_extension(
530
- "platforms", stix_object
527
+ stix_object["x_mitre_platforms"] = (
528
+ self.opencti.get_attribute_in_mitre_extension(
529
+ "platforms", stix_object
530
+ )
531
531
  )
532
532
  if "x_mitre_permissions_required" not in stix_object:
533
- stix_object[
534
- "x_mitre_permissions_required"
535
- ] = self.opencti.get_attribute_in_mitre_extension(
536
- "permissions_required", stix_object
533
+ stix_object["x_mitre_permissions_required"] = (
534
+ self.opencti.get_attribute_in_mitre_extension(
535
+ "permissions_required", stix_object
536
+ )
537
537
  )
538
538
  if "x_mitre_detection" not in stix_object:
539
- stix_object[
540
- "x_mitre_detection"
541
- ] = self.opencti.get_attribute_in_mitre_extension(
542
- "detection", stix_object
539
+ stix_object["x_mitre_detection"] = (
540
+ self.opencti.get_attribute_in_mitre_extension(
541
+ "detection", stix_object
542
+ )
543
543
  )
544
544
  if "x_opencti_stix_ids" not in stix_object:
545
- stix_object[
546
- "x_opencti_stix_ids"
547
- ] = self.opencti.get_attribute_in_extension("stix_ids", stix_object)
545
+ stix_object["x_opencti_stix_ids"] = (
546
+ self.opencti.get_attribute_in_extension("stix_ids", stix_object)
547
+ )
548
548
  if "x_opencti_granted_refs" not in stix_object:
549
- stix_object[
550
- "x_opencti_granted_refs"
551
- ] = self.opencti.get_attribute_in_extension("granted_refs", stix_object)
549
+ stix_object["x_opencti_granted_refs"] = (
550
+ self.opencti.get_attribute_in_extension("granted_refs", stix_object)
551
+ )
552
552
 
553
553
  return self.create(
554
554
  stix_id=stix_object["id"],
555
- createdBy=extras["created_by_id"]
556
- if "created_by_id" in extras
557
- else None,
558
- objectMarking=extras["object_marking_ids"]
559
- if "object_marking_ids" in extras
560
- else None,
561
- objectLabel=extras["object_label_ids"]
562
- if "object_label_ids" in extras
563
- else None,
564
- externalReferences=extras["external_references_ids"]
565
- if "external_references_ids" in extras
566
- else None,
555
+ createdBy=(
556
+ extras["created_by_id"] if "created_by_id" in extras else None
557
+ ),
558
+ objectMarking=(
559
+ extras["object_marking_ids"]
560
+ if "object_marking_ids" in extras
561
+ else None
562
+ ),
563
+ objectLabel=(
564
+ extras["object_label_ids"] if "object_label_ids" in extras else None
565
+ ),
566
+ externalReferences=(
567
+ extras["external_references_ids"]
568
+ if "external_references_ids" in extras
569
+ else None
570
+ ),
567
571
  revoked=stix_object["revoked"] if "revoked" in stix_object else None,
568
- confidence=stix_object["confidence"]
569
- if "confidence" in stix_object
570
- else None,
572
+ confidence=(
573
+ stix_object["confidence"] if "confidence" in stix_object else None
574
+ ),
571
575
  lang=stix_object["lang"] if "lang" in stix_object else None,
572
576
  created=stix_object["created"] if "created" in stix_object else None,
573
577
  modified=stix_object["modified"] if "modified" in stix_object else None,
574
578
  name=stix_object["name"],
575
- description=self.opencti.stix2.convert_markdown(
576
- stix_object["description"]
577
- )
578
- if "description" in stix_object
579
- else None,
579
+ description=(
580
+ self.opencti.stix2.convert_markdown(stix_object["description"])
581
+ if "description" in stix_object
582
+ else None
583
+ ),
580
584
  aliases=self.opencti.stix2.pick_aliases(stix_object),
581
- x_mitre_platforms=stix_object["x_mitre_platforms"]
582
- if "x_mitre_platforms" in stix_object
583
- else stix_object["x_amitt_platforms"]
584
- if "x_amitt_platforms" in stix_object
585
- else None,
586
- x_mitre_permissions_required=stix_object["x_mitre_permissions_required"]
587
- if "x_mitre_permissions_required" in stix_object
588
- else None,
589
- x_mitre_detection=stix_object["x_mitre_detection"]
590
- if "x_mitre_detection" in stix_object
591
- else None,
585
+ x_mitre_platforms=(
586
+ stix_object["x_mitre_platforms"]
587
+ if "x_mitre_platforms" in stix_object
588
+ else (
589
+ stix_object["x_amitt_platforms"]
590
+ if "x_amitt_platforms" in stix_object
591
+ else None
592
+ )
593
+ ),
594
+ x_mitre_permissions_required=(
595
+ stix_object["x_mitre_permissions_required"]
596
+ if "x_mitre_permissions_required" in stix_object
597
+ else None
598
+ ),
599
+ x_mitre_detection=(
600
+ stix_object["x_mitre_detection"]
601
+ if "x_mitre_detection" in stix_object
602
+ else None
603
+ ),
592
604
  x_mitre_id=x_mitre_id,
593
- killChainPhases=extras["kill_chain_phases_ids"]
594
- if "kill_chain_phases_ids" in extras
595
- else None,
596
- x_opencti_stix_ids=stix_object["x_opencti_stix_ids"]
597
- if "x_opencti_stix_ids" in stix_object
598
- else None,
599
- objectOrganization=stix_object["x_opencti_granted_refs"]
600
- if "x_opencti_granted_refs" in stix_object
601
- else None,
605
+ killChainPhases=(
606
+ extras["kill_chain_phases_ids"]
607
+ if "kill_chain_phases_ids" in extras
608
+ else None
609
+ ),
610
+ x_opencti_stix_ids=(
611
+ stix_object["x_opencti_stix_ids"]
612
+ if "x_opencti_stix_ids" in stix_object
613
+ else None
614
+ ),
615
+ objectOrganization=(
616
+ stix_object["x_opencti_granted_refs"]
617
+ if "x_opencti_granted_refs" in stix_object
618
+ else None
619
+ ),
602
620
  update=update,
603
621
  )
604
622
  else:
@@ -450,57 +450,65 @@ class Campaign:
450
450
  if stix_object is not None:
451
451
  # Search in extensions
452
452
  if "x_opencti_stix_ids" not in stix_object:
453
- stix_object[
454
- "x_opencti_stix_ids"
455
- ] = self.opencti.get_attribute_in_extension("stix_ids", stix_object)
453
+ stix_object["x_opencti_stix_ids"] = (
454
+ self.opencti.get_attribute_in_extension("stix_ids", stix_object)
455
+ )
456
456
  if "x_opencti_granted_refs" not in stix_object:
457
- stix_object[
458
- "x_opencti_granted_refs"
459
- ] = self.opencti.get_attribute_in_extension("granted_refs", stix_object)
457
+ stix_object["x_opencti_granted_refs"] = (
458
+ self.opencti.get_attribute_in_extension("granted_refs", stix_object)
459
+ )
460
460
 
461
461
  return self.create(
462
462
  stix_id=stix_object["id"],
463
- createdBy=extras["created_by_id"]
464
- if "created_by_id" in extras
465
- else None,
466
- objectMarking=extras["object_marking_ids"]
467
- if "object_marking_ids" in extras
468
- else None,
469
- objectLabel=extras["object_label_ids"]
470
- if "object_label_ids" in extras
471
- else None,
472
- externalReferences=extras["external_references_ids"]
473
- if "external_references_ids" in extras
474
- else None,
463
+ createdBy=(
464
+ extras["created_by_id"] if "created_by_id" in extras else None
465
+ ),
466
+ objectMarking=(
467
+ extras["object_marking_ids"]
468
+ if "object_marking_ids" in extras
469
+ else None
470
+ ),
471
+ objectLabel=(
472
+ extras["object_label_ids"] if "object_label_ids" in extras else None
473
+ ),
474
+ externalReferences=(
475
+ extras["external_references_ids"]
476
+ if "external_references_ids" in extras
477
+ else None
478
+ ),
475
479
  revoked=stix_object["revoked"] if "revoked" in stix_object else None,
476
- confidence=stix_object["confidence"]
477
- if "confidence" in stix_object
478
- else None,
480
+ confidence=(
481
+ stix_object["confidence"] if "confidence" in stix_object else None
482
+ ),
479
483
  lang=stix_object["lang"] if "lang" in stix_object else None,
480
484
  created=stix_object["created"] if "created" in stix_object else None,
481
485
  modified=stix_object["modified"] if "modified" in stix_object else None,
482
486
  name=stix_object["name"],
483
- description=self.opencti.stix2.convert_markdown(
484
- stix_object["description"]
485
- )
486
- if "description" in stix_object
487
- else None,
487
+ description=(
488
+ self.opencti.stix2.convert_markdown(stix_object["description"])
489
+ if "description" in stix_object
490
+ else None
491
+ ),
488
492
  aliases=self.opencti.stix2.pick_aliases(stix_object),
489
- objective=stix_object["objective"]
490
- if "objective" in stix_object
491
- else None,
492
- first_seen=stix_object["first_seen"]
493
- if "first_seen" in stix_object
494
- else None,
495
- last_seen=stix_object["last_seen"]
496
- if "last_seen" in stix_object
497
- else None,
498
- x_opencti_stix_ids=stix_object["x_opencti_stix_ids"]
499
- if "x_opencti_stix_ids" in stix_object
500
- else None,
501
- objectOrganization=stix_object["x_opencti_granted_refs"]
502
- if "x_opencti_granted_refs" in stix_object
503
- else None,
493
+ objective=(
494
+ stix_object["objective"] if "objective" in stix_object else None
495
+ ),
496
+ first_seen=(
497
+ stix_object["first_seen"] if "first_seen" in stix_object else None
498
+ ),
499
+ last_seen=(
500
+ stix_object["last_seen"] if "last_seen" in stix_object else None
501
+ ),
502
+ x_opencti_stix_ids=(
503
+ stix_object["x_opencti_stix_ids"]
504
+ if "x_opencti_stix_ids" in stix_object
505
+ else None
506
+ ),
507
+ objectOrganization=(
508
+ stix_object["x_opencti_granted_refs"]
509
+ if "x_opencti_granted_refs" in stix_object
510
+ else None
511
+ ),
504
512
  update=update,
505
513
  )
506
514
  else:
@@ -858,69 +858,83 @@ class CaseIncident:
858
858
  if stix_object is not None:
859
859
  # Search in extensions
860
860
  if "x_opencti_stix_ids" not in stix_object:
861
- stix_object[
862
- "x_opencti_stix_ids"
863
- ] = self.opencti.get_attribute_in_extension("stix_ids", stix_object)
861
+ stix_object["x_opencti_stix_ids"] = (
862
+ self.opencti.get_attribute_in_extension("stix_ids", stix_object)
863
+ )
864
864
  if "x_opencti_granted_refs" not in stix_object:
865
- stix_object[
866
- "x_opencti_granted_refs"
867
- ] = self.opencti.get_attribute_in_extension("granted_refs", stix_object)
865
+ stix_object["x_opencti_granted_refs"] = (
866
+ self.opencti.get_attribute_in_extension("granted_refs", stix_object)
867
+ )
868
868
  if "x_opencti_workflow_id" not in stix_object:
869
- stix_object[
870
- "x_opencti_workflow_id"
871
- ] = self.opencti.get_attribute_in_extension(
872
- "x_opencti_workflow_id", stix_object
869
+ stix_object["x_opencti_workflow_id"] = (
870
+ self.opencti.get_attribute_in_extension(
871
+ "x_opencti_workflow_id", stix_object
872
+ )
873
873
  )
874
874
  if "x_opencti_assignee_ids" not in stix_object:
875
- stix_object[
876
- "x_opencti_assignee_ids"
877
- ] = self.opencti.get_attribute_in_extension("assignee_ids", stix_object)
875
+ stix_object["x_opencti_assignee_ids"] = (
876
+ self.opencti.get_attribute_in_extension("assignee_ids", stix_object)
877
+ )
878
878
 
879
879
  return self.create(
880
880
  stix_id=stix_object["id"],
881
- createdBy=extras["created_by_id"]
882
- if "created_by_id" in extras
883
- else None,
884
- objectMarking=extras["object_marking_ids"]
885
- if "object_marking_ids" in extras
886
- else None,
887
- objectLabel=extras["object_label_ids"]
888
- if "object_label_ids" in extras
889
- else None,
881
+ createdBy=(
882
+ extras["created_by_id"] if "created_by_id" in extras else None
883
+ ),
884
+ objectMarking=(
885
+ extras["object_marking_ids"]
886
+ if "object_marking_ids" in extras
887
+ else None
888
+ ),
889
+ objectLabel=(
890
+ extras["object_label_ids"] if "object_label_ids" in extras else None
891
+ ),
890
892
  objects=extras["object_ids"] if "object_ids" in extras else [],
891
- externalReferences=extras["external_references_ids"]
892
- if "external_references_ids" in extras
893
- else None,
893
+ externalReferences=(
894
+ extras["external_references_ids"]
895
+ if "external_references_ids" in extras
896
+ else None
897
+ ),
894
898
  revoked=stix_object["revoked"] if "revoked" in stix_object else None,
895
- confidence=stix_object["confidence"]
896
- if "confidence" in stix_object
897
- else None,
899
+ confidence=(
900
+ stix_object["confidence"] if "confidence" in stix_object else None
901
+ ),
898
902
  lang=stix_object["lang"] if "lang" in stix_object else None,
899
903
  created=stix_object["created"] if "created" in stix_object else None,
900
904
  modified=stix_object["modified"] if "modified" in stix_object else None,
901
905
  name=stix_object["name"],
902
- description=self.opencti.stix2.convert_markdown(
903
- stix_object["description"]
904
- )
905
- if "description" in stix_object
906
- else None,
906
+ description=(
907
+ self.opencti.stix2.convert_markdown(stix_object["description"])
908
+ if "description" in stix_object
909
+ else None
910
+ ),
907
911
  severity=stix_object["severity"] if "severity" in stix_object else None,
908
912
  priority=stix_object["priority"] if "priority" in stix_object else None,
909
- response_types=stix_object["response_types"]
910
- if "response_types" in stix_object
911
- else None,
912
- x_opencti_stix_ids=stix_object["x_opencti_stix_ids"]
913
- if "x_opencti_stix_ids" in stix_object
914
- else None,
915
- objectOrganization=stix_object["x_opencti_granted_refs"]
916
- if "x_opencti_granted_refs" in stix_object
917
- else None,
918
- objectAssignee=stix_object["x_opencti_assignee_ids"]
919
- if "x_opencti_assignee_ids" in stix_object
920
- else None,
921
- x_opencti_workflow_id=stix_object["x_opencti_workflow_id"]
922
- if "x_opencti_workflow_id" in stix_object
923
- else None,
913
+ response_types=(
914
+ stix_object["response_types"]
915
+ if "response_types" in stix_object
916
+ else None
917
+ ),
918
+ x_opencti_stix_ids=(
919
+ stix_object["x_opencti_stix_ids"]
920
+ if "x_opencti_stix_ids" in stix_object
921
+ else None
922
+ ),
923
+ objectOrganization=(
924
+ stix_object["x_opencti_granted_refs"]
925
+ if "x_opencti_granted_refs" in stix_object
926
+ else None
927
+ ),
928
+ objectAssignee=(
929
+ stix_object["x_opencti_assignee_ids"]
930
+ if "x_opencti_assignee_ids" in stix_object
931
+ else None
932
+ ),
933
+ x_opencti_workflow_id=(
934
+ stix_object["x_opencti_workflow_id"]
935
+ if "x_opencti_workflow_id" in stix_object
936
+ else None
937
+ ),
924
938
  update=update,
925
939
  )
926
940
  else:
@@ -841,52 +841,62 @@ class CaseRfi:
841
841
  if stix_object is not None:
842
842
  # Search in extensions
843
843
  if "x_opencti_stix_ids" not in stix_object:
844
- stix_object[
845
- "x_opencti_stix_ids"
846
- ] = self.opencti.get_attribute_in_extension("stix_ids", stix_object)
844
+ stix_object["x_opencti_stix_ids"] = (
845
+ self.opencti.get_attribute_in_extension("stix_ids", stix_object)
846
+ )
847
847
  if "x_opencti_granted_refs" not in stix_object:
848
- stix_object[
849
- "x_opencti_granted_refs"
850
- ] = self.opencti.get_attribute_in_extension("granted_refs", stix_object)
848
+ stix_object["x_opencti_granted_refs"] = (
849
+ self.opencti.get_attribute_in_extension("granted_refs", stix_object)
850
+ )
851
851
 
852
852
  return self.create(
853
853
  stix_id=stix_object["id"],
854
- createdBy=extras["created_by_id"]
855
- if "created_by_id" in extras
856
- else None,
857
- objectMarking=extras["object_marking_ids"]
858
- if "object_marking_ids" in extras
859
- else None,
860
- objectLabel=extras["object_label_ids"]
861
- if "object_label_ids" in extras
862
- else None,
854
+ createdBy=(
855
+ extras["created_by_id"] if "created_by_id" in extras else None
856
+ ),
857
+ objectMarking=(
858
+ extras["object_marking_ids"]
859
+ if "object_marking_ids" in extras
860
+ else None
861
+ ),
862
+ objectLabel=(
863
+ extras["object_label_ids"] if "object_label_ids" in extras else None
864
+ ),
863
865
  objects=extras["object_ids"] if "object_ids" in extras else [],
864
- externalReferences=extras["external_references_ids"]
865
- if "external_references_ids" in extras
866
- else None,
866
+ externalReferences=(
867
+ extras["external_references_ids"]
868
+ if "external_references_ids" in extras
869
+ else None
870
+ ),
867
871
  revoked=stix_object["revoked"] if "revoked" in stix_object else None,
868
- confidence=stix_object["confidence"]
869
- if "confidence" in stix_object
870
- else None,
872
+ confidence=(
873
+ stix_object["confidence"] if "confidence" in stix_object else None
874
+ ),
871
875
  lang=stix_object["lang"] if "lang" in stix_object else None,
872
876
  created=stix_object["created"] if "created" in stix_object else None,
873
877
  modified=stix_object["modified"] if "modified" in stix_object else None,
874
878
  name=stix_object["name"],
875
- description=self.opencti.stix2.convert_markdown(
876
- stix_object["description"]
877
- )
878
- if "description" in stix_object
879
- else None,
880
- x_opencti_stix_ids=stix_object["x_opencti_stix_ids"]
881
- if "x_opencti_stix_ids" in stix_object
882
- else None,
883
- objectOrganization=stix_object["x_opencti_granted_refs"]
884
- if "x_opencti_granted_refs" in stix_object
885
- else None,
879
+ description=(
880
+ self.opencti.stix2.convert_markdown(stix_object["description"])
881
+ if "description" in stix_object
882
+ else None
883
+ ),
884
+ x_opencti_stix_ids=(
885
+ stix_object["x_opencti_stix_ids"]
886
+ if "x_opencti_stix_ids" in stix_object
887
+ else None
888
+ ),
889
+ objectOrganization=(
890
+ stix_object["x_opencti_granted_refs"]
891
+ if "x_opencti_granted_refs" in stix_object
892
+ else None
893
+ ),
886
894
  update=update,
887
- information_types=stix_object["information_types"]
888
- if "information_types" in stix_object
889
- else None,
895
+ information_types=(
896
+ stix_object["information_types"]
897
+ if "information_types" in stix_object
898
+ else None
899
+ ),
890
900
  )
891
901
  else:
892
902
  self.opencti.app_logger.error(