pycti 6.6.17__tar.gz → 6.6.18__tar.gz

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.

Files changed (84) hide show
  1. {pycti-6.6.17 → pycti-6.6.18}/PKG-INFO +4 -4
  2. {pycti-6.6.17 → pycti-6.6.18}/pycti/__init__.py +1 -1
  3. {pycti-6.6.17 → pycti-6.6.18}/pycti/connector/opencti_connector_helper.py +7 -8
  4. {pycti-6.6.17 → pycti-6.6.18}/pycti/utils/opencti_stix2.py +18 -2
  5. {pycti-6.6.17 → pycti-6.6.18}/pycti/utils/opencti_stix2_splitter.py +6 -3
  6. {pycti-6.6.17 → pycti-6.6.18}/pycti.egg-info/PKG-INFO +4 -4
  7. {pycti-6.6.17 → pycti-6.6.18}/pycti.egg-info/requires.txt +3 -3
  8. {pycti-6.6.17 → pycti-6.6.18}/setup.cfg +3 -3
  9. {pycti-6.6.17 → pycti-6.6.18}/LICENSE +0 -0
  10. {pycti-6.6.17 → pycti-6.6.18}/README.md +0 -0
  11. {pycti-6.6.17 → pycti-6.6.18}/pycti/api/__init__.py +0 -0
  12. {pycti-6.6.17 → pycti-6.6.18}/pycti/api/opencti_api_client.py +0 -0
  13. {pycti-6.6.17 → pycti-6.6.18}/pycti/api/opencti_api_connector.py +0 -0
  14. {pycti-6.6.17 → pycti-6.6.18}/pycti/api/opencti_api_playbook.py +0 -0
  15. {pycti-6.6.17 → pycti-6.6.18}/pycti/api/opencti_api_work.py +0 -0
  16. {pycti-6.6.17 → pycti-6.6.18}/pycti/connector/__init__.py +0 -0
  17. {pycti-6.6.17 → pycti-6.6.18}/pycti/connector/opencti_connector.py +0 -0
  18. {pycti-6.6.17 → pycti-6.6.18}/pycti/connector/opencti_metric_handler.py +0 -0
  19. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/__init__.py +0 -0
  20. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/indicator/__init__.py +0 -0
  21. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/indicator/opencti_indicator_properties.py +0 -0
  22. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_attack_pattern.py +0 -0
  23. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_campaign.py +0 -0
  24. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_capability.py +0 -0
  25. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_case_incident.py +0 -0
  26. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_case_rfi.py +0 -0
  27. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_case_rft.py +0 -0
  28. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_channel.py +0 -0
  29. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_course_of_action.py +0 -0
  30. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_data_component.py +0 -0
  31. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_data_source.py +0 -0
  32. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_event.py +0 -0
  33. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_external_reference.py +0 -0
  34. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_feedback.py +0 -0
  35. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_group.py +0 -0
  36. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_grouping.py +0 -0
  37. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_identity.py +0 -0
  38. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_incident.py +0 -0
  39. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_indicator.py +0 -0
  40. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_infrastructure.py +0 -0
  41. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_intrusion_set.py +0 -0
  42. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_kill_chain_phase.py +0 -0
  43. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_label.py +0 -0
  44. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_language.py +0 -0
  45. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_location.py +0 -0
  46. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_malware.py +0 -0
  47. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_malware_analysis.py +0 -0
  48. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_marking_definition.py +0 -0
  49. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_narrative.py +0 -0
  50. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_note.py +0 -0
  51. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_observed_data.py +0 -0
  52. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_opinion.py +0 -0
  53. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_report.py +0 -0
  54. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_role.py +0 -0
  55. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_settings.py +0 -0
  56. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_stix.py +0 -0
  57. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_stix_core_object.py +0 -0
  58. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_stix_core_relationship.py +0 -0
  59. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_stix_cyber_observable.py +0 -0
  60. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_stix_domain_object.py +0 -0
  61. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_stix_nested_ref_relationship.py +0 -0
  62. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_stix_object_or_stix_relationship.py +0 -0
  63. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_stix_sighting_relationship.py +0 -0
  64. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_task.py +0 -0
  65. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_threat_actor.py +0 -0
  66. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_threat_actor_group.py +0 -0
  67. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_threat_actor_individual.py +0 -0
  68. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_tool.py +0 -0
  69. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_user.py +0 -0
  70. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_vocabulary.py +0 -0
  71. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/opencti_vulnerability.py +0 -0
  72. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/stix_cyber_observable/__init__.py +0 -0
  73. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_deprecated.py +0 -0
  74. {pycti-6.6.17 → pycti-6.6.18}/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py +0 -0
  75. {pycti-6.6.17 → pycti-6.6.18}/pycti/utils/__init__.py +0 -0
  76. {pycti-6.6.17 → pycti-6.6.18}/pycti/utils/constants.py +0 -0
  77. {pycti-6.6.17 → pycti-6.6.18}/pycti/utils/opencti_logger.py +0 -0
  78. {pycti-6.6.17 → pycti-6.6.18}/pycti/utils/opencti_stix2_identifier.py +0 -0
  79. {pycti-6.6.17 → pycti-6.6.18}/pycti/utils/opencti_stix2_update.py +0 -0
  80. {pycti-6.6.17 → pycti-6.6.18}/pycti/utils/opencti_stix2_utils.py +0 -0
  81. {pycti-6.6.17 → pycti-6.6.18}/pycti.egg-info/SOURCES.txt +0 -0
  82. {pycti-6.6.17 → pycti-6.6.18}/pycti.egg-info/dependency_links.txt +0 -0
  83. {pycti-6.6.17 → pycti-6.6.18}/pycti.egg-info/top_level.txt +0 -0
  84. {pycti-6.6.17 → pycti-6.6.18}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycti
