pycti 6.8.2__tar.gz → 6.8.4__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.8.2 → pycti-6.8.4}/PKG-INFO +15 -1
  2. {pycti-6.8.2 → pycti-6.8.4}/README.md +14 -0
  3. {pycti-6.8.2 → pycti-6.8.4}/pycti/__init__.py +1 -1
  4. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_vocabulary.py +1 -1
  5. {pycti-6.8.2 → pycti-6.8.4}/pycti/utils/opencti_stix2.py +12 -6
  6. {pycti-6.8.2 → pycti-6.8.4}/pycti.egg-info/PKG-INFO +15 -1
  7. {pycti-6.8.2 → pycti-6.8.4}/LICENSE +0 -0
  8. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/__init__.py +0 -0
  9. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_client.py +0 -0
  10. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_connector.py +0 -0
  11. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_draft.py +0 -0
  12. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_internal_file.py +0 -0
  13. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_notification.py +0 -0
  14. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_pir.py +0 -0
  15. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_playbook.py +0 -0
  16. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_public_dashboard.py +0 -0
  17. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_trash.py +0 -0
  18. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_work.py +0 -0
  19. {pycti-6.8.2 → pycti-6.8.4}/pycti/api/opencti_api_workspace.py +0 -0
  20. {pycti-6.8.2 → pycti-6.8.4}/pycti/connector/__init__.py +0 -0
  21. {pycti-6.8.2 → pycti-6.8.4}/pycti/connector/opencti_connector.py +0 -0
  22. {pycti-6.8.2 → pycti-6.8.4}/pycti/connector/opencti_connector_helper.py +0 -0
  23. {pycti-6.8.2 → pycti-6.8.4}/pycti/connector/opencti_metric_handler.py +0 -0
  24. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/__init__.py +0 -0
  25. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/indicator/__init__.py +0 -0
  26. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/indicator/opencti_indicator_properties.py +0 -0
  27. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_attack_pattern.py +0 -0
  28. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_campaign.py +0 -0
  29. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_capability.py +0 -0
  30. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_case_incident.py +0 -0
  31. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_case_rfi.py +0 -0
  32. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_case_rft.py +0 -0
  33. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_channel.py +0 -0
  34. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_course_of_action.py +0 -0
  35. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_data_component.py +0 -0
  36. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_data_source.py +0 -0
  37. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_event.py +0 -0
  38. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_external_reference.py +0 -0
  39. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_feedback.py +0 -0
  40. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_group.py +0 -0
  41. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_grouping.py +0 -0
  42. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_identity.py +0 -0
  43. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_incident.py +0 -0
  44. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_indicator.py +0 -0
  45. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_infrastructure.py +0 -0
  46. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_intrusion_set.py +0 -0
  47. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_kill_chain_phase.py +0 -0
  48. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_label.py +0 -0
  49. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_language.py +0 -0
  50. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_location.py +0 -0
  51. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_malware.py +0 -0
  52. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_malware_analysis.py +0 -0
  53. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_marking_definition.py +0 -0
  54. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_narrative.py +0 -0
  55. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_note.py +0 -0
  56. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_observed_data.py +0 -0
  57. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_opinion.py +0 -0
  58. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_report.py +0 -0
  59. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_role.py +0 -0
  60. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_settings.py +0 -0
  61. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_stix.py +0 -0
  62. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_stix_core_object.py +0 -0
  63. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_stix_core_relationship.py +0 -0
  64. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_stix_cyber_observable.py +0 -0
  65. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_stix_domain_object.py +0 -0
  66. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_stix_nested_ref_relationship.py +0 -0
  67. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_stix_object_or_stix_relationship.py +0 -0
  68. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_stix_sighting_relationship.py +0 -0
  69. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_task.py +0 -0
  70. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_threat_actor.py +0 -0
  71. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_threat_actor_group.py +0 -0
  72. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_threat_actor_individual.py +0 -0
  73. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_tool.py +0 -0
  74. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_user.py +0 -0
  75. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/opencti_vulnerability.py +0 -0
  76. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/stix_cyber_observable/__init__.py +0 -0
  77. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_deprecated.py +0 -0
  78. {pycti-6.8.2 → pycti-6.8.4}/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py +0 -0
  79. {pycti-6.8.2 → pycti-6.8.4}/pycti/utils/__init__.py +0 -0
  80. {pycti-6.8.2 → pycti-6.8.4}/pycti/utils/constants.py +0 -0
  81. {pycti-6.8.2 → pycti-6.8.4}/pycti/utils/opencti_logger.py +0 -0
  82. {pycti-6.8.2 → pycti-6.8.4}/pycti/utils/opencti_stix2_identifier.py +0 -0
  83. {pycti-6.8.2 → pycti-6.8.4}/pycti/utils/opencti_stix2_splitter.py +0 -0
  84. {pycti-6.8.2 → pycti-6.8.4}/pycti/utils/opencti_stix2_update.py +0 -0
  85. {pycti-6.8.2 → pycti-6.8.4}/pycti/utils/opencti_stix2_utils.py +0 -0
  86. {pycti-6.8.2 → pycti-6.8.4}/pycti.egg-info/SOURCES.txt +0 -0
  87. {pycti-6.8.2 → pycti-6.8.4}/pycti.egg-info/dependency_links.txt +0 -0
  88. {pycti-6.8.2 → pycti-6.8.4}/pycti.egg-info/requires.txt +0 -0
  89. {pycti-6.8.2 → pycti-6.8.4}/pycti.egg-info/top_level.txt +0 -0
  90. {pycti-6.8.2 → pycti-6.8.4}/pyproject.toml +0 -0
  91. {pycti-6.8.2 → pycti-6.8.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycti
3
- Version: 6.8.2
3
+ Version: 6.8.4
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -148,6 +148,20 @@ Integration testing
148
148
  $ pytest ./tests/02-integration/
149
149
  ```
150
150
 
151
+ Example testing:
152
+
153
+ > OpenCTI must be running
154
+
155
+ ```bash
156
+ cd examples
157
+ # Configure with you local instance of OpenCTI
158
+ export OPENCTI_API_URL="http://localhost:4000"
159
+ export OPENCTI_API_TOKEN="xxxxxxxxxxxxxxxxxxxxxx"
160
+
161
+ #Run one example file
162
+ python get_indicators_of_malware.py
163
+ ```
164
+
151
165
  ## About
152
166
 
153
167
  OpenCTI is a product designed and developed by the company [Filigran](https://filigran.io).
@@ -89,6 +89,20 @@ Integration testing
89
89
  $ pytest ./tests/02-integration/
90
90
  ```
91
91
 
92
+ Example testing:
93
+
94
+ > OpenCTI must be running
95
+
96
+ ```bash
97
+ cd examples
98
+ # Configure with you local instance of OpenCTI
99
+ export OPENCTI_API_URL="http://localhost:4000"
100
+ export OPENCTI_API_TOKEN="xxxxxxxxxxxxxxxxxxxxxx"
101
+
102
+ #Run one example file
103
+ python get_indicators_of_malware.py
104
+ ```
105
+
92
106
  ## About
93
107
 
94
108
  OpenCTI is a product designed and developed by the company [Filigran](https://filigran.io).
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "6.8.2"
2
+ __version__ = "6.8.4"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -95,7 +95,7 @@ class Vocabulary:
95
95
  )
96
96
  return None
97
97
 
98
- def handle_vocab(self, vocab, cache, field):
98
+ def read_or_create_unchecked_with_cache(self, vocab, cache, field):
99
99
  if "vocab_" + vocab in cache:
100
100
  vocab_data = cache["vocab_" + vocab]
101
101
  else:
@@ -360,17 +360,23 @@ class OpenCTIStix2:
360
360
  if isinstance(stix_object.get(f["key"]), list):
361
361
  object_open_vocabularies[f["key"]] = []
362
362
  for vocab in stix_object[f["key"]]:
363
- object_open_vocabularies[f["key"]].append(
364
- self.opencti.vocabulary.handle_vocab(
363
+ resolved_vocab = (
364
+ self.opencti.vocabulary.read_or_create_unchecked_with_cache(
365
365
  vocab, self.mapping_cache_permanent, field=f
366
- )["name"]
366
+ )
367
367
  )
368
+ if resolved_vocab is not None:
369
+ object_open_vocabularies[f["key"]].append(
370
+ resolved_vocab["name"]
371
+ )
368
372
  else:
369
- object_open_vocabularies[f["key"]] = (
370
- self.opencti.vocabulary.handle_vocab(
373
+ resolved_vocab = (
374
+ self.opencti.vocabulary.read_or_create_unchecked_with_cache(
371
375
  stix_object[f["key"]], self.mapping_cache_permanent, field=f
372
- )["name"]
376
+ )
373
377
  )
378
+ if resolved_vocab is not None:
379
+ object_open_vocabularies[f["key"]] = resolved_vocab["name"]
374
380
 
375
381
  # Object Labels
376
382
  object_label_ids = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycti
3
- Version: 6.8.2
3
+ Version: 6.8.4
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -148,6 +148,20 @@ Integration testing
148
148
  $ pytest ./tests/02-integration/
149
149
  ```
150
150
 
151
+ Example testing:
152
+
153
+ > OpenCTI must be running
154
+
155
+ ```bash
156
+ cd examples
157
+ # Configure with you local instance of OpenCTI
158
+ export OPENCTI_API_URL="http://localhost:4000"
159
+ export OPENCTI_API_TOKEN="xxxxxxxxxxxxxxxxxxxxxx"
160
+
161
+ #Run one example file
162
+ python get_indicators_of_malware.py
163
+ ```
164
+
151
165
  ## About
152
166
 
153
167
  OpenCTI is a product designed and developed by the company [Filigran](https://filigran.io).
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