pycti 6.7.11__py3-none-any.whl → 6.7.12__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 +4 -3
- pycti/entities/opencti_user.py +22 -0
- pycti/utils/opencti_stix2.py +14 -0
- {pycti-6.7.11.dist-info → pycti-6.7.12.dist-info}/METADATA +5 -5
- {pycti-6.7.11.dist-info → pycti-6.7.12.dist-info}/RECORD +9 -9
- {pycti-6.7.11.dist-info → pycti-6.7.12.dist-info}/WHEEL +0 -0
- {pycti-6.7.11.dist-info → pycti-6.7.12.dist-info}/licenses/LICENSE +0 -0
- {pycti-6.7.11.dist-info → pycti-6.7.12.dist-info}/top_level.txt +0 -0
pycti/__init__.py
CHANGED
|
@@ -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.
|
|
787
|
-
|
|
788
|
-
|
|
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)}
|
pycti/entities/opencti_user.py
CHANGED
|
@@ -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"])
|
pycti/utils/opencti_stix2.py
CHANGED
|
@@ -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.
|
|
3
|
+
Version: 6.7.12
|
|
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
|
|
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
|
|
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.
|
|
39
|
-
Requires-Dist: uvicorn[standard]<0.36.0,>=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,4 +1,4 @@
|
|
|
1
|
-
pycti/__init__.py,sha256
|
|
1
|
+
pycti/__init__.py,sha256=8LDJmJrjDLjmwtfz6YwwOCO0jDQeTRCAsF7zP5EAZig,5677
|
|
2
2
|
pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
pycti/api/opencti_api_client.py,sha256=lbygp2fOsmTKIrM-8Y7GxFzCZzdFStC0dhxyKYs0Wzo,35368
|
|
4
4
|
pycti/api/opencti_api_connector.py,sha256=8xwHuLINP3ZCImzE9_K_iCR9QEA3K6aHpK4bJhcZf20,5582
|
|
@@ -13,7 +13,7 @@ pycti/api/opencti_api_work.py,sha256=uV1mbPz3zmNZjoNHVmX6SyWPQKEHkpSDXkb_a2NIOA4
|
|
|
13
13
|
pycti/api/opencti_api_workspace.py,sha256=ycqOTEXeUHF2k8H4jhoYDd1W6ijFcNUjYf4eSdLpH0k,611
|
|
14
14
|
pycti/connector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
pycti/connector/opencti_connector.py,sha256=8lCZFvcA9-S1x6vFl756hgWAlzKfrnq-C4AIdDJr-Kg,2715
|
|
16
|
-
pycti/connector/opencti_connector_helper.py,sha256=
|
|
16
|
+
pycti/connector/opencti_connector_helper.py,sha256=Wh4OYpQyVp-SzIbBeyMePCPyn02MLLErTSIeZu6wxUU,88672
|
|
17
17
|
pycti/connector/opencti_metric_handler.py,sha256=4jXHeJflomtHjuQ_YU0b36TG7o26vOWbY_jvU8Ezobs,3725
|
|
18
18
|
pycti/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
pycti/entities/opencti_attack_pattern.py,sha256=HVfLhtd8rlT42xutRS8qOkDsG5_Ws4EoGfObLW5mQl4,22535
|
|
@@ -63,7 +63,7 @@ pycti/entities/opencti_threat_actor.py,sha256=vFPeo0pOYSqHBKVlWc4o8RjuP2PP0A09KW
|
|
|
63
63
|
pycti/entities/opencti_threat_actor_group.py,sha256=dV28sDfADoDpATyk8w2fN1ZGOoad3LCk7lnij3nFBY8,20828
|
|
64
64
|
pycti/entities/opencti_threat_actor_individual.py,sha256=l-E0RShOofXTZgw2HUyrDprXm8K3yvxh620hqAl-a-4,21178
|
|
65
65
|
pycti/entities/opencti_tool.py,sha256=GXeTfWkTgNxFnNGPsO03BOK2dsZGCp5IT-leQHiFWtw,15462
|
|
66
|
-
pycti/entities/opencti_user.py,sha256=
|
|
66
|
+
pycti/entities/opencti_user.py,sha256=XrsD84uKiItk2AUucM682Zjb1ikAQIRF17MS969TGQ4,30492
|
|
67
67
|
pycti/entities/opencti_vocabulary.py,sha256=xupdHJ6TznCmvI3sVYU261SnfblSNc1nwg19MG9yrao,6499
|
|
68
68
|
pycti/entities/opencti_vulnerability.py,sha256=7SDIOpIxuJp3syouPC2M8zFYcSep5y1wBVfoG79HTMA,53216
|
|
69
69
|
pycti/entities/indicator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -74,13 +74,13 @@ pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py
|
|
|
74
74
|
pycti/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
75
|
pycti/utils/constants.py,sha256=VRYRvDm6hkTR0ZcHHWMzQBwqlPRskYnusBpgoX0S05A,12854
|
|
76
76
|
pycti/utils/opencti_logger.py,sha256=BHNy9fJuTUTn_JEYSCmyvVwd6y-9ZJKxO40mY4iZ0bc,2226
|
|
77
|
-
pycti/utils/opencti_stix2.py,sha256=
|
|
77
|
+
pycti/utils/opencti_stix2.py,sha256=d8neEswXJCsuobSQHJ-PnbvY3RFVftfqgs7WOH-46k0,133663
|
|
78
78
|
pycti/utils/opencti_stix2_identifier.py,sha256=k8L1z4q1xdCBfxqUba4YS_kT-MmbJFxYh0RvfGOmrOs,837
|
|
79
79
|
pycti/utils/opencti_stix2_splitter.py,sha256=sjD9mN6jEea7Zr1k17rNiYaozLcDU4qg0HgIixXRHt4,11371
|
|
80
80
|
pycti/utils/opencti_stix2_update.py,sha256=CnMyqkeVA0jgyxEcgqna8sABU4YPMjkEJ228GVurIn4,14658
|
|
81
81
|
pycti/utils/opencti_stix2_utils.py,sha256=4vu-j3weP9IS3Ky31exOIw4t3fBg00emCTRlVpevrTU,5582
|
|
82
|
-
pycti-6.7.
|
|
83
|
-
pycti-6.7.
|
|
84
|
-
pycti-6.7.
|
|
85
|
-
pycti-6.7.
|
|
86
|
-
pycti-6.7.
|
|
82
|
+
pycti-6.7.12.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
83
|
+
pycti-6.7.12.dist-info/METADATA,sha256=DncAwtiRcj1Vthje2J5VjSDJQCylEcZAFE0FwddE-3E,5536
|
|
84
|
+
pycti-6.7.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
85
|
+
pycti-6.7.12.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
|
|
86
|
+
pycti-6.7.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|