pycti 6.6.17__py3-none-any.whl → 6.6.18__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 +7 -8
- pycti/utils/opencti_stix2.py +18 -2
- pycti/utils/opencti_stix2_splitter.py +6 -3
- {pycti-6.6.17.dist-info → pycti-6.6.18.dist-info}/METADATA +4 -4
- {pycti-6.6.17.dist-info → pycti-6.6.18.dist-info}/RECORD +9 -9
- {pycti-6.6.17.dist-info → pycti-6.6.18.dist-info}/WHEEL +0 -0
- {pycti-6.6.17.dist-info → pycti-6.6.18.dist-info}/licenses/LICENSE +0 -0
- {pycti-6.6.17.dist-info → pycti-6.6.18.dist-info}/top_level.txt +0 -0
pycti/__init__.py
CHANGED
|
@@ -1918,14 +1918,13 @@ class OpenCTIConnectorHelper: # pylint: disable=too-many-public-methods
|
|
|
1918
1918
|
os.rename(write_file, final_write_file)
|
|
1919
1919
|
|
|
1920
1920
|
stix2_splitter = OpenCTIStix2Splitter()
|
|
1921
|
-
(
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
cleanup_inconsistent_bundle=cleanup_inconsistent_bundle,
|
|
1921
|
+
(expectations_number, _, bundles) = (
|
|
1922
|
+
stix2_splitter.split_bundle_with_expectations(
|
|
1923
|
+
bundle=bundle,
|
|
1924
|
+
use_json=True,
|
|
1925
|
+
event_version=event_version,
|
|
1926
|
+
cleanup_inconsistent_bundle=cleanup_inconsistent_bundle,
|
|
1927
|
+
)
|
|
1929
1928
|
)
|
|
1930
1929
|
|
|
1931
1930
|
if len(bundles) == 0:
|
pycti/utils/opencti_stix2.py
CHANGED
|
@@ -2748,9 +2748,25 @@ class OpenCTIStix2:
|
|
|
2748
2748
|
)
|
|
2749
2749
|
|
|
2750
2750
|
stix2_splitter = OpenCTIStix2Splitter()
|
|
2751
|
-
_, bundles =
|
|
2752
|
-
|
|
2751
|
+
_, incompatible_elements, bundles = (
|
|
2752
|
+
stix2_splitter.split_bundle_with_expectations(
|
|
2753
|
+
stix_bundle, False, event_version
|
|
2754
|
+
)
|
|
2753
2755
|
)
|
|
2756
|
+
|
|
2757
|
+
# Report every element ignored during bundle splitting
|
|
2758
|
+
if work_id is not None:
|
|
2759
|
+
for incompatible_element in incompatible_elements:
|
|
2760
|
+
self.opencti.work.report_expectation(
|
|
2761
|
+
work_id,
|
|
2762
|
+
{
|
|
2763
|
+
"error": "Incompatible element in bundle",
|
|
2764
|
+
"source": "Element "
|
|
2765
|
+
+ incompatible_element["id"]
|
|
2766
|
+
+ " is incompatible and couldn't be processed",
|
|
2767
|
+
},
|
|
2768
|
+
)
|
|
2769
|
+
|
|
2754
2770
|
# Import every element in a specific order
|
|
2755
2771
|
imported_elements = []
|
|
2756
2772
|
for bundle in bundles:
|
|
@@ -35,6 +35,7 @@ class OpenCTIStix2Splitter:
|
|
|
35
35
|
self.cache_index = {}
|
|
36
36
|
self.cache_refs = {}
|
|
37
37
|
self.elements = []
|
|
38
|
+
self.incompatible_items = []
|
|
38
39
|
|
|
39
40
|
def get_internal_ids_in_extension(self, item):
|
|
40
41
|
ids = []
|
|
@@ -189,6 +190,8 @@ class OpenCTIStix2Splitter:
|
|
|
189
190
|
is_compatible = is_id_supported(item_id)
|
|
190
191
|
if is_compatible:
|
|
191
192
|
self.elements.append(item)
|
|
193
|
+
else:
|
|
194
|
+
self.incompatible_items.append(item)
|
|
192
195
|
self.cache_index[item_id] = item
|
|
193
196
|
for internal_id in self.get_internal_ids_in_extension(item):
|
|
194
197
|
self.cache_index[internal_id] = item
|
|
@@ -201,7 +204,7 @@ class OpenCTIStix2Splitter:
|
|
|
201
204
|
use_json=True,
|
|
202
205
|
event_version=None,
|
|
203
206
|
cleanup_inconsistent_bundle=False,
|
|
204
|
-
) -> Tuple[int, list]:
|
|
207
|
+
) -> Tuple[int, list, list]:
|
|
205
208
|
"""splits a valid stix2 bundle into a list of bundles"""
|
|
206
209
|
if use_json:
|
|
207
210
|
try:
|
|
@@ -251,11 +254,11 @@ class OpenCTIStix2Splitter:
|
|
|
251
254
|
)
|
|
252
255
|
)
|
|
253
256
|
|
|
254
|
-
return number_expectations, bundles
|
|
257
|
+
return number_expectations, self.incompatible_items, bundles
|
|
255
258
|
|
|
256
259
|
@deprecated("Use split_bundle_with_expectations instead")
|
|
257
260
|
def split_bundle(self, bundle, use_json=True, event_version=None) -> list:
|
|
258
|
-
|
|
261
|
+
_, _, bundles = self.split_bundle_with_expectations(
|
|
259
262
|
bundle, use_json, event_version
|
|
260
263
|
)
|
|
261
264
|
return bundles
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycti
|
|
3
|
-
Version: 6.6.
|
|
3
|
+
Version: 6.6.18
|
|
4
4
|
Summary: Python API client for OpenCTI.
|
|
5
5
|
Home-page: https://github.com/OpenCTI-Platform/client-python
|
|
6
6
|
Author: Filigran
|
|
@@ -29,7 +29,7 @@ Requires-Dist: python-magic-bin~=0.4.14; sys_platform == "win32"
|
|
|
29
29
|
Requires-Dist: python_json_logger~=3.3.0
|
|
30
30
|
Requires-Dist: PyYAML~=6.0
|
|
31
31
|
Requires-Dist: requests~=2.32.3
|
|
32
|
-
Requires-Dist: setuptools~=
|
|
32
|
+
Requires-Dist: setuptools~=80.9.0
|
|
33
33
|
Requires-Dist: cachetools~=5.5.0
|
|
34
34
|
Requires-Dist: prometheus-client~=0.21.1
|
|
35
35
|
Requires-Dist: opentelemetry-api~=1.32.0
|
|
@@ -46,9 +46,9 @@ Requires-Dist: isort~=6.0.0; extra == "dev"
|
|
|
46
46
|
Requires-Dist: types-pytz~=2025.2.0.20250326; extra == "dev"
|
|
47
47
|
Requires-Dist: pre-commit~=4.2.0; extra == "dev"
|
|
48
48
|
Requires-Dist: pytest-cases~=3.8.0; extra == "dev"
|
|
49
|
-
Requires-Dist: pytest-cov~=6.
|
|
49
|
+
Requires-Dist: pytest-cov~=6.2.1; extra == "dev"
|
|
50
50
|
Requires-Dist: pytest_randomly~=3.16.0; extra == "dev"
|
|
51
|
-
Requires-Dist: pytest~=8.
|
|
51
|
+
Requires-Dist: pytest~=8.4.1; extra == "dev"
|
|
52
52
|
Requires-Dist: types-python-dateutil~=2.9.0; extra == "dev"
|
|
53
53
|
Requires-Dist: wheel~=0.45.1; extra == "dev"
|
|
54
54
|
Provides-Extra: doc
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pycti/__init__.py,sha256=
|
|
1
|
+
pycti/__init__.py,sha256=Oo9wE2Y9tapATOditUhvMjvM_6r3hQwktbAty0nBn8M,5677
|
|
2
2
|
pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
pycti/api/opencti_api_client.py,sha256=yV8noIFiy-wtMbJ64KKZ7G7wUFZ10L6tYInmL_fKkMw,34567
|
|
4
4
|
pycti/api/opencti_api_connector.py,sha256=8xwHuLINP3ZCImzE9_K_iCR9QEA3K6aHpK4bJhcZf20,5582
|
|
@@ -6,7 +6,7 @@ pycti/api/opencti_api_playbook.py,sha256=456We78vESukfSOi_CctfZ9dbBJEi76EHClRc2f
|
|
|
6
6
|
pycti/api/opencti_api_work.py,sha256=V8n8KaLNiOUYTXYE251bC-yHMHiXSR_sf_0jk2RgANY,8456
|
|
7
7
|
pycti/connector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
pycti/connector/opencti_connector.py,sha256=8lCZFvcA9-S1x6vFl756hgWAlzKfrnq-C4AIdDJr-Kg,2715
|
|
9
|
-
pycti/connector/opencti_connector_helper.py,sha256=
|
|
9
|
+
pycti/connector/opencti_connector_helper.py,sha256=JAmoPXjBv_35aMrwVBwtavpkv9bMBfOj64EEYigz8vg,88546
|
|
10
10
|
pycti/connector/opencti_metric_handler.py,sha256=4jXHeJflomtHjuQ_YU0b36TG7o26vOWbY_jvU8Ezobs,3725
|
|
11
11
|
pycti/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
pycti/entities/opencti_attack_pattern.py,sha256=HVfLhtd8rlT42xutRS8qOkDsG5_Ws4EoGfObLW5mQl4,22535
|
|
@@ -67,13 +67,13 @@ pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py
|
|
|
67
67
|
pycti/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
68
|
pycti/utils/constants.py,sha256=AfECYKzdwos6Z6yUGXaUGtip_bRsVQaCKBw6nwSmNqE,12799
|
|
69
69
|
pycti/utils/opencti_logger.py,sha256=BHNy9fJuTUTn_JEYSCmyvVwd6y-9ZJKxO40mY4iZ0bc,2226
|
|
70
|
-
pycti/utils/opencti_stix2.py,sha256=
|
|
70
|
+
pycti/utils/opencti_stix2.py,sha256=6vl3x23lojcWAw-X0ePukh1Ufnj7sCm9yeLayZ3b--M,122090
|
|
71
71
|
pycti/utils/opencti_stix2_identifier.py,sha256=k8L1z4q1xdCBfxqUba4YS_kT-MmbJFxYh0RvfGOmrOs,837
|
|
72
|
-
pycti/utils/opencti_stix2_splitter.py,sha256=
|
|
72
|
+
pycti/utils/opencti_stix2_splitter.py,sha256=Adu0PVQX2EoNLkcy_kkA25-OsBidCwiFTPwq1BSjsls,11201
|
|
73
73
|
pycti/utils/opencti_stix2_update.py,sha256=CnMyqkeVA0jgyxEcgqna8sABU4YPMjkEJ228GVurIn4,14658
|
|
74
74
|
pycti/utils/opencti_stix2_utils.py,sha256=xgBZzm7HC76rLQYwTKkaUd_w9jJnVMoryHx7KDDIB_g,5065
|
|
75
|
-
pycti-6.6.
|
|
76
|
-
pycti-6.6.
|
|
77
|
-
pycti-6.6.
|
|
78
|
-
pycti-6.6.
|
|
79
|
-
pycti-6.6.
|
|
75
|
+
pycti-6.6.18.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
76
|
+
pycti-6.6.18.dist-info/METADATA,sha256=d-MgV3TnjD2ZrxgjwENR8E9dea0Fnn21hArP5RwG0W8,5531
|
|
77
|
+
pycti-6.6.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
78
|
+
pycti-6.6.18.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
|
|
79
|
+
pycti-6.6.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|