3
- Version: 6.6.17
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~=78.1.0
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.1.1; extra == "dev"
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.3.4; extra == "dev"
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,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "6.6.17"
2
+ __version__ = "6.6.18"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -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
- expectations_number,
1923
- bundles,
1924
- ) = stix2_splitter.split_bundle_with_expectations(
1925
- bundle=bundle,
1926
- use_json=True,
1927
- event_version=event_version,
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:
@@ -2748,9 +2748,25 @@ class OpenCTIStix2:
2748
2748
  )
2749
2749
 
2750
2750
  stix2_splitter = OpenCTIStix2Splitter()
2751
- _, bundles = stix2_splitter.split_bundle_with_expectations(
2752
- stix_bundle, False, event_version
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
- expectations, bundles = self.split_bundle_with_expectations(
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.17
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~=78.1.0
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.1.1; extra == "dev"
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.3.4; extra == "dev"
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
@@ -4,7 +4,7 @@ pydantic~=2.11.3
4
4
  python_json_logger~=3.3.0
5
5
  PyYAML~=6.0
6
6
  requests~=2.32.3
7
- setuptools~=78.1.0
7
+ setuptools~=80.9.0
8
8
  cachetools~=5.5.0
9
9
  prometheus-client~=0.21.1
10
10
  opentelemetry-api~=1.32.0
@@ -28,9 +28,9 @@ isort~=6.0.0
28
28
  types-pytz~=2025.2.0.20250326
29
29
  pre-commit~=4.2.0
30
30
  pytest-cases~=3.8.0
31
- pytest-cov~=6.1.1
31
+ pytest-cov~=6.2.1
32
32
  pytest_randomly~=3.16.0
33
- pytest~=8.3.4
33
+ pytest~=8.4.1
34
34
  types-python-dateutil~=2.9.0
35
35
  wheel~=0.45.1
36
36
 
@@ -42,7 +42,7 @@ install_requires =
42
42
  python_json_logger~=3.3.0
43
43
  PyYAML~=6.0
44
44
  requests~=2.32.3
45
- setuptools~=78.1.0
45
+ setuptools~=80.9.0
46
46
  cachetools~=5.5.0
47
47
  prometheus-client~=0.21.1
48
48
  opentelemetry-api~=1.32.0
@@ -61,9 +61,9 @@ dev =
61
61
  types-pytz~=2025.2.0.20250326
62
62
  pre-commit~=4.2.0
63
63
  pytest-cases~=3.8.0
64
- pytest-cov~=6.1.1
64
+ pytest-cov~=6.2.1
65
65
  pytest_randomly~=3.16.0
66
- pytest~=8.3.4
66
+ pytest~=8.4.1
67
67
  types-python-dateutil~=2.9.0
68
68
  wheel~=0.45.1
69
69
  doc =
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes