pycti 6.4.7__tar.gz → 6.4.9__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 (79) hide show
  1. {pycti-6.4.7 → pycti-6.4.9}/PKG-INFO +1 -1
  2. {pycti-6.4.7 → pycti-6.4.9}/pycti/__init__.py +1 -1
  3. {pycti-6.4.7 → pycti-6.4.9}/pycti/api/opencti_api_client.py +5 -2
  4. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_indicator.py +0 -2
  5. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_marking_definition.py +16 -3
  6. {pycti-6.4.7 → pycti-6.4.9}/pycti/utils/opencti_stix2.py +1 -1
  7. {pycti-6.4.7 → pycti-6.4.9}/pycti.egg-info/PKG-INFO +1 -1
  8. {pycti-6.4.7 → pycti-6.4.9}/LICENSE +0 -0
  9. {pycti-6.4.7 → pycti-6.4.9}/README.md +0 -0
  10. {pycti-6.4.7 → pycti-6.4.9}/pycti/api/__init__.py +0 -0
  11. {pycti-6.4.7 → pycti-6.4.9}/pycti/api/opencti_api_connector.py +0 -0
  12. {pycti-6.4.7 → pycti-6.4.9}/pycti/api/opencti_api_playbook.py +0 -0
  13. {pycti-6.4.7 → pycti-6.4.9}/pycti/api/opencti_api_work.py +0 -0
  14. {pycti-6.4.7 → pycti-6.4.9}/pycti/connector/__init__.py +0 -0
  15. {pycti-6.4.7 → pycti-6.4.9}/pycti/connector/opencti_connector.py +0 -0
  16. {pycti-6.4.7 → pycti-6.4.9}/pycti/connector/opencti_connector_helper.py +0 -0
  17. {pycti-6.4.7 → pycti-6.4.9}/pycti/connector/opencti_metric_handler.py +0 -0
  18. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/__init__.py +0 -0
  19. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/indicator/__init__.py +0 -0
  20. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/indicator/opencti_indicator_properties.py +0 -0
  21. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_attack_pattern.py +0 -0
  22. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_campaign.py +0 -0
  23. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_case_incident.py +0 -0
  24. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_case_rfi.py +0 -0
  25. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_case_rft.py +0 -0
  26. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_channel.py +0 -0
  27. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_course_of_action.py +0 -0
  28. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_data_component.py +0 -0
  29. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_data_source.py +0 -0
  30. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_event.py +0 -0
  31. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_external_reference.py +0 -0
  32. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_feedback.py +0 -0
  33. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_grouping.py +0 -0
  34. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_identity.py +0 -0
  35. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_incident.py +0 -0
  36. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_infrastructure.py +0 -0
  37. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_intrusion_set.py +0 -0
  38. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_kill_chain_phase.py +0 -0
  39. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_label.py +0 -0
  40. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_language.py +0 -0
  41. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_location.py +0 -0
  42. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_malware.py +0 -0
  43. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_malware_analysis.py +0 -0
  44. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_narrative.py +0 -0
  45. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_note.py +0 -0
  46. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_observed_data.py +0 -0
  47. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_opinion.py +0 -0
  48. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_report.py +0 -0
  49. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_stix.py +0 -0
  50. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_stix_core_object.py +0 -0
  51. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_stix_core_relationship.py +0 -0
  52. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_stix_cyber_observable.py +0 -0
  53. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_stix_domain_object.py +0 -0
  54. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_stix_nested_ref_relationship.py +0 -0
  55. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_stix_object_or_stix_relationship.py +0 -0
  56. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_stix_sighting_relationship.py +0 -0
  57. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_task.py +0 -0
  58. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_threat_actor.py +0 -0
  59. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_threat_actor_group.py +0 -0
  60. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_threat_actor_individual.py +0 -0
  61. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_tool.py +0 -0
  62. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_vocabulary.py +0 -0
  63. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/opencti_vulnerability.py +0 -0
  64. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/stix_cyber_observable/__init__.py +0 -0
  65. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_deprecated.py +0 -0
  66. {pycti-6.4.7 → pycti-6.4.9}/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py +0 -0
  67. {pycti-6.4.7 → pycti-6.4.9}/pycti/utils/__init__.py +0 -0
  68. {pycti-6.4.7 → pycti-6.4.9}/pycti/utils/constants.py +0 -0
  69. {pycti-6.4.7 → pycti-6.4.9}/pycti/utils/opencti_logger.py +0 -0
  70. {pycti-6.4.7 → pycti-6.4.9}/pycti/utils/opencti_stix2_identifier.py +0 -0
  71. {pycti-6.4.7 → pycti-6.4.9}/pycti/utils/opencti_stix2_splitter.py +0 -0
  72. {pycti-6.4.7 → pycti-6.4.9}/pycti/utils/opencti_stix2_update.py +0 -0
  73. {pycti-6.4.7 → pycti-6.4.9}/pycti/utils/opencti_stix2_utils.py +0 -0
  74. {pycti-6.4.7 → pycti-6.4.9}/pycti.egg-info/SOURCES.txt +0 -0
  75. {pycti-6.4.7 → pycti-6.4.9}/pycti.egg-info/dependency_links.txt +0 -0
  76. {pycti-6.4.7 → pycti-6.4.9}/pycti.egg-info/requires.txt +0 -0
  77. {pycti-6.4.7 → pycti-6.4.9}/pycti.egg-info/top_level.txt +0 -0
  78. {pycti-6.4.7 → pycti-6.4.9}/pyproject.toml +0 -0
  79. {pycti-6.4.7 → pycti-6.4.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pycti
3
- Version: 6.4.7
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,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "6.4.7"
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"] = (
@@ -63,8 +63,6 @@ class Indicator:
63
63
  get_all = kwargs.get("getAll", False)
64
64
  with_pagination = kwargs.get("withPagination", False)
65
65
  with_files = kwargs.get("withFiles", False)
66
- if get_all:
67
- first = 100
68
66
 
69
67
  self.opencti.app_logger.info(
70
68
  "Listing Indicators with filters", {"filters": json.dumps(filters)}
@@ -25,8 +25,21 @@ class MarkingDefinition:
25
25
  """
26
26
 
27
27
  @staticmethod
28
- def generate_id(definition, definition_type):
29
- data = {"definition": definition, "definition_type": definition_type}
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
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))
32
45
  return "marking-definition--" + id
@@ -34,7 +47,7 @@ class MarkingDefinition:
34
47
  @staticmethod
35
48
  def generate_id_from_data(data):
36
49
  return MarkingDefinition.generate_id(
37
- data["definition"], data["definition_type"]
50
+ data["definition_type"], data["definition"]
38
51
  )
39
52
 
40
53
  """
@@ -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.7
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes