pycti 6.1.5__py3-none-any.whl → 6.1.7__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.1.5"
2
+ __version__ = "6.1.7"
3
3
 
4
4
  from .api.opencti_api_client import OpenCTIApiClient
5
5
  from .api.opencti_api_connector import OpenCTIApiConnector
@@ -838,6 +838,45 @@ class OpenCTIConnectorHelper: # pylint: disable=too-many-public-methods
838
838
  self.connector_state = connector_configuration["connector_state"]
839
839
  self.connector_config = connector_configuration["config"]
840
840
 
841
+ # Overwrite connector config for RabbitMQ if given manually / in conf
842
+ self.connector_config["connection"]["host"] = get_config_variable(
843
+ "MQ_HOST",
844
+ ["mq", "host"],
845
+ config,
846
+ default=self.connector_config["connection"]["host"],
847
+ )
848
+ self.connector_config["connection"]["port"] = get_config_variable(
849
+ "MQ_PORT",
850
+ ["mq", "port"],
851
+ config,
852
+ isNumber=True,
853
+ default=self.connector_config["connection"]["port"],
854
+ )
855
+ self.connector_config["connection"]["vhost"] = get_config_variable(
856
+ "MQ_VHOST",
857
+ ["mq", "vhost"],
858
+ config,
859
+ default=self.connector_config["connection"]["vhost"],
860
+ )
861
+ self.connector_config["connection"]["use_ssl"] = get_config_variable(
862
+ "MQ_USE_SSL",
863
+ ["mq", "use_ssl"],
864
+ config,
865
+ default=self.connector_config["connection"]["use_ssl"],
866
+ )
867
+ self.connector_config["connection"]["user"] = get_config_variable(
868
+ "MQ_USER",
869
+ ["mq", "user"],
870
+ config,
871
+ default=self.connector_config["connection"]["user"],
872
+ )
873
+ self.connector_config["connection"]["pass"] = get_config_variable(
874
+ "MQ_PASS",
875
+ ["mq", "pass"],
876
+ config,
877
+ default=self.connector_config["connection"]["pass"],
878
+ )
879
+
841
880
  # Start ping thread
842
881
  if not self.connect_run_and_terminate:
