pycti 6.4.8__py3-none-any.whl → 6.4.9__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 CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "6.4.8"
2
+ __version__ = "6.4.9"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -224,8 +224,11 @@ class OpenCTIApiClient:
224
224
  def set_previous_standard_header(self, previous_standard):
225
225
  self.request_headers["previous-standard"] = previous_standard
226
226
 
227
- def get_request_headers(self):
228
- return self.request_headers
227
+ def get_request_headers(self, hide_token=True):
228
+ request_headers_copy = self.request_headers.copy()
229
+ if hide_token and "Authorization" in request_headers_copy:
230
+ request_headers_copy["Authorization"] = "*****"
231
+ return request_headers_copy
229
232
 
230
233
  def set_retry_number(self, retry_number):
231
234
  self.request_headers["opencti-retry-number"] = (
@@ -26,6 +26,19 @@ class MarkingDefinition:
26
26
 
27
27
  @staticmethod
28
28
  def generate_id(definition_type, definition):
29
+ # Handle static IDs from OpenCTI
30
+ if definition_type == "TLP":
31
+ if definition == "TLP:CLEAR" or definition == "TLP:WHITE":
32
+ return "marking-definition--613f2e26-407d-48c7-9eca-b8e91df99dc9"
33
+ if definition == "TLP:GREEN":
34
+ return "marking-definition--34098fce-860f-48ae-8e50-ebd3cc5e41da"
35
+ if definition == "TLP:AMBER":
36
+ return "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"
37
+ if definition == "TLP:AMBER+STRICT":
38
+ return "marking-definition--826578e1-40ad-459f-bc73-ede076f81f37"
39
+ if definition == "TLP:RED":
40
+ return "marking-definition--5e57c739-391a-4eb3-b6be-7d15ca92d5ed"
41
+ # Generate IDs
29
42
  data = {"definition_type": definition_type, "definition": definition}
30
43
  data = canonicalize(data, utf8=False)
31
44
  id = str(uuid.uuid5(uuid.UUID("00abedb4-aa42-466c-9c01-fed23315a9b7"), data))
@@ -1378,7 +1378,7 @@ class OpenCTIStix2:
1378
1378
  created=stix_sighting["created"] if "created" in stix_sighting else None,
1379
1379
  modified=stix_sighting["modified"] if "modified" in stix_sighting else None,
1380
1380
  confidence=(
1381
- stix_sighting["confidence"] if "confidence" in stix_sighting else 15
1381
+ stix_sighting["confidence"] if "confidence" in stix_sighting else None
1382
1382
  ),
1383
1383
  createdBy=extras["created_by_id"] if "created_by_id" in extras else None,
1384
1384
  objectMarking=(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pycti
3
- Version: 6.4.8
3
+ Version: 6.4.9
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -1,6 +1,6 @@
1
- pycti/__init__.py,sha256=Aa8vN6OM9l4DFbxoQxaeSB9C--JfY3xu2KQeD3ilcvQ,5218
1
+ pycti/__init__.py,sha256=cHEDDuVT8ko9Um_T95kQJlYTGrov_xrFYaYDjXlFznY,5218
2
2
  pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- pycti/api/opencti_api_client.py,sha256=k3FUpsCToENGN2aM_2Eoztq9850zGt5hQsvsmtH_20A,32199
3
+ pycti/api/opencti_api_client.py,sha256=OBXRNBbkYsbgqjxeY5iltHXIDeWqpFN3-SKsinkr66U,32402
4
4
  pycti/api/opencti_api_connector.py,sha256=ubM_zPjTD8L33TEugCQgf_YF9zugDFg_7FgNubGlwJw,5447
5
5
  pycti/api/opencti_api_playbook.py,sha256=456We78vESukfSOi_CctfZ9dbBJEi76EHClRc2f21Js,1628
6
6
  pycti/api/opencti_api_work.py,sha256=JLfl7oy6Cq9IrYW_kUrqwzN46FoVzyIn1JJQKyK0h_w,7615
@@ -33,7 +33,7 @@ pycti/entities/opencti_language.py,sha256=KugOaUMnygo8wDnv4RPJTv_EleNGWyEfsAOxI7
33
33
  pycti/entities/opencti_location.py,sha256=dbsqkgZbcnrh2mrG5u59kZmCv6HrclwUIgSb9BPm4DI,18395
34
34
  pycti/entities/opencti_malware.py,sha256=JkwOhee1uqs9_OptLG9qiwPlwWo4WuI1v2VGomNPfDg,20460
35
35
  pycti/entities/opencti_malware_analysis.py,sha256=Oz1rPrF6rUczmaKNB8j8k6JDsp-1UOcJN-2fIfckXNI,21798
36
- pycti/entities/opencti_marking_definition.py,sha256=aU_eMQYapswZuzYbdtpZC38xy1ARO24va7uh6VfBI8U,13030
36
+ pycti/entities/opencti_marking_definition.py,sha256=zYrlmf83xQgh7dkH2y0v0XdFDw9HY9O7l6zGip2O4Jg,13785
37
37
  pycti/entities/opencti_narrative.py,sha256=jJz9v3DtApHS6gmpg6K8-jOG6E3s--K5ipzwc3WXF8A,17151
38
38
  pycti/entities/opencti_note.py,sha256=vYgooFvqWI9d9586HEQjp0xEzsrdLYQ_I9kKetw41Pg,30776
39
39
  pycti/entities/opencti_observed_data.py,sha256=9cTUTDB7DG7dKdyQsm30ucOUs8xxu6-r-VqVAYKzl68,31243
@@ -62,13 +62,13 @@ pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py
62
62
  pycti/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  pycti/utils/constants.py,sha256=ZgOVxY5bnrHiNvPgOfZLWk16sSDnaE_tg8JVjZpw24Q,11831
64
64
  pycti/utils/opencti_logger.py,sha256=0dvB75V0SuPFGxL539dAQrxTt1N5Acx0A3Ogwl5WMJ8,2199
65
- pycti/utils/opencti_stix2.py,sha256=j7YK0XmI4TOgyr3lokU8FOM9JLjjCPSHzVgfHes4pRA,116947
65
+ pycti/utils/opencti_stix2.py,sha256=1b63TSl3ImiKkSJQKhNgqrUbMRIEc-o2_1GQ1G-Y5bY,116949
66
66
  pycti/utils/opencti_stix2_identifier.py,sha256=k8L1z4q1xdCBfxqUba4YS_kT-MmbJFxYh0RvfGOmrOs,837
67
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.4.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
71
- pycti-6.4.8.dist-info/METADATA,sha256=0MwvXcuotU2_SB42kvINPYR1L3pb4Y1T3TpN6p1Zj9Y,5419
72
- pycti-6.4.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
73
- pycti-6.4.8.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
74
- pycti-6.4.8.dist-info/RECORD,,
70
+ pycti-6.4.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
71
+ pycti-6.4.9.dist-info/METADATA,sha256=JQAeIh2esGmQI5lDEKGjz5tGMqhYCfCUfYm3DuWhoJY,5419
72
+ pycti-6.4.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
73
+ pycti-6.4.9.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
74
+ pycti-6.4.9.dist-info/RECORD,,
File without changes
File without changes