pycti 6.7.11__tar.gz → 6.7.13__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 (91) hide show
  1. {pycti-6.7.11 → pycti-6.7.13}/PKG-INFO +5 -5
  2. {pycti-6.7.11 → pycti-6.7.13}/pycti/__init__.py +1 -1
  3. {pycti-6.7.11 → pycti-6.7.13}/pycti/connector/opencti_connector_helper.py +4 -3
  4. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_user.py +22 -0
  5. {pycti-6.7.11 → pycti-6.7.13}/pycti/utils/opencti_stix2.py +14 -0
  6. {pycti-6.7.11 → pycti-6.7.13}/pycti.egg-info/PKG-INFO +5 -5
  7. {pycti-6.7.11 → pycti-6.7.13}/pycti.egg-info/requires.txt +4 -4
  8. {pycti-6.7.11 → pycti-6.7.13}/setup.cfg +4 -4
  9. {pycti-6.7.11 → pycti-6.7.13}/LICENSE +0 -0
  10. {pycti-6.7.11 → pycti-6.7.13}/README.md +0 -0
  11. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/__init__.py +0 -0
  12. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_client.py +0 -0
  13. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_connector.py +0 -0
  14. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_draft.py +0 -0
  15. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_internal_file.py +0 -0
  16. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_notification.py +0 -0
  17. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_pir.py +0 -0
  18. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_playbook.py +0 -0
  19. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_public_dashboard.py +0 -0
  20. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_trash.py +0 -0
  21. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_work.py +0 -0
  22. {pycti-6.7.11 → pycti-6.7.13}/pycti/api/opencti_api_workspace.py +0 -0
  23. {pycti-6.7.11 → pycti-6.7.13}/pycti/connector/__init__.py +0 -0
  24. {pycti-6.7.11 → pycti-6.7.13}/pycti/connector/opencti_connector.py +0 -0
  25. {pycti-6.7.11 → pycti-6.7.13}/pycti/connector/opencti_metric_handler.py +0 -0
  26. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/__init__.py +0 -0
  27. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/indicator/__init__.py +0 -0
  28. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/indicator/opencti_indicator_properties.py +0 -0
  29. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_attack_pattern.py +0 -0
  30. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_campaign.py +0 -0
  31. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_capability.py +0 -0
  32. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_case_incident.py +0 -0
  33. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_case_rfi.py +0 -0
  34. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_case_rft.py +0 -0
  35. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_channel.py +0 -0
  36. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_course_of_action.py +0 -0
  37. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_data_component.py +0 -0
  38. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_data_source.py +0 -0
  39. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_event.py +0 -0
  40. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_external_reference.py +0 -0
  41. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_feedback.py +0 -0
  42. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_group.py +0 -0
  43. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_grouping.py +0 -0
  44. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_identity.py +0 -0
  45. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_incident.py +0 -0
  46. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_indicator.py +0 -0
  47. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_infrastructure.py +0 -0
  48. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_intrusion_set.py +0 -0
  49. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_kill_chain_phase.py +0 -0
  50. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_label.py +0 -0
  51. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_language.py +0 -0
  52. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_location.py +0 -0
  53. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_malware.py +0 -0
  54. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_malware_analysis.py +0 -0
  55. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_marking_definition.py +0 -0
  56. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_narrative.py +0 -0
  57. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_note.py +0 -0
  58. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_observed_data.py +0 -0
  59. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_opinion.py +0 -0
  60. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_report.py +0 -0
  61. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_role.py +0 -0
  62. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_settings.py +0 -0
  63. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_stix.py +0 -0
  64. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_stix_core_object.py +0 -0
  65. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_stix_core_relationship.py +0 -0
  66. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_stix_cyber_observable.py +0 -0
  67. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_stix_domain_object.py +0 -0
  68. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_stix_nested_ref_relationship.py +0 -0
  69. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_stix_object_or_stix_relationship.py +0 -0
  70. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_stix_sighting_relationship.py +0 -0
  71. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_task.py +0 -0
  72. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_threat_actor.py +0 -0
  73. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_threat_actor_group.py +0 -0
  74. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_threat_actor_individual.py +0 -0
  75. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_tool.py +0 -0
  76. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_vocabulary.py +0 -0
  77. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/opencti_vulnerability.py +0 -0
  78. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/stix_cyber_observable/__init__.py +0 -0
  79. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_deprecated.py +0 -0
  80. {pycti-6.7.11 → pycti-6.7.13}/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py +0 -0
  81. {pycti-6.7.11 → pycti-6.7.13}/pycti/utils/__init__.py +0 -0
  82. {pycti-6.7.11 → pycti-6.7.13}/pycti/utils/constants.py +0 -0
  83. {pycti-6.7.11 → pycti-6.7.13}/pycti/utils/opencti_logger.py +0 -0
  84. {pycti-6.7.11 → pycti-6.7.13}/pycti/utils/opencti_stix2_identifier.py +0 -0
  85. {pycti-6.7.11 → pycti-6.7.13}/pycti/utils/opencti_stix2_splitter.py +0 -0
  86. {pycti-6.7.11 → pycti-6.7.13}/pycti/utils/opencti_stix2_update.py +0 -0
  87. {pycti-6.7.11 → pycti-6.7.13}/pycti/utils/opencti_stix2_utils.py +0 -0
  88. {pycti-6.7.11 → pycti-6.7.13}/pycti.egg-info/SOURCES.txt +0 -0
  89. {pycti-6.7.11 → pycti-6.7.13}/pycti.egg-info/dependency_links.txt +0 -0
  90. {pycti-6.7.11 → pycti-6.7.13}/pycti.egg-info/top_level.txt +0 -0
  91. {pycti-6.7.11 → pycti-6.7.13}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycti
