pycti 6.2.1__py3-none-any.whl → 6.2.3__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.2.1"
2
+ __version__ = "6.2.3"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -52,11 +52,13 @@ from .entities.opencti_tool import Tool
52
52
  from .entities.opencti_vulnerability import Vulnerability
53
53
  from .utils.constants import (
54
54
  CustomObjectCaseIncident,
55
+ CustomObjectChannel,
55
56
  CustomObjectTask,
56
57
  CustomObservableBankAccount,
57
58
  CustomObservableCredential,
58
59
  CustomObservableCryptocurrencyWallet,
59
60
  CustomObservableHostname,
61
+ CustomObservableMediaContent,
60
62
  CustomObservablePaymentCard,
61
63
  CustomObservablePhoneNumber,
62
64
  CustomObservableText,
@@ -132,6 +134,7 @@ __all__ = [
132
134
  "get_config_variable",
133
135
  "CustomObjectCaseIncident",
134
136
  "CustomObjectTask",
137
+ "CustomObjectChannel",
135
138
  "StixCyberObservableTypes",
136
139
  "CustomObservableCredential",
137
140
  "CustomObservableHostname",
@@ -142,6 +145,7 @@ __all__ = [
142
145
  "CustomObservablePhoneNumber",
143
146
  "CustomObservableTrackingNumber",
144
147
  "CustomObservableText",
148
+ "CustomObservableMediaContent",
145
149
  "STIX_EXT_MITRE",
146
150
  "STIX_EXT_OCTI_SCO",
147
151
  "STIX_EXT_OCTI",
@@ -880,6 +880,12 @@ class Report:
880
880
  stix_object["x_opencti_reliability"] = (
881
881
  self.opencti.get_attribute_in_extension("reliability", stix_object)
882
882
  )
883
+ if "x_opencti_content" not in stix_object or "content" not in stix_object:
884
+ stix_object["content"] = self.opencti.get_attribute_in_extension(
885
+ "content", stix_object
886
+ )
887
+ if "x_opencti_content" in stix_object:
888
+ stix_object["content"] = stix_object["x_opencti_content"]
883
889
 
884
890
  return self.create(
885
891
  stix_id=stix_object["id"],
pycti/utils/constants.py CHANGED
@@ -222,6 +222,25 @@ class CustomObjectTask:
222
222
  pass
223
223
 
224
224
 
225
+ @CustomObject(
226
+ "channel",
227
+ [
228
+ ("name", StringProperty(required=True)),
229
+ ("spec_version", StringProperty(fixed="2.1")),
230
+ ("description", StringProperty()),
231
+ ("aliases", ListProperty(StringProperty)),
232
+ ("channel_types", ListProperty(StringProperty)),
233
+ ("x_opencti_workflow_id", StringProperty()),
234
+ ("x_opencti_assignee_ids", ListProperty(StringProperty)),
235
+ ("external_references", ListProperty(ExternalReference)),
236
+ ],
237
+ )
238
+ class CustomObjectChannel:
239
+ """Channel object."""
240
+
241
+ pass
242
+
243
+
225
244
  # Custom observables
226
245
 
227
246
 
@@ -410,3 +429,28 @@ class CustomObservableUserAgent:
410
429
  """User-Agent observable."""
411
430
 
412
431
  pass
432
+
433
+
434
+ @CustomObservable(
435
+ "media-content",
436
+ [
437
+ ("title", StringProperty()),
438
+ ("description", StringProperty()),
439
+ ("content", StringProperty()),
440
+ ("media_category", StringProperty()),
441
+ ("url", StringProperty(required=True)),
442
+ ("publication_date", TimestampProperty()),
443
+ ("spec_version", StringProperty(fixed="2.1")),
444
+ (
445
+ "object_marking_refs",
446
+ ListProperty(
447
+ ReferenceProperty(valid_types="marking-definition", spec_version="2.1")
448
+ ),
449
+ ),
450
+ ],
451
+ ["url"],
452
+ )
453
+ class CustomObservableMediaContent:
454
+ """Media-Content observable."""
455
+
456
+ pass
@@ -536,8 +536,6 @@ class OpenCTIStix2:
536
536
  )
537
537
  if generated_ref_id is None:
538
538
  continue
539
- if generated_ref_id in self.mapping_cache:
540
- external_reference_id = self.mapping_cache[generated_ref_id]
541
539
  else:
542
540
  external_reference_id = self.opencti.external_reference.create(
543
541
  source_name=source_name,
@@ -582,7 +580,6 @@ class OpenCTIStix2:
582
580
  "no_trigger_import", False
583
581
  ),
584
582
  )
585
- self.mapping_cache[generated_ref_id] = generated_ref_id
586
583
  external_references_ids.append(external_reference_id)
587
584
  if stix_object["type"] in [
588
585
  "threat-actor",
@@ -713,8 +710,6 @@ class OpenCTIStix2:
713
710
  )
714
711
  if generated_ref_id is None:
715
712
  continue
716
- if generated_ref_id in self.mapping_cache:
717
- external_reference_id = self.mapping_cache[generated_ref_id]
718
713
  else:
719
714
  external_reference_id = self.opencti.external_reference.create(
720
715
  source_name=source_name,
@@ -753,7 +748,6 @@ class OpenCTIStix2:
753
748
  mime_type=file["mime_type"],
754
749
  no_trigger_import=file.get("no_trigger_import", False),
755
750
  )
756
- self.mapping_cache[generated_ref_id] = generated_ref_id
757
751
  external_references_ids.append(external_reference_id)
758
752
  # Granted refs
759
753
  granted_refs_ids = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycti
3
- Version: 6.2.1
3
+ Version: 6.2.3
4
4
  Summary: Python API client for OpenCTI.
5
5
  Home-page: https://github.com/OpenCTI-Platform/client-python
6
6
  Author: Filigran
@@ -1,4 +1,4 @@
1
- pycti/__init__.py,sha256=d0BBXguTo6xH180bSmqTfgdqwGeWNLBaydVnnCMtBqs,5035
1
+ pycti/__init__.py,sha256=ZQfD8cQ7_WKt-3NPl76YW6mF3eysVtZ63CXmcGADTW4,5157
2
2
  pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  pycti/api/opencti_api_client.py,sha256=c-xyfmas2LkYNIY8j4-dHBJepHNL6uNhageyJOvYdQc,29834
4
4
  pycti/api/opencti_api_connector.py,sha256=fYF0Jy9KIMFNt1RC_A1rpWomVJ-oj5HiSsBem4W0J5U,3549
@@ -38,7 +38,7 @@ pycti/entities/opencti_narrative.py,sha256=tUoq5h9VleK6Q-Wt1KSXAtcLsBUEvQ559rDhg
38
38
  pycti/entities/opencti_note.py,sha256=2VzLIxiOIT5MVWQbfNkSyooTuKvwJH7sguRrUOVNpTY,30514
39
39
  pycti/entities/opencti_observed_data.py,sha256=123sp3_Xbu1HVZW5-5_Tu8DYo_wBf6RVGPYyCIuDBtw,31126
40
40
  pycti/entities/opencti_opinion.py,sha256=SPcY8-0zRJCMle-eDLka-CFPyAqU3CnVVBtfVYhzyJE,21837
41
- pycti/entities/opencti_report.py,sha256=8ADf1Evxun0JA1Hz5kSHWfyUMmv2Q20bwOz5F0_muNk,33698
41
+ pycti/entities/opencti_report.py,sha256=sW3_-vvIBWElX2HEYd2qRXcngDkHsYaQzln8ZxYZJgQ,34053
42
42
  pycti/entities/opencti_stix.py,sha256=uMheSg8i1f2Ozx2Mk0iShWzHHjj6MMWDtV5nDjVxKEE,2275
43
43
  pycti/entities/opencti_stix_core_object.py,sha256=BXUCdIcDMFQXQyOu25MpGB0zAjLFUHeL_OpddCijHrU,50560
44
44
  pycti/entities/opencti_stix_core_relationship.py,sha256=ldhS0rJ9L6LrY1wvX28f9TMpVD1rVxsK-GYhH06qJFo,43944
@@ -60,14 +60,14 @@ pycti/entities/stix_cyber_observable/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
60
60
  pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_deprecated.py,sha256=BH65h6xBz7naG61t5nvBdhnGYnobNuiUZf8CJC4-nnc,1847
61
61
  pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py,sha256=WIuLoZtNVc5k2t0JmxbaqTaZqreF0iWQu30p7wiv1HQ,11155
62
62
  pycti/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
- pycti/utils/constants.py,sha256=Gj0fz94p0ApjCUCUqBQpFTfNslT021HS2w6M8azqXBY,10601
63
+ pycti/utils/constants.py,sha256=cRzG7OZkrfJLKPcCyV9Wi8uZNp4QJB4B4WoaJw8yHx4,11807
64
64
  pycti/utils/opencti_logger.py,sha256=0dvB75V0SuPFGxL539dAQrxTt1N5Acx0A3Ogwl5WMJ8,2199
65
- pycti/utils/opencti_stix2.py,sha256=x2XdjcuFBEXovV-Aj-bE8BEbEuUcq6cW0CHI9hQJPtY,117638
65
+ pycti/utils/opencti_stix2.py,sha256=WAVgvTcj8P0QfN_K2-avCeFwSkxVtBz1nh0dA63Nlr4,117202
66
66
  pycti/utils/opencti_stix2_splitter.py,sha256=A2GqoiFzEga8hslgA3mm4FDoObFsWgx4zK4DdcWTguc,4907
67
67
  pycti/utils/opencti_stix2_update.py,sha256=CnMyqkeVA0jgyxEcgqna8sABU4YPMjkEJ228GVurIn4,14658
68
68
  pycti/utils/opencti_stix2_utils.py,sha256=4r9qglN3AIN8JH1B9Ts2o20Qn3K203M4c5-lIPzRpZ4,4138
69
- pycti-6.2.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
70
- pycti-6.2.1.dist-info/METADATA,sha256=ETL0T3NbiGv8bDjhDtCUjHCHbYINOLBzoTue0vehTN4,5432
71
- pycti-6.2.1.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
72
- pycti-6.2.1.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
73
- pycti-6.2.1.dist-info/RECORD,,
69
+ pycti-6.2.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
70
+ pycti-6.2.3.dist-info/METADATA,sha256=JpmQM6f7ZYJjjqQ8UCgOKjjIWLVWvHstcmH-DLlRHi4,5432
71
+ pycti-6.2.3.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
72
+ pycti-6.2.3.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
73
+ pycti-6.2.3.dist-info/RECORD,,
File without changes
File without changes