843
882
  self.ping = PingAlive(
@@ -521,6 +521,7 @@ class StixCoreRelationship:
521
521
  start_time_stop = kwargs.get("startTimeStop", None)
522
522
  stop_time_start = kwargs.get("stopTimeStart", None)
523
523
  stop_time_stop = kwargs.get("stopTimeStop", None)
524
+ filters = kwargs.get("filters", None)
524
525
  custom_attributes = kwargs.get("customAttributes", None)
525
526
  if id is not None:
526
527
  self.opencti.app_logger.info("Reading stix_core_relationship", {"id": id})
@@ -543,6 +544,12 @@ class StixCoreRelationship:
543
544
  return self.opencti.process_multiple_fields(
544
545
  result["data"]["stixCoreRelationship"]
545
546
  )
547
+ elif filters is not None:
548
+ result = self.list(filters=filters, customAttributes=custom_attributes)
549
+ if len(result) > 0:
550
+ return result[0]
551
+ else:
552
+ return None
546
553
  elif from_id is not None and to_id is not None:
547
554
  result = self.list(
548
555
  fromOrToId=from_or_to_id,
@@ -178,6 +178,7 @@ class StixNestedRefRelationship:
178
178
  stop_time_start = kwargs.get("stopTimeStart", None)
179
179
  stop_time_stop = kwargs.get("stopTimeStop", None)
180
180
  custom_attributes = kwargs.get("customAttributes", None)
181
+ filters = kwargs.get("filters", None)
181
182
  if id is not None:
182
183
  self.opencti.app_logger.info(
183
184
  "Reading stix_observable_relationship", {"id": id}
@@ -201,6 +202,12 @@ class StixNestedRefRelationship:
201
202
  return self.opencti.process_multiple_fields(
202
203
  result["data"]["stixRefRelationship"]
203
204
  )
205
+ elif filters is not None:
206
+ result = self.list(filters=filters, customAttributes=custom_attributes)
207
+ if len(result) > 0:
208
+ return result[0]
209
+ else:
210
+ return None
204
211
  else:
205
212
  result = self.list(
206
213
  fromOrToId=from_or_to_id,
@@ -481,6 +481,7 @@ class StixObjectOrStixRelationship:
481
481
  def read(self, **kwargs):
482
482
  id = kwargs.get("id", None)
483
483
  custom_attributes = kwargs.get("customAttributes", None)
484
+ filters = kwargs.get("filters", None)
484
485
  if id is not None:
485
486
  self.opencti.app_logger.info(
486
487
  "Reading StixObjectOrStixRelationship", {"id": id}
@@ -504,6 +505,12 @@ class StixObjectOrStixRelationship:
504
505
  return self.opencti.process_multiple_fields(
505
506
  result["data"]["stixObjectOrStixRelationship"]
506
507
  )
508
+ elif filters is not None:
509
+ result = self.list(filters=filters)
510
+ if len(result) > 0:
511
+ return result[0]
512
+ else:
513
+ return None
507
514
  else:
508
515
  self.opencti.app_logger.error("Missing parameters: id")
509
516
  return None
@@ -431,6 +431,7 @@ class StixSightingRelationship:
431
431
  last_seen_start = kwargs.get("lastSeenStart", None)
432
432
  last_seen_stop = kwargs.get("lastSeenStop", None)
433
433
  custom_attributes = kwargs.get("customAttributes", None)
434
+ filters = kwargs.get("filters", None)
434
435
  if id is not None:
435
436
  self.opencti.app_logger.info("Reading stix_sighting", {"id": id})
436
437
  query = (
@@ -452,6 +453,12 @@ class StixSightingRelationship:
452
453
  return self.opencti.process_multiple_fields(
453
454
  result["data"]["stixSightingRelationship"]
454
455
  )
456
+ elif filters is not None:
457
+ result = self.list(filters=filters)
458
+ if len(result) > 0:
459
+ return result[0]
460
+ else:
461
+ return None
455
462
  elif from_id is not None and to_id is not None:
456
463
  result = self.list(
457
464
  fromOrToId=from_or_to_id,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycti
3
- Version: 6.1.5
3
+ Version: 6.1.7
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=b5FShCuxuJX-8qUHy2fW2-JhkP-G6wnMEjS7d683cNQ,5035
1
+ pycti/__init__.py,sha256=G7zZx8c-ClufD5_qLfKV8I0qLHgwxbGr0WoODBNJKA8,5035
2
2
  pycti/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  pycti/api/opencti_api_client.py,sha256=oTPEdzbSTtN1NMMDFqv_DIOXuUwNz8cN7oXu3saSXyA,29701
4
4
  pycti/api/opencti_api_connector.py,sha256=fYF0Jy9KIMFNt1RC_A1rpWomVJ-oj5HiSsBem4W0J5U,3549
@@ -6,7 +6,7 @@ pycti/api/opencti_api_playbook.py,sha256=OkqDawpnMYIHz5sD4djlJ_KgORkfvQ7YbJwttxE
6
6
  pycti/api/opencti_api_work.py,sha256=JLfl7oy6Cq9IrYW_kUrqwzN46FoVzyIn1JJQKyK0h_w,7615
7
7
  pycti/connector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  pycti/connector/opencti_connector.py,sha256=0vrZ8Y8ecbxegAP1YhpX6ybOZahYjjOkcId51D1oBi4,2449
9
- pycti/connector/opencti_connector_helper.py,sha256=mOlakQ077mZorpR7McXNLq4UXxsM2_00ES87M-HfQY8,60496
9
+ pycti/connector/opencti_connector_helper.py,sha256=w_KAUr-anmomlejfZfUD4Pb3cha5cuI5NclXUlkbRww,61944
10
10
  pycti/connector/opencti_metric_handler.py,sha256=4jXHeJflomtHjuQ_YU0b36TG7o26vOWbY_jvU8Ezobs,3725
11
11
  pycti/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  pycti/entities/opencti_attack_pattern.py,sha256=ycAR0cReJ1dd_edQPAL6qBrFvvTx10GJFMTezyK91cg,21471
@@ -41,12 +41,12 @@ pycti/entities/opencti_opinion.py,sha256=SPcY8-0zRJCMle-eDLka-CFPyAqU3CnVVBtfVYh
41
41
  pycti/entities/opencti_report.py,sha256=zKoq3Kpo3afvFsw0QCBOaeVm9J_xRMBOZfJC7ZPRaRg,33580
42
42
  pycti/entities/opencti_stix.py,sha256=uMheSg8i1f2Ozx2Mk0iShWzHHjj6MMWDtV5nDjVxKEE,2275
43
43
  pycti/entities/opencti_stix_core_object.py,sha256=3jABOB_-vm2CSB6LU3ylxpSj_oixRCcfU3T10n2_MFU,49559
44
- pycti/entities/opencti_stix_core_relationship.py,sha256=93E9sIiKIOYJtjzBecMBMOGoKNsgOJnrRi0HscmU6iA,43249
44
+ pycti/entities/opencti_stix_core_relationship.py,sha256=U9eWrpV3iJ0_8x8Tn3ZBqiA2asT7AOJPNOq66abex00,43524
45
45
  pycti/entities/opencti_stix_cyber_observable.py,sha256=EOJuXeSmFcm4oI2rPOqxZ8QZq_ej_CTkYgCTtUkZwsk,106785
46
46
  pycti/entities/opencti_stix_domain_object.py,sha256=QI6uBbefNC_PQSwl0O5KpG4cWqa-15mIju8dwREzooU,78504
47
- pycti/entities/opencti_stix_nested_ref_relationship.py,sha256=2r1i7cUl-WWictlnC_MJrm9sTIt_yJe2uqTpQm-yo6o,12330
48
- pycti/entities/opencti_stix_object_or_stix_relationship.py,sha256=x0LWqMqaqqIPgQnLgw7Q2qPoXK4fZix8-KsQnmZaIOw,17696
49
- pycti/entities/opencti_stix_sighting_relationship.py,sha256=AmX1LBS8cW5a_dlik_sx-nBDvUcqb193gs4m3pB9C5U,27584
47
+ pycti/entities/opencti_stix_nested_ref_relationship.py,sha256=eGCF7yaEDqMsJbgvTDle0tVzRCF78CmEhE02jioUTCc,12605
48
+ pycti/entities/opencti_stix_object_or_stix_relationship.py,sha256=9P-yVkexzd-8sA_U5DhcgC6JzGtawZ8pQ_CPdbrTgy8,17935
49
+ pycti/entities/opencti_stix_sighting_relationship.py,sha256=9huwEc3a1-5WvoaB1lYznh4s8rFzTat4EPHsiGebT-Y,27823
50
50
  pycti/entities/opencti_task.py,sha256=y4Q2vC-eLccX-yna85GnnCFEKWFJAWQcflNbkr9BClo,24668
51
51
  pycti/entities/opencti_threat_actor.py,sha256=lRdPhXX_HsNSE5rTwkke_U5T_FAPGD22ow2-YeZdaYc,9950
52
52
  pycti/entities/opencti_threat_actor_group.py,sha256=QQMt7D3RucIRczeVgcqAf3SurmkQLmK6QVI-M3d08p0,18996
@@ -61,8 +61,8 @@ pycti/utils/opencti_stix2.py,sha256=Ovv8mS7Df0FTNZwO2Vful8XNWY5PwNuyrrLC3bhiOqI,
61
61
  pycti/utils/opencti_stix2_splitter.py,sha256=A2GqoiFzEga8hslgA3mm4FDoObFsWgx4zK4DdcWTguc,4907
62
62
  pycti/utils/opencti_stix2_update.py,sha256=CnMyqkeVA0jgyxEcgqna8sABU4YPMjkEJ228GVurIn4,14658
63
63
  pycti/utils/opencti_stix2_utils.py,sha256=4r9qglN3AIN8JH1B9Ts2o20Qn3K203M4c5-lIPzRpZ4,4138
64
- pycti-6.1.5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
- pycti-6.1.5.dist-info/METADATA,sha256=1_z_bdOGl8Ro1xuyV5Dw9nBP335Y1QaCGQaSBX3n0tI,5397
66
- pycti-6.1.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
67
- pycti-6.1.5.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
68
- pycti-6.1.5.dist-info/RECORD,,
64
+ pycti-6.1.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
+ pycti-6.1.7.dist-info/METADATA,sha256=CgniMR9hVR36qxJrzm_L0FXc7mgDEFI2xODvyWkdA4E,5397
66
+ pycti-6.1.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
67
+ pycti-6.1.7.dist-info/top_level.txt,sha256=cqEpxitAhHP4VgSA6xmrak6Yk9MeBkwoMTB6k7d2ZnE,6
68
+ pycti-6.1.7.dist-info/RECORD,,
File without changes
File without changes