pycti 5.12.21__py3-none-any.whl → 5.12.23__py3-none-any.whl
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.
- pycti/__init__.py +1 -1
- pycti/connector/opencti_connector_helper.py +13 -11
- pycti/entities/opencti_attack_pattern.py +76 -58
- pycti/entities/opencti_campaign.py +49 -41
- pycti/entities/opencti_case_incident.py +62 -48
- pycti/entities/opencti_case_rfi.py +45 -35
- pycti/entities/opencti_case_rft.py +45 -35
- pycti/entities/opencti_channel.py +45 -35
- pycti/entities/opencti_course_of_action.py +43 -35
- pycti/entities/opencti_data_component.py +43 -35
- pycti/entities/opencti_data_source.py +48 -38
- pycti/entities/opencti_event.py +44 -38
- pycti/entities/opencti_external_reference.py +5 -3
- pycti/entities/opencti_feedback.py +40 -32
- pycti/entities/opencti_grouping.py +43 -35
- pycti/entities/opencti_identity.py +91 -73
- pycti/entities/opencti_incident.py +59 -47
- pycti/entities/opencti_indicator.py +110 -84
- pycti/entities/opencti_infrastructure.py +56 -44
- pycti/entities/opencti_intrusion_set.py +61 -47
- pycti/entities/opencti_language.py +30 -24
- pycti/entities/opencti_location.py +41 -35
- pycti/entities/opencti_malware.py +83 -63
- pycti/entities/opencti_malware_analysis.py +87 -63
- pycti/entities/opencti_marking_definition.py +24 -18
- pycti/entities/opencti_narrative.py +45 -35
- pycti/entities/opencti_note.py +51 -39
- pycti/entities/opencti_observed_data.py +70 -48
- pycti/entities/opencti_opinion.py +40 -32
- pycti/entities/opencti_report.py +74 -47
- pycti/entities/opencti_stix_core_object.py +10 -10
- pycti/entities/opencti_stix_core_relationship.py +55 -41
- pycti/entities/opencti_stix_cyber_observable.py +442 -318
- pycti/entities/opencti_stix_domain_object.py +15 -13
- pycti/entities/opencti_stix_object_or_stix_relationship.py +5 -5
- pycti/entities/opencti_task.py +44 -36
- pycti/entities/opencti_threat_actor_group.py +76 -56
- pycti/entities/opencti_threat_actor_individual.py +76 -56
- pycti/entities/opencti_tool.py +53 -41
- pycti/entities/opencti_vulnerability.py +151 -109
- pycti/utils/constants.py +1 -0
- pycti/utils/opencti_stix2.py +177 -139
- pycti/utils/opencti_stix2_update.py +20 -12
- pycti/utils/opencti_stix2_utils.py +5 -3
- {pycti-5.12.21.dist-info → pycti-5.12.23.dist-info}/METADATA +2 -2
- pycti-5.12.23.dist-info/RECORD +68 -0
- pycti-5.12.21.dist-info/RECORD +0 -68
- {pycti-5.12.21.dist-info → pycti-5.12.23.dist-info}/LICENSE +0 -0
- {pycti-5.12.21.dist-info → pycti-5.12.23.dist-info}/WHEEL +0 -0
- {pycti-5.12.21.dist-info → pycti-5.12.23.dist-info}/top_level.txt +0 -0
|
@@ -631,13 +631,13 @@ class Indicator:
|
|
|
631
631
|
if stix_object is not None:
|
|
632
632
|
# Search in extensions
|
|
633
633
|
if "x_opencti_score" not in stix_object:
|
|
634
|
-
stix_object[
|
|
635
|
-
"
|
|
636
|
-
|
|
634
|
+
stix_object["x_opencti_score"] = (
|
|
635
|
+
self.opencti.get_attribute_in_extension("score", stix_object)
|
|
636
|
+
)
|
|
637
637
|
if "x_opencti_detection" not in stix_object:
|
|
638
|
-
stix_object[
|
|
639
|
-
"
|
|
640
|
-
|
|
638
|
+
stix_object["x_opencti_detection"] = (
|
|
639
|
+
self.opencti.get_attribute_in_extension("detection", stix_object)
|
|
640
|
+
)
|
|
641
641
|
if (
|
|
642
642
|
"x_opencti_main_observable_type" not in stix_object
|
|
643
643
|
and self.opencti.get_attribute_in_extension(
|
|
@@ -645,97 +645,123 @@ class Indicator:
|
|
|
645
645
|
)
|
|
646
646
|
is not None
|
|
647
647
|
):
|
|
648
|
-
stix_object[
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
648
|
+
stix_object["x_opencti_main_observable_type"] = (
|
|
649
|
+
self.opencti.get_attribute_in_extension(
|
|
650
|
+
"main_observable_type", stix_object
|
|
651
|
+
)
|
|
652
652
|
)
|
|
653
653
|
if "x_opencti_create_observables" not in stix_object:
|
|
654
|
-
stix_object[
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
654
|
+
stix_object["x_opencti_create_observables"] = (
|
|
655
|
+
self.opencti.get_attribute_in_extension(
|
|
656
|
+
"create_observables", stix_object
|
|
657
|
+
)
|
|
658
658
|
)
|
|
659
659
|
if "x_opencti_stix_ids" not in stix_object:
|
|
660
|
-
stix_object[
|
|
661
|
-
"
|
|
662
|
-
|
|
660
|
+
stix_object["x_opencti_stix_ids"] = (
|
|
661
|
+
self.opencti.get_attribute_in_extension("stix_ids", stix_object)
|
|
662
|
+
)
|
|
663
663
|
if "x_opencti_granted_refs" not in stix_object:
|
|
664
|
-
stix_object[
|
|
665
|
-
"
|
|
666
|
-
|
|
664
|
+
stix_object["x_opencti_granted_refs"] = (
|
|
665
|
+
self.opencti.get_attribute_in_extension("granted_refs", stix_object)
|
|
666
|
+
)
|
|
667
667
|
|
|
668
668
|
return self.create(
|
|
669
669
|
stix_id=stix_object["id"],
|
|
670
|
-
createdBy=
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
objectMarking=
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
670
|
+
createdBy=(
|
|
671
|
+
extras["created_by_id"] if "created_by_id" in extras else None
|
|
672
|
+
),
|
|
673
|
+
objectMarking=(
|
|
674
|
+
extras["object_marking_ids"]
|
|
675
|
+
if "object_marking_ids" in extras
|
|
676
|
+
else None
|
|
677
|
+
),
|
|
678
|
+
objectLabel=(
|
|
679
|
+
extras["object_label_ids"] if "object_label_ids" in extras else None
|
|
680
|
+
),
|
|
681
|
+
externalReferences=(
|
|
682
|
+
extras["external_references_ids"]
|
|
683
|
+
if "external_references_ids" in extras
|
|
684
|
+
else None
|
|
685
|
+
),
|
|
682
686
|
revoked=stix_object["revoked"] if "revoked" in stix_object else None,
|
|
683
|
-
confidence=
|
|
684
|
-
|
|
685
|
-
|
|
687
|
+
confidence=(
|
|
688
|
+
stix_object["confidence"] if "confidence" in stix_object else None
|
|
689
|
+
),
|
|
686
690
|
lang=stix_object["lang"] if "lang" in stix_object else None,
|
|
687
691
|
created=stix_object["created"] if "created" in stix_object else None,
|
|
688
692
|
modified=stix_object["modified"] if "modified" in stix_object else None,
|
|
689
|
-
pattern_type=
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
693
|
+
pattern_type=(
|
|
694
|
+
stix_object["pattern_type"]
|
|
695
|
+
if "pattern_type" in stix_object
|
|
696
|
+
else None
|
|
697
|
+
),
|
|
698
|
+
pattern_version=(
|
|
699
|
+
stix_object["pattern_version"]
|
|
700
|
+
if "pattern_version" in stix_object
|
|
701
|
+
else None
|
|
702
|
+
),
|
|
695
703
|
pattern=stix_object["pattern"] if "pattern" in stix_object else "",
|
|
696
|
-
name=
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
"
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
704
|
+
name=(
|
|
705
|
+
stix_object["name"]
|
|
706
|
+
if "name" in stix_object
|
|
707
|
+
else stix_object["pattern"]
|
|
708
|
+
),
|
|
709
|
+
description=(
|
|
710
|
+
self.opencti.stix2.convert_markdown(stix_object["description"])
|
|
711
|
+
if "description" in stix_object
|
|
712
|
+
else None
|
|
713
|
+
),
|
|
714
|
+
indicator_types=(
|
|
715
|
+
stix_object["indicator_types"]
|
|
716
|
+
if "indicator_types" in stix_object
|
|
717
|
+
else None
|
|
718
|
+
),
|
|
719
|
+
valid_from=(
|
|
720
|
+
stix_object["valid_from"] if "valid_from" in stix_object else None
|
|
721
|
+
),
|
|
722
|
+
valid_until=(
|
|
723
|
+
stix_object["valid_until"] if "valid_until" in stix_object else None
|
|
724
|
+
),
|
|
725
|
+
x_opencti_score=(
|
|
726
|
+
stix_object["x_opencti_score"]
|
|
727
|
+
if "x_opencti_score" in stix_object
|
|
728
|
+
else 50
|
|
729
|
+
),
|
|
730
|
+
x_opencti_detection=(
|
|
731
|
+
stix_object["x_opencti_detection"]
|
|
732
|
+
if "x_opencti_detection" in stix_object
|
|
733
|
+
else False
|
|
734
|
+
),
|
|
735
|
+
x_mitre_platforms=(
|
|
736
|
+
stix_object["x_mitre_platforms"]
|
|
737
|
+
if "x_mitre_platforms" in stix_object
|
|
738
|
+
else None
|
|
739
|
+
),
|
|
740
|
+
x_opencti_main_observable_type=(
|
|
741
|
+
stix_object["x_opencti_main_observable_type"]
|
|
742
|
+
if "x_opencti_main_observable_type" in stix_object
|
|
743
|
+
else "Unknown"
|
|
744
|
+
),
|
|
745
|
+
killChainPhases=(
|
|
746
|
+
extras["kill_chain_phases_ids"]
|
|
747
|
+
if "kill_chain_phases_ids" in extras
|
|
748
|
+
else None
|
|
749
|
+
),
|
|
750
|
+
x_opencti_stix_ids=(
|
|
751
|
+
stix_object["x_opencti_stix_ids"]
|
|
752
|
+
if "x_opencti_stix_ids" in stix_object
|
|
753
|
+
else None
|
|
754
|
+
),
|
|
755
|
+
x_opencti_create_observables=(
|
|
756
|
+
stix_object["x_opencti_create_observables"]
|
|
757
|
+
if "x_opencti_create_observables" in stix_object
|
|
758
|
+
else False
|
|
759
|
+
),
|
|
760
|
+
objectOrganization=(
|
|
761
|
+
stix_object["x_opencti_granted_refs"]
|
|
762
|
+
if "x_opencti_granted_refs" in stix_object
|
|
763
|
+
else None
|
|
764
|
+
),
|
|
739
765
|
update=update,
|
|
740
766
|
)
|
|
741
767
|
else:
|
|
@@ -502,60 +502,72 @@ class Infrastructure:
|
|
|
502
502
|
if stix_object is not None:
|
|
503
503
|
# Search in extensions
|
|
504
504
|
if "x_opencti_stix_ids" not in stix_object:
|
|
505
|
-
stix_object[
|
|
506
|
-
"
|
|
507
|
-
|
|
505
|
+
stix_object["x_opencti_stix_ids"] = (
|
|
506
|
+
self.opencti.get_attribute_in_extension("stix_ids", stix_object)
|
|
507
|
+
)
|
|
508
508
|
if "x_opencti_granted_refs" not in stix_object:
|
|
509
|
-
stix_object[
|
|
510
|
-
"
|
|
511
|
-
|
|
509
|
+
stix_object["x_opencti_granted_refs"] = (
|
|
510
|
+
self.opencti.get_attribute_in_extension("granted_refs", stix_object)
|
|
511
|
+
)
|
|
512
512
|
|
|
513
513
|
return self.create(
|
|
514
514
|
stix_id=stix_object["id"],
|
|
515
|
-
createdBy=
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
objectMarking=
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
515
|
+
createdBy=(
|
|
516
|
+
extras["created_by_id"] if "created_by_id" in extras else None
|
|
517
|
+
),
|
|
518
|
+
objectMarking=(
|
|
519
|
+
extras["object_marking_ids"]
|
|
520
|
+
if "object_marking_ids" in extras
|
|
521
|
+
else None
|
|
522
|
+
),
|
|
523
|
+
objectLabel=(
|
|
524
|
+
extras["object_label_ids"] if "object_label_ids" in extras else None
|
|
525
|
+
),
|
|
526
|
+
externalReferences=(
|
|
527
|
+
extras["external_references_ids"]
|
|
528
|
+
if "external_references_ids" in extras
|
|
529
|
+
else None
|
|
530
|
+
),
|
|
527
531
|
revoked=stix_object["revoked"] if "revoked" in stix_object else None,
|
|
528
|
-
confidence=
|
|
529
|
-
|
|
530
|
-
|
|
532
|
+
confidence=(
|
|
533
|
+
stix_object["confidence"] if "confidence" in stix_object else None
|
|
534
|
+
),
|
|
531
535
|
lang=stix_object["lang"] if "lang" in stix_object else None,
|
|
532
536
|
created=stix_object["created"] if "created" in stix_object else None,
|
|
533
537
|
modified=stix_object["modified"] if "modified" in stix_object else None,
|
|
534
538
|
name=stix_object["name"],
|
|
535
|
-
description=
|
|
536
|
-
stix_object["description"]
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
539
|
+
description=(
|
|
540
|
+
self.opencti.stix2.convert_markdown(stix_object["description"])
|
|
541
|
+
if "description" in stix_object
|
|
542
|
+
else None
|
|
543
|
+
),
|
|
540
544
|
aliases=self.opencti.stix2.pick_aliases(stix_object),
|
|
541
|
-
infrastructure_types=
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
545
|
+
infrastructure_types=(
|
|
546
|
+
stix_object["infrastructure_types"]
|
|
547
|
+
if "infrastructure_types" in stix_object
|
|
548
|
+
else None
|
|
549
|
+
),
|
|
550
|
+
first_seen=(
|
|
551
|
+
stix_object["first_seen"] if "first_seen" in stix_object else None
|
|
552
|
+
),
|
|
553
|
+
last_seen=(
|
|
554
|
+
stix_object["last_seen"] if "last_seen" in stix_object else None
|
|
555
|
+
),
|
|
556
|
+
killChainPhases=(
|
|
557
|
+
extras["kill_chain_phases_ids"]
|
|
558
|
+
if "kill_chain_phases_ids" in extras
|
|
559
|
+
else None
|
|
560
|
+
),
|
|
561
|
+
x_opencti_stix_ids=(
|
|
562
|
+
stix_object["x_opencti_stix_ids"]
|
|
563
|
+
if "x_opencti_stix_ids" in stix_object
|
|
564
|
+
else None
|
|
565
|
+
),
|
|
566
|
+
objectOrganization=(
|
|
567
|
+
stix_object["x_opencti_granted_refs"]
|
|
568
|
+
if "x_opencti_granted_refs" in stix_object
|
|
569
|
+
else None
|
|
570
|
+
),
|
|
559
571
|
update=update,
|
|
560
572
|
)
|
|
561
573
|
else:
|
|
@@ -442,64 +442,78 @@ class IntrusionSet:
|
|
|
442
442
|
if stix_object is not None:
|
|
443
443
|
# Search in extensions
|
|
444
444
|
if "x_opencti_stix_ids" not in stix_object:
|
|
445
|
-
stix_object[
|
|
446
|
-
"
|
|
447
|
-
|
|
445
|
+
stix_object["x_opencti_stix_ids"] = (
|
|
446
|
+
self.opencti.get_attribute_in_extension("stix_ids", stix_object)
|
|
447
|
+
)
|
|
448
448
|
if "x_opencti_granted_refs" not in stix_object:
|
|
449
|
-
stix_object[
|
|
450
|
-
"
|
|
451
|
-
|
|
449
|
+
stix_object["x_opencti_granted_refs"] = (
|
|
450
|
+
self.opencti.get_attribute_in_extension("granted_refs", stix_object)
|
|
451
|
+
)
|
|
452
452
|
|
|
453
453
|
return self.create(
|
|
454
454
|
stix_id=stix_object["id"],
|
|
455
|
-
createdBy=
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
objectMarking=
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
455
|
+
createdBy=(
|
|
456
|
+
extras["created_by_id"] if "created_by_id" in extras else None
|
|
457
|
+
),
|
|
458
|
+
objectMarking=(
|
|
459
|
+
extras["object_marking_ids"]
|
|
460
|
+
if "object_marking_ids" in extras
|
|
461
|
+
else None
|
|
462
|
+
),
|
|
463
|
+
objectLabel=(
|
|
464
|
+
extras["object_label_ids"] if "object_label_ids" in extras else None
|
|
465
|
+
),
|
|
466
|
+
externalReferences=(
|
|
467
|
+
extras["external_references_ids"]
|
|
468
|
+
if "external_references_ids" in extras
|
|
469
|
+
else None
|
|
470
|
+
),
|
|
467
471
|
revoked=stix_object["revoked"] if "revoked" in stix_object else None,
|
|
468
|
-
confidence=
|
|
469
|
-
|
|
470
|
-
|
|
472
|
+
confidence=(
|
|
473
|
+
stix_object["confidence"] if "confidence" in stix_object else None
|
|
474
|
+
),
|
|
471
475
|
lang=stix_object["lang"] if "lang" in stix_object else None,
|
|
472
476
|
created=stix_object["created"] if "created" in stix_object else None,
|
|
473
477
|
modified=stix_object["modified"] if "modified" in stix_object else None,
|
|
474
478
|
name=stix_object["name"],
|
|
475
|
-
description=
|
|
476
|
-
stix_object["description"]
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
479
|
+
description=(
|
|
480
|
+
self.opencti.stix2.convert_markdown(stix_object["description"])
|
|
481
|
+
if "description" in stix_object
|
|
482
|
+
else None
|
|
483
|
+
),
|
|
480
484
|
aliases=self.opencti.stix2.pick_aliases(stix_object),
|
|
481
|
-
first_seen=
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
last_seen=
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
first_seen=(
|
|
486
|
+
stix_object["first_seen"] if "first_seen" in stix_object else None
|
|
487
|
+
),
|
|
488
|
+
last_seen=(
|
|
489
|
+
stix_object["last_seen"] if "last_seen" in stix_object else None
|
|
490
|
+
),
|
|
487
491
|
goals=stix_object["goals"] if "goals" in stix_object else None,
|
|
488
|
-
resource_level=
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
492
|
+
resource_level=(
|
|
493
|
+
stix_object["resource_level"]
|
|
494
|
+
if "resource_level" in stix_object
|
|
495
|
+
else None
|
|
496
|
+
),
|
|
497
|
+
primary_motivation=(
|
|
498
|
+
stix_object["primary_motivation"]
|
|
499
|
+
if "primary_motivation" in stix_object
|
|
500
|
+
else None
|
|
501
|
+
),
|
|
502
|
+
secondary_motivations=(
|
|
503
|
+
stix_object["secondary_motivations"]
|
|
504
|
+
if "secondary_motivations" in stix_object
|
|
505
|
+
else None
|
|
506
|
+
),
|
|
507
|
+
x_opencti_stix_ids=(
|
|
508
|
+
stix_object["x_opencti_stix_ids"]
|
|
509
|
+
if "x_opencti_stix_ids" in stix_object
|
|
510
|
+
else None
|
|
511
|
+
),
|
|
512
|
+
objectOrganization=(
|
|
513
|
+
stix_object["x_opencti_granted_refs"]
|
|
514
|
+
if "x_opencti_granted_refs" in stix_object
|
|
515
|
+
else None
|
|
516
|
+
),
|
|
503
517
|
update=update,
|
|
504
518
|
)
|
|
505
519
|
else:
|
|
@@ -456,40 +456,46 @@ class Language:
|
|
|
456
456
|
if stix_object is not None:
|
|
457
457
|
# Search in extensions
|
|
458
458
|
if "x_opencti_stix_ids" not in stix_object:
|
|
459
|
-
stix_object[
|
|
460
|
-
"
|
|
461
|
-
|
|
459
|
+
stix_object["x_opencti_stix_ids"] = (
|
|
460
|
+
self.opencti.get_attribute_in_extension("stix_ids", stix_object)
|
|
461
|
+
)
|
|
462
462
|
if "x_opencti_granted_refs" not in stix_object:
|
|
463
|
-
stix_object[
|
|
464
|
-
"
|
|
465
|
-
|
|
463
|
+
stix_object["x_opencti_granted_refs"] = (
|
|
464
|
+
self.opencti.get_attribute_in_extension("granted_refs", stix_object)
|
|
465
|
+
)
|
|
466
466
|
|
|
467
467
|
return self.opencti.language.create(
|
|
468
468
|
stix_id=stix_object["id"],
|
|
469
|
-
createdBy=
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
objectMarking=
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
469
|
+
createdBy=(
|
|
470
|
+
extras["created_by_id"] if "created_by_id" in extras else None
|
|
471
|
+
),
|
|
472
|
+
objectMarking=(
|
|
473
|
+
extras["object_marking_ids"]
|
|
474
|
+
if "object_marking_ids" in extras
|
|
475
|
+
else None
|
|
476
|
+
),
|
|
477
|
+
objectLabel=(
|
|
478
|
+
extras["object_label_ids"] if "object_label_ids" in extras else None
|
|
479
|
+
),
|
|
480
|
+
externalReferences=(
|
|
481
|
+
extras["external_references_ids"]
|
|
482
|
+
if "external_references_ids" in extras
|
|
483
|
+
else None
|
|
484
|
+
),
|
|
481
485
|
revoked=stix_object["revoked"] if "revoked" in stix_object else None,
|
|
482
|
-
confidence=
|
|
483
|
-
|
|
484
|
-
|
|
486
|
+
confidence=(
|
|
487
|
+
stix_object["confidence"] if "confidence" in stix_object else None
|
|
488
|
+
),
|
|
485
489
|
lang=stix_object["lang"] if "lang" in stix_object else None,
|
|
486
490
|
created=stix_object["created"] if "created" in stix_object else None,
|
|
487
491
|
modified=stix_object["modified"] if "modified" in stix_object else None,
|
|
488
492
|
name=stix_object["name"],
|
|
489
493
|
aliases=self.opencti.stix2.pick_aliases(stix_object),
|
|
490
|
-
x_opencti_stix_ids=
|
|
491
|
-
|
|
492
|
-
|
|
494
|
+
x_opencti_stix_ids=(
|
|
495
|
+
stix_object["x_opencti_stix_ids"]
|
|
496
|
+
if "x_opencti_stix_ids" in stix_object
|
|
497
|
+
else None
|
|
498
|
+
),
|
|
493
499
|
update=update,
|
|
494
500
|
)
|
|
495
501
|
else:
|
|
@@ -456,52 +456,58 @@ class Location:
|
|
|
456
456
|
if stix_object is not None:
|
|
457
457
|
# Search in extensions
|
|
458
458
|
if "x_opencti_aliases" not in stix_object:
|
|
459
|
-
stix_object[
|
|
460
|
-
"
|
|
461
|
-
|
|
459
|
+
stix_object["x_opencti_aliases"] = (
|
|
460
|
+
self.opencti.get_attribute_in_extension("aliases", stix_object)
|
|
461
|
+
)
|
|
462
462
|
if "x_opencti_stix_ids" not in stix_object:
|
|
463
|
-
stix_object[
|
|
464
|
-
"
|
|
465
|
-
|
|
463
|
+
stix_object["x_opencti_stix_ids"] = (
|
|
464
|
+
self.opencti.get_attribute_in_extension("stix_ids", stix_object)
|
|
465
|
+
)
|
|
466
466
|
|
|
467
467
|
return self.create(
|
|
468
468
|
type=type,
|
|
469
469
|
stix_id=stix_object["id"],
|
|
470
|
-
createdBy=
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
objectMarking=
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
470
|
+
createdBy=(
|
|
471
|
+
extras["created_by_id"] if "created_by_id" in extras else None
|
|
472
|
+
),
|
|
473
|
+
objectMarking=(
|
|
474
|
+
extras["object_marking_ids"]
|
|
475
|
+
if "object_marking_ids" in extras
|
|
476
|
+
else None
|
|
477
|
+
),
|
|
478
|
+
objectLabel=(
|
|
479
|
+
extras["object_label_ids"] if "object_label_ids" in extras else None
|
|
480
|
+
),
|
|
481
|
+
externalReferences=(
|
|
482
|
+
extras["external_references_ids"]
|
|
483
|
+
if "external_references_ids" in extras
|
|
484
|
+
else None
|
|
485
|
+
),
|
|
482
486
|
revoked=stix_object["revoked"] if "revoked" in stix_object else None,
|
|
483
|
-
confidence=
|
|
484
|
-
|
|
485
|
-
|
|
487
|
+
confidence=(
|
|
488
|
+
stix_object["confidence"] if "confidence" in stix_object else None
|
|
489
|
+
),
|
|
486
490
|
lang=stix_object["lang"] if "lang" in stix_object else None,
|
|
487
491
|
created=stix_object["created"] if "created" in stix_object else None,
|
|
488
492
|
modified=stix_object["modified"] if "modified" in stix_object else None,
|
|
489
493
|
name=name,
|
|
490
|
-
description=
|
|
491
|
-
stix_object["description"]
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
494
|
+
description=(
|
|
495
|
+
self.opencti.stix2.convert_markdown(stix_object["description"])
|
|
496
|
+
if "description" in stix_object
|
|
497
|
+
else None
|
|
498
|
+
),
|
|
495
499
|
latitude=stix_object["latitude"] if "latitude" in stix_object else None,
|
|
496
|
-
longitude=
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
precision=
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
x_opencti_stix_ids=
|
|
503
|
-
|
|
504
|
-
|
|
500
|
+
longitude=(
|
|
501
|
+
stix_object["longitude"] if "longitude" in stix_object else None
|
|
502
|
+
),
|
|
503
|
+
precision=(
|
|
504
|
+
stix_object["precision"] if "precision" in stix_object else None
|
|
505
|
+
),
|
|
506
|
+
x_opencti_stix_ids=(
|
|
507
|
+
stix_object["x_opencti_stix_ids"]
|
|
508
|
+
if "x_opencti_stix_ids" in stix_object
|
|
509
|
+
else None
|
|
510
|
+
),
|
|
505
511
|
x_opencti_aliases=self.opencti.stix2.pick_aliases(stix_object),
|
|
506
512
|
update=update,
|
|
507
513
|
)
|