pycti 6.0.4__py3-none-any.whl → 6.0.5__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/utils/opencti_stix2.py +76 -64
- {pycti-6.0.4.dist-info → pycti-6.0.5.dist-info}/METADATA +1 -1
- {pycti-6.0.4.dist-info → pycti-6.0.5.dist-info}/RECORD +7 -7
- {pycti-6.0.4.dist-info → pycti-6.0.5.dist-info}/LICENSE +0 -0
- {pycti-6.0.4.dist-info → pycti-6.0.5.dist-info}/WHEEL +0 -0
- {pycti-6.0.4.dist-info → pycti-6.0.5.dist-info}/top_level.txt +0 -0
pycti/__init__.py
CHANGED
pycti/utils/opencti_stix2.py
CHANGED
|
@@ -554,14 +554,17 @@ class OpenCTIStix2:
|
|
|
554
554
|
)["id"]
|
|
555
555
|
if "x_opencti_files" in external_reference:
|
|
556
556
|
for file in external_reference["x_opencti_files"]:
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
557
|
+
if "data" in file:
|
|
558
|
+
self.opencti.external_reference.add_file(
|
|
559
|
+
id=external_reference_id,
|
|
560
|
+
file_name=file["name"],
|
|
561
|
+
version=file.get("version", None),
|
|
562
|
+
data=base64.b64decode(file["data"]),
|
|
563
|
+
mime_type=file["mime_type"],
|
|
564
|
+
no_trigger_import=file.get(
|
|
565
|
+
"no_trigger_import", False
|
|
566
|
+
),
|
|
567
|
+
)
|
|
565
568
|
if (
|
|
566
569
|
self.opencti.get_attribute_in_extension(
|
|
567
570
|
"files", external_reference
|
|
@@ -571,14 +574,17 @@ class OpenCTIStix2:
|
|
|
571
574
|
for file in self.opencti.get_attribute_in_extension(
|
|
572
575
|
"files", external_reference
|
|
573
576
|
):
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
577
|
+
if "data" in file:
|
|
578
|
+
self.opencti.external_reference.add_file(
|
|
579
|
+
id=external_reference_id,
|
|
580
|
+
file_name=file["name"],
|
|
581
|
+
version=file.get("version", None),
|
|
582
|
+
data=base64.b64decode(file["data"]),
|
|
583
|
+
mime_type=file["mime_type"],
|
|
584
|
+
no_trigger_import=file.get(
|
|
585
|
+
"no_trigger_import", False
|
|
586
|
+
),
|
|
587
|
+
)
|
|
582
588
|
self.mapping_cache[generated_ref_id] = generated_ref_id
|
|
583
589
|
external_references_ids.append(external_reference_id)
|
|
584
590
|
if stix_object["type"] in [
|
|
@@ -722,14 +728,15 @@ class OpenCTIStix2:
|
|
|
722
728
|
)["id"]
|
|
723
729
|
if "x_opencti_files" in external_reference:
|
|
724
730
|
for file in external_reference["x_opencti_files"]:
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
731
|
+
if "data" in file:
|
|
732
|
+
self.opencti.external_reference.add_file(
|
|
733
|
+
id=external_reference_id,
|
|
734
|
+
file_name=file["name"],
|
|
735
|
+
version=file.get("version", None),
|
|
736
|
+
data=base64.b64decode(file["data"]),
|
|
737
|
+
mime_type=file["mime_type"],
|
|
738
|
+
no_trigger_import=file.get("no_trigger_import", False),
|
|
739
|
+
)
|
|
733
740
|
if (
|
|
734
741
|
self.opencti.get_attribute_in_extension("files", external_reference)
|
|
735
742
|
is not None
|
|
@@ -737,14 +744,15 @@ class OpenCTIStix2:
|
|
|
737
744
|
for file in self.opencti.get_attribute_in_extension(
|
|
738
745
|
"files", external_reference
|
|
739
746
|
):
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
747
|
+
if "data" in file:
|
|
748
|
+
self.opencti.external_reference.add_file(
|
|
749
|
+
id=external_reference_id,
|
|
750
|
+
file_name=file["name"],
|
|
751
|
+
version=file.get("version", None),
|
|
752
|
+
data=base64.b64decode(file["data"]),
|
|
753
|
+
mime_type=file["mime_type"],
|
|
754
|
+
no_trigger_import=file.get("no_trigger_import", False),
|
|
755
|
+
)
|
|
748
756
|
self.mapping_cache[generated_ref_id] = generated_ref_id
|
|
749
757
|
external_references_ids.append(external_reference_id)
|
|
750
758
|
# Granted refs
|
|
@@ -948,14 +956,15 @@ class OpenCTIStix2:
|
|
|
948
956
|
# Add files
|
|
949
957
|
if "x_opencti_files" in stix_object:
|
|
950
958
|
for file in stix_object["x_opencti_files"]:
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
+
if "data" in file:
|
|
960
|
+
self.opencti.stix_domain_object.add_file(
|
|
961
|
+
id=stix_object_result["id"],
|
|
962
|
+
file_name=file["name"],
|
|
963
|
+
version=file.get("version", None),
|
|
964
|
+
data=base64.b64decode(file["data"]),
|
|
965
|
+
mime_type=file["mime_type"],
|
|
966
|
+
no_trigger_import=file.get("no_trigger_import", False),
|
|
967
|
+
)
|
|
959
968
|
if (
|
|
960
969
|
self.opencti.get_attribute_in_extension("files", stix_object)
|
|
961
970
|
is not None
|
|
@@ -963,14 +972,15 @@ class OpenCTIStix2:
|
|
|
963
972
|
for file in self.opencti.get_attribute_in_extension(
|
|
964
973
|
"files", stix_object
|
|
965
974
|
):
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
975
|
+
if "data" in file:
|
|
976
|
+
self.opencti.stix_domain_object.add_file(
|
|
977
|
+
id=stix_object_result["id"],
|
|
978
|
+
file_name=file["name"],
|
|
979
|
+
version=file.get("version", None),
|
|
980
|
+
data=base64.b64decode(file["data"]),
|
|
981
|
+
mime_type=file["mime_type"],
|
|
982
|
+
no_trigger_import=file.get("no_trigger_import", False),
|
|
983
|
+
)
|
|
974
984
|
return stix_object_results
|
|
975
985
|
|
|
976
986
|
def import_observable(
|
|
@@ -1071,14 +1081,15 @@ class OpenCTIStix2:
|
|
|
1071
1081
|
# Add files
|
|
1072
1082
|
if "x_opencti_files" in stix_object:
|
|
1073
1083
|
for file in stix_object["x_opencti_files"]:
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1084
|
+
if "data" in file:
|
|
1085
|
+
self.opencti.stix_cyber_observable.add_file(
|
|
1086
|
+
id=stix_observable_result["id"],
|
|
1087
|
+
file_name=file["name"],
|
|
1088
|
+
version=file.get("version", None),
|
|
1089
|
+
data=base64.b64decode(file["data"]),
|
|
1090
|
+
mime_type=file["mime_type"],
|
|
1091
|
+
no_trigger_import=file.get("no_trigger_import", False),
|
|
1092
|
+
)
|
|
1082
1093
|
if (
|
|
1083
1094
|
self.opencti.get_attribute_in_extension("files", stix_object)
|
|
1084
1095
|
is not None
|
|
@@ -1086,14 +1097,15 @@ class OpenCTIStix2:
|
|
|
1086
1097
|
for file in self.opencti.get_attribute_in_extension(
|
|
1087
1098
|
"files", stix_object
|
|
1088
1099
|
):
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1100
|
+
if "data" in file:
|
|
1101
|
+
self.opencti.stix_cyber_observable.add_file(
|
|
1102
|
+
id=stix_observable_result["id"],
|
|
1103
|
+
file_name=file["name"],
|
|
1104
|
+
version=file.get("version", None),
|
|
1105
|
+
data=base64.b64decode(file["data"]),
|
|
1106
|
+
mime_type=file["mime_type"],
|
|
1107
|
+
no_trigger_import=file.get("no_trigger_import", False),
|
|
1108
|
+
)
|
|
1097
1109
|
if "id" in stix_object:
|
|
1098
1110
|
self.mapping_cache[stix_object["id"]] = {
|
|
1099
1111
|
"id": stix_observable_result["id"],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pycti/__init__.py,sha256=
|
|
1
|
+
pycti/__init__.py,sha256=UdnnnjOuX_TyV4zM-zQhInsbQT55__uvDKICnQmM8pw,4691
|
|
2
2
|
pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
pycti/api/opencti_api_client.py,sha256=Jhzsl17JL78IphkbkM1ujLP4Pa8PfIGtUNkEcNRjHxM,28980
|
|
4
4
|
pycti/api/opencti_api_connector.py,sha256=fYF0Jy9KIMFNt1RC_A1rpWomVJ-oj5HiSsBem4W0J5U,3549
|
|
@@ -57,12 +57,12 @@ pycti/entities/opencti_vulnerability.py,sha256=dzJ0fZB2XrkPwT-cANr6atzYOWXF5nk0a
|
|
|
57
57
|
pycti/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
58
|
pycti/utils/constants.py,sha256=mAAeNGXyHU89yp8lihXBKF9fKncQCKwyxD2PVz5D2wI,7915
|
|
59
59
|
pycti/utils/opencti_logger.py,sha256=0dvB75V0SuPFGxL539dAQrxTt1N5Acx0A3Ogwl5WMJ8,2199
|
|
60
|
-
pycti/utils/opencti_stix2.py,sha256=
|
|
60
|
+
pycti/utils/opencti_stix2.py,sha256=HEHCnlfCM8sGJ9dyGYoLc3BKdMORPfUvsJJ_akB5WmM,111480
|
|
61
61
|
pycti/utils/opencti_stix2_splitter.py,sha256=Ht9Mp-W3gbwxIKEr7i_5NYpcDr3TA2gYdC4TzOz0G4c,4496
|
|
62
62
|
pycti/utils/opencti_stix2_update.py,sha256=CnMyqkeVA0jgyxEcgqna8sABU4YPMjkEJ228GVurIn4,14658
|
|
63
63
|
pycti/utils/opencti_stix2_utils.py,sha256=_ijIz6SRP2OeIaWJcXJt8go510MUEGfWE3KY-I_9QZc,3725
|
|
64
|
-
pycti-6.0.
|
|
65
|
-
pycti-6.0.
|
|
66
|
-
pycti-6.0.
|
|
67
|
-
pycti-6.0.
|
|
68
|
-
pycti-6.0.
|
|
64
|
+
pycti-6.0.5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
65
|
+
pycti-6.0.5.dist-info/METADATA,sha256=SdYteu94Gpw7ejZNzHaSBmz9g8ustH6pPyEr8-IK9LU,5398
|
|
66
|
+
pycti-6.0.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
67
|
+
pycti-6.0.5.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
|
|
68
|
+
pycti-6.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|