pycti 6.3.3__py3-none-any.whl → 6.3.4__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_splitter.py +23 -2
- {pycti-6.3.3.dist-info → pycti-6.3.4.dist-info}/METADATA +1 -1
- {pycti-6.3.3.dist-info → pycti-6.3.4.dist-info}/RECORD +7 -7
- {pycti-6.3.3.dist-info → pycti-6.3.4.dist-info}/LICENSE +0 -0
- {pycti-6.3.3.dist-info → pycti-6.3.4.dist-info}/WHEEL +0 -0
- {pycti-6.3.3.dist-info → pycti-6.3.4.dist-info}/top_level.txt +0 -0
pycti/__init__.py
CHANGED
|
@@ -13,6 +13,8 @@ from pycti.utils.opencti_stix2_utils import (
|
|
|
13
13
|
SUPPORTED_STIX_ENTITY_OBJECTS,
|
|
14
14
|
)
|
|
15
15
|
|
|
16
|
+
OPENCTI_EXTENSION = "extension-definition--ea279b3e-5c71-4632-ac08-831c66a786ba"
|
|
17
|
+
|
|
16
18
|
supported_types = (
|
|
17
19
|
SUPPORTED_STIX_ENTITY_OBJECTS # entities
|
|
18
20
|
+ list(STIX_CYBER_OBSERVABLE_MAPPING.keys()) # observables
|
|
@@ -21,8 +23,11 @@ supported_types = (
|
|
|
21
23
|
|
|
22
24
|
|
|
23
25
|
def is_id_supported(key):
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
if "--" in key:
|
|
27
|
+
id_type = key.split("--")[0]
|
|
28
|
+
return id_type in supported_types
|
|
29
|
+
# If not a stix id, don't try to filter
|
|
30
|
+
return True
|
|
26
31
|
|
|
27
32
|
|
|
28
33
|
class OpenCTIStix2Splitter:
|
|
@@ -31,6 +36,18 @@ class OpenCTIStix2Splitter:
|
|
|
31
36
|
self.cache_refs = {}
|
|
32
37
|
self.elements = []
|
|
33
38
|
|
|
39
|
+
def get_internal_ids_in_extension(self, item):
|
|
40
|
+
ids = []
|
|
41
|
+
if item.get("x_opencti_id"):
|
|
42
|
+
ids.append(item["x_opencti_id"])
|
|
43
|
+
if (
|
|
44
|
+
item.get("extensions")
|
|
45
|
+
and item["extensions"].get(OPENCTI_EXTENSION)
|
|
46
|
+
and item["extensions"].get(OPENCTI_EXTENSION).get("id")
|
|
47
|
+
):
|
|
48
|
+
ids.append(item["extensions"][OPENCTI_EXTENSION]["id"])
|
|
49
|
+
return ids
|
|
50
|
+
|
|
34
51
|
def enlist_element(
|
|
35
52
|
self, item_id, raw_data, cleanup_inconsistent_bundle, parent_acc
|
|
36
53
|
):
|
|
@@ -173,6 +190,8 @@ class OpenCTIStix2Splitter:
|
|
|
173
190
|
if is_compatible:
|
|
174
191
|
self.elements.append(item)
|
|
175
192
|
self.cache_index[item_id] = item
|
|
193
|
+
for internal_id in self.get_internal_ids_in_extension(item):
|
|
194
|
+
self.cache_index[internal_id] = item
|
|
176
195
|
|
|
177
196
|
return nb_deps
|
|
178
197
|
|
|
@@ -202,6 +221,8 @@ class OpenCTIStix2Splitter:
|
|
|
202
221
|
# Build flat list of elements
|
|
203
222
|
for item in bundle_data["objects"]:
|
|
204
223
|
raw_data[item["id"]] = item
|
|
224
|
+
for internal_id in self.get_internal_ids_in_extension(item):
|
|
225
|
+
raw_data[internal_id] = item
|
|
205
226
|
for item in bundle_data["objects"]:
|
|
206
227
|
self.enlist_element(item["id"], raw_data, cleanup_inconsistent_bundle, [])
|
|
207
228
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pycti/__init__.py,sha256=
|
|
1
|
+
pycti/__init__.py,sha256=xm5iuPc-4cpxj4TwZsTFPMvBUxLY4h4Y37iempfW33Y,5218
|
|
2
2
|
pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
pycti/api/opencti_api_client.py,sha256=WpJs3GtEO0kV29KXmKY-2JmtiL6JSPD-746-FbnIcik,31027
|
|
4
4
|
pycti/api/opencti_api_connector.py,sha256=ubM_zPjTD8L33TEugCQgf_YF9zugDFg_7FgNubGlwJw,5447
|
|
@@ -64,11 +64,11 @@ pycti/utils/constants.py,sha256=ZgOVxY5bnrHiNvPgOfZLWk16sSDnaE_tg8JVjZpw24Q,1183
|
|
|
64
64
|
pycti/utils/opencti_logger.py,sha256=0dvB75V0SuPFGxL539dAQrxTt1N5Acx0A3Ogwl5WMJ8,2199
|
|
65
65
|
pycti/utils/opencti_stix2.py,sha256=RhDTdDxSrhc6zMTH1QoLMSZSA20E0bWOAoOh0c4HhzM,116650
|
|
66
66
|
pycti/utils/opencti_stix2_identifier.py,sha256=k8L1z4q1xdCBfxqUba4YS_kT-MmbJFxYh0RvfGOmrOs,837
|
|
67
|
-
pycti/utils/opencti_stix2_splitter.py,sha256=
|
|
67
|
+
pycti/utils/opencti_stix2_splitter.py,sha256=etnAWMDzNi2JCovSUJ5Td-XLVdzgKRdsV1XfpXOGols,11070
|
|
68
68
|
pycti/utils/opencti_stix2_update.py,sha256=CnMyqkeVA0jgyxEcgqna8sABU4YPMjkEJ228GVurIn4,14658
|
|
69
69
|
pycti/utils/opencti_stix2_utils.py,sha256=xgBZzm7HC76rLQYwTKkaUd_w9jJnVMoryHx7KDDIB_g,5065
|
|
70
|
-
pycti-6.3.
|
|
71
|
-
pycti-6.3.
|
|
72
|
-
pycti-6.3.
|
|
73
|
-
pycti-6.3.
|
|
74
|
-
pycti-6.3.
|
|
70
|
+
pycti-6.3.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
71
|
+
pycti-6.3.4.dist-info/METADATA,sha256=K-Y_j3LsO7tL7UNGGqhS_nMwnU0yH-c61RID36GmVSg,5418
|
|
72
|
+
pycti-6.3.4.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
73
|
+
pycti-6.3.4.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
|
|
74
|
+
pycti-6.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|