pycti 6.0.3__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/api/opencti_api_client.py +3 -0
- pycti/entities/opencti_external_reference.py +1 -1
- pycti/entities/opencti_stix_cyber_observable.py +1 -1
- pycti/entities/opencti_stix_domain_object.py +1 -1
- pycti/utils/opencti_stix2.py +76 -64
- {pycti-6.0.3.dist-info → pycti-6.0.5.dist-info}/METADATA +1 -1
- {pycti-6.0.3.dist-info → pycti-6.0.5.dist-info}/RECORD +11 -11
- {pycti-6.0.3.dist-info → pycti-6.0.5.dist-info}/LICENSE +0 -0
- {pycti-6.0.3.dist-info → pycti-6.0.5.dist-info}/WHEEL +0 -0
- {pycti-6.0.3.dist-info → pycti-6.0.5.dist-info}/top_level.txt +0 -0
pycti/__init__.py
CHANGED
pycti/api/opencti_api_client.py
CHANGED
|
@@ -210,6 +210,9 @@ class OpenCTIApiClient:
|
|
|
210
210
|
"true" if synchronized is True else "false"
|
|
211
211
|
)
|
|
212
212
|
|
|
213
|
+
def set_previous_standard_header(self, previous_standard):
|
|
214
|
+
self.request_headers["previous-standard"] = previous_standard
|
|
215
|
+
|
|
213
216
|
def get_request_headers(self):
|
|
214
217
|
return self.request_headers
|
|
215
218
|
|
|
@@ -274,7 +274,7 @@ class ExternalReference:
|
|
|
274
274
|
if id is not None and file_name is not None:
|
|
275
275
|
final_file_name = os.path.basename(file_name)
|
|
276
276
|
query = """
|
|
277
|
-
mutation ExternalReferenceEdit($id: ID!, $file: Upload!, $version:
|
|
277
|
+
mutation ExternalReferenceEdit($id: ID!, $file: Upload!, $version: DateTime, $noTriggerImport: Boolean) {
|
|
278
278
|
externalReferenceEdit(id: $id) {
|
|
279
279
|
importPush(file: $file, version: $version, noTriggerImport: $noTriggerImport) {
|
|
280
280
|
id
|
|
@@ -770,7 +770,7 @@ class StixCyberObservable:
|
|
|
770
770
|
if id is not None and file_name is not None:
|
|
771
771
|
final_file_name = os.path.basename(file_name)
|
|
772
772
|
query = """
|
|
773
|
-
mutation StixCyberObservableEdit($id: ID!, $file: Upload!, $version:
|
|
773
|
+
mutation StixCyberObservableEdit($id: ID!, $file: Upload!, $version: DateTime, $noTriggerImport: Boolean) {
|
|
774
774
|
stixCyberObservableEdit(id: $id) {
|
|
775
775
|
importPush(file: $file, version: $version, noTriggerImport: $noTriggerImport) {
|
|
776
776
|
id
|
|
@@ -1286,7 +1286,7 @@ class StixDomainObject:
|
|
|
1286
1286
|
if id is not None and file_name is not None:
|
|
1287
1287
|
final_file_name = os.path.basename(file_name)
|
|
1288
1288
|
query = """
|
|
1289
|
-
mutation StixDomainObjectEdit($id: ID!, $file: Upload!, $version:
|
|
1289
|
+
mutation StixDomainObjectEdit($id: ID!, $file: Upload!, $version: DateTime, $noTriggerImport: Boolean) {
|
|
1290
1290
|
stixDomainObjectEdit(id: $id) {
|
|
1291
1291
|
importPush(file: $file, version: $version, noTriggerImport: $noTriggerImport) {
|
|
1292
1292
|
id
|
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,6 +1,6 @@
|
|
|
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
|
-
pycti/api/opencti_api_client.py,sha256=
|
|
3
|
+
pycti/api/opencti_api_client.py,sha256=Jhzsl17JL78IphkbkM1ujLP4Pa8PfIGtUNkEcNRjHxM,28980
|
|
4
4
|
pycti/api/opencti_api_connector.py,sha256=fYF0Jy9KIMFNt1RC_A1rpWomVJ-oj5HiSsBem4W0J5U,3549
|
|
5
5
|
pycti/api/opencti_api_playbook.py,sha256=Wcf-G__IHmR7LwtUFVUVx4Skg9e2mcb89n_HyfWC9YM,1383
|
|
6
6
|
pycti/api/opencti_api_work.py,sha256=ow30gswv4k5zLlZGlvLAn47ZM07RLsYvEV-KwtwedQg,7109
|
|
@@ -19,7 +19,7 @@ pycti/entities/opencti_course_of_action.py,sha256=hHjMj8V7Shx275bdvXWAomzsGOz8mu
|
|
|
19
19
|
pycti/entities/opencti_data_component.py,sha256=sysuoh_blUlP1ZKzD6VqHkWZW09-gWVl1Wh8y9vG9Uc,18582
|
|
20
20
|
pycti/entities/opencti_data_source.py,sha256=YXhwvacEZCkHBUkW3eRaCwcGRKw1ZRgAjL4C1o-gbKU,17470
|
|
21
21
|
pycti/entities/opencti_event.py,sha256=Pam3eeR_Ytl_the-kV9IxXcfJKs2vRqN61igyDAlVE4,16706
|
|
22
|
-
pycti/entities/opencti_external_reference.py,sha256=
|
|
22
|
+
pycti/entities/opencti_external_reference.py,sha256=9Vz6ZIaE6im1f5hoEqizq5E31DQ7oFuqlXb-9JGy3Ao,13216
|
|
23
23
|
pycti/entities/opencti_feedback.py,sha256=cWfrMkIz_hj34ndVvty5YhDvuIDqmazgFVIGPtX7Zao,31738
|
|
24
24
|
pycti/entities/opencti_grouping.py,sha256=ESHKhmziy3pCNwPRKYStZi5p-TBE_u2D5j-v-4isYhQ,29320
|
|
25
25
|
pycti/entities/opencti_identity.py,sha256=YKTQugOSwyxSoMRWSdMWZkagidTbYQzi-Q1aEWO1a_8,22879
|
|
@@ -42,8 +42,8 @@ pycti/entities/opencti_report.py,sha256=tSMSCsAGgZny94EjFtidEws7Uf0gBI-nPHwkqPg2
|
|
|
42
42
|
pycti/entities/opencti_stix.py,sha256=uMheSg8i1f2Ozx2Mk0iShWzHHjj6MMWDtV5nDjVxKEE,2275
|
|
43
43
|
pycti/entities/opencti_stix_core_object.py,sha256=QRiAk5_loi4JLJN4aXSq8DTwFFzOLhbA7Y-2R3aO8kw,48728
|
|
44
44
|
pycti/entities/opencti_stix_core_relationship.py,sha256=cD825areOn2quv06M28YGE7A3bTQ8_Pxx1QW6JyoQBs,42895
|
|
45
|
-
pycti/entities/opencti_stix_cyber_observable.py,sha256=
|
|
46
|
-
pycti/entities/opencti_stix_domain_object.py,sha256=
|
|
45
|
+
pycti/entities/opencti_stix_cyber_observable.py,sha256=GzxaI3q28FURIPQFa6WapiPG90mNCR0zDlTar2UgEcE,104716
|
|
46
|
+
pycti/entities/opencti_stix_domain_object.py,sha256=xjU7-ew7nPbAf3U0uHC8TtC4n9leoMRklOHOUGIkdZk,78743
|
|
47
47
|
pycti/entities/opencti_stix_nested_ref_relationship.py,sha256=2r1i7cUl-WWictlnC_MJrm9sTIt_yJe2uqTpQm-yo6o,12330
|
|
48
48
|
pycti/entities/opencti_stix_object_or_stix_relationship.py,sha256=NOJdUU9cm_gMBne13EZPb8cfxOhTfgVVmv8A0yasQeI,14610
|
|
49
49
|
pycti/entities/opencti_stix_sighting_relationship.py,sha256=AmX1LBS8cW5a_dlik_sx-nBDvUcqb193gs4m3pB9C5U,27584
|
|
@@ -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
|