3
- Version: 6.7.11
3
+ Version: 6.7.13
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -23,20 +23,20 @@ Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: datefinder~=0.7.3
25
25
  Requires-Dist: pika~=1.3.0
26
- Requires-Dist: pydantic~=2.11.3
26
+ Requires-Dist: pydantic<3,>=2.8.2
27
27
  Requires-Dist: python-magic~=0.4.27; sys_platform == "linux" or sys_platform == "darwin"
28
28
  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
- Requires-Dist: requests~=2.32.3
31
+ Requires-Dist: requests<3,>=2.32.0
32
32
  Requires-Dist: setuptools~=80.9.0
33
33
  Requires-Dist: cachetools~=5.5.2
34
34
  Requires-Dist: prometheus-client~=0.22.1
35
35
  Requires-Dist: opentelemetry-api~=1.35.0
36
36
  Requires-Dist: opentelemetry-sdk~=1.35.0
37
37
  Requires-Dist: deprecation~=2.1.0
38
- Requires-Dist: fastapi<0.117.0,>=0.116.1
39
- Requires-Dist: uvicorn[standard]<0.36.0,>=0.35.0
38
+ Requires-Dist: fastapi<0.117.0,>=0.115.2
39
+ Requires-Dist: uvicorn[standard]<0.36.0,>=0.34.0
40
40
  Requires-Dist: filigran-sseclient>=1.0.2
41
41
  Requires-Dist: stix2~=3.0.1
42
42
  Provides-Extra: dev
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "6.7.11"
2
+ __version__ = "6.7.13"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -783,9 +783,10 @@ class ListenStream(threading.Thread):
783
783
  # state can be None if reset from the UI
784
784
  # In this case, default parameters will be used but SSE Client needs to be restarted
785
785
  if state is None:
786
- self.exit = True
787
- state["start_from"] = str(msg.id)
788
- self.helper.set_state(state)
786
+ self.exit_event.set()
787
+ else:
788
+ state["start_from"] = str(msg.id)
789
+ self.helper.set_state(state)
789
790
  except Exception as ex:
790
791
  self.helper.connector_logger.error(
791
792
  "Error in ListenStream loop, exit.", {"reason": str(ex)}
@@ -785,6 +785,28 @@ class User:
785
785
  result["data"]["userEdit"]["tokenRenew"]
786
786
  )
787
787
 
788
+ def send_mail(self, **kwargs):
789
+ id = kwargs.get("id", None)
790
+ template_id = kwargs.get("template_id", None)
791
+ if id is None or template_id is None:
792
+ self.opencti.admin_logger.error(
793
+ "[opencti_user] Missing parameters: id and template_id"
794
+ )
795
+
796
+ self.opencti.admin_logger.info(
797
+ "Send email to user", {"id": id, "template_id": template_id}
798
+ )
799
+ input = {
800
+ "target_user_id": id,
801
+ "email_template_id": template_id,
802
+ }
803
+ query = """
804
+ mutation SendUserMail($input: SendUserMailInput!) {
805
+ sendUserMail(input: $input)
806
+ }
807
+ """
808
+ self.opencti.query(query, {"input": input})
809
+
788
810
  def process_multiple_fields(self, data):
789
811
  if "roles" in data:
790
812
  data["roles"] = self.opencti.process_multiple(data["roles"])
@@ -2646,6 +2646,18 @@ class OpenCTIStix2:
2646
2646
  {"type": item["type"]},
2647
2647
  )
2648
2648
 
2649
+ def send_email(self, item):
2650
+ template_id = self.opencti.get_attribute_in_extension("template_id", item)
2651
+ if template_id is None:
2652
+ template_id = item["template_id"]
2653
+ if item["type"] == "user":
2654
+ self.opencti.user.send_mail(id=item["id"], template_id=template_id[0])
2655
+ else:
2656
+ raise ValueError(
2657
+ "Not supported opencti_operation for this type",
2658
+ {"type": item["type"]},
2659
+ )
2660
+
2649
2661
  def element_operation_delete(self, item, operation):
2650
2662
  # If data is stix, just use the generic stix function for deletion
2651
2663
  force_delete = operation == "delete_force"
@@ -2738,6 +2750,8 @@ class OpenCTIStix2:
2738
2750
  self.element_add_groups(item)
2739
2751
  elif operation == "remove_groups":
2740
2752
  self.element_remove_groups(item)
2753
+ elif operation == "send_email":
2754
+ self.send_email(item=item)
2741
2755
  else:
2742
2756
  raise ValueError(
2743
2757
  "Not supported opencti_operation",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycti
3
- Version: 6.7.11
3
+ Version: 6.7.13
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -23,20 +23,20 @@ Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: datefinder~=0.7.3
25
25
  Requires-Dist: pika~=1.3.0
26
- Requires-Dist: pydantic~=2.11.3
26
+ Requires-Dist: pydantic<3,>=2.8.2
27
27
  Requires-Dist: python-magic~=0.4.27; sys_platform == "linux" or sys_platform == "darwin"
28
28
  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
- Requires-Dist: requests~=2.32.3
31
+ Requires-Dist: requests<3,>=2.32.0
32
32
  Requires-Dist: setuptools~=80.9.0
33
33
  Requires-Dist: cachetools~=5.5.2
34
34
  Requires-Dist: prometheus-client~=0.22.1
35
35
  Requires-Dist: opentelemetry-api~=1.35.0
36
36
  Requires-Dist: opentelemetry-sdk~=1.35.0
37
37
  Requires-Dist: deprecation~=2.1.0
38
- Requires-Dist: fastapi<0.117.0,>=0.116.1
39
- Requires-Dist: uvicorn[standard]<0.36.0,>=0.35.0
38
+ Requires-Dist: fastapi<0.117.0,>=0.115.2
39
+ Requires-Dist: uvicorn[standard]<0.36.0,>=0.34.0
40
40
  Requires-Dist: filigran-sseclient>=1.0.2
41
41
  Requires-Dist: stix2~=3.0.1
42
42
  Provides-Extra: dev
@@ -1,17 +1,17 @@
1
1
  datefinder~=0.7.3
2
2
  pika~=1.3.0
3
- pydantic~=2.11.3
3
+ pydantic<3,>=2.8.2
4
4
  python_json_logger~=3.3.0
5
5
  PyYAML~=6.0
6
- requests~=2.32.3
6
+ requests<3,>=2.32.0
7
7
  setuptools~=80.9.0
8
8
  cachetools~=5.5.2
9
9
  prometheus-client~=0.22.1
10
10
  opentelemetry-api~=1.35.0
11
11
  opentelemetry-sdk~=1.35.0
12
12
  deprecation~=2.1.0
13
- fastapi<0.117.0,>=0.116.1
14
- uvicorn[standard]<0.36.0,>=0.35.0
13
+ fastapi<0.117.0,>=0.115.2
14
+ uvicorn[standard]<0.36.0,>=0.34.0
15
15
  filigran-sseclient>=1.0.2
16
16
  stix2~=3.0.1
17
17
 
@@ -36,20 +36,20 @@ include_package_data = True
36
36
  install_requires =
37
37
  datefinder~=0.7.3
38
38
  pika~=1.3.0
39
- pydantic~=2.11.3
39
+ pydantic>=2.8.2, <3
40
40
  python-magic~=0.4.27; sys_platform == 'linux' or sys_platform == 'darwin'
41
41
  python-magic-bin~=0.4.14; sys_platform == 'win32'
42
42
  python_json_logger~=3.3.0
43
43
  PyYAML~=6.0
44
- requests~=2.32.3
44
+ requests>=2.32.0, <3
45
45
  setuptools~=80.9.0
46
46
  cachetools~=5.5.2
47
47
  prometheus-client~=0.22.1
48
48
  opentelemetry-api~=1.35.0
49
49
  opentelemetry-sdk~=1.35.0
50
50
  deprecation~=2.1.0
51
- fastapi>=0.116.1,<0.117.0
52
- uvicorn[standard]>=0.35.0,<0.36.0
51
+ fastapi>=0.115.2,<0.117.0
52
+ uvicorn[standard]>=0.34.0,<0.36.0
53
53
  filigran-sseclient>=1.0.2
54
54
  stix2~=3.0.1
55
55
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes