From b1a7de07f2e3a20c8c9d1fe38c73d80fad217730 Mon Sep 17 00:00:00 2001 From: Axel Fahy Date: Fri, 17 Jan 2025 10:17:52 +0100 Subject: [PATCH 1/3] [client] remove hardcoded first value in list method when using getAll --- pycti/entities/opencti_attack_pattern.py | 2 -- pycti/entities/opencti_campaign.py | 2 -- pycti/entities/opencti_case_incident.py | 4 +--- pycti/entities/opencti_case_rfi.py | 8 +++----- pycti/entities/opencti_case_rft.py | 8 +++----- pycti/entities/opencti_channel.py | 2 -- pycti/entities/opencti_course_of_action.py | 2 -- pycti/entities/opencti_data_component.py | 2 -- pycti/entities/opencti_data_source.py | 2 -- pycti/entities/opencti_event.py | 2 -- pycti/entities/opencti_external_reference.py | 2 -- pycti/entities/opencti_feedback.py | 2 -- pycti/entities/opencti_grouping.py | 2 -- pycti/entities/opencti_identity.py | 2 -- pycti/entities/opencti_incident.py | 2 -- pycti/entities/opencti_infrastructure.py | 2 -- pycti/entities/opencti_intrusion_set.py | 2 -- pycti/entities/opencti_kill_chain_phase.py | 2 -- pycti/entities/opencti_label.py | 2 -- pycti/entities/opencti_language.py | 2 -- pycti/entities/opencti_location.py | 2 -- pycti/entities/opencti_malware.py | 2 -- pycti/entities/opencti_malware_analysis.py | 2 -- pycti/entities/opencti_marking_definition.py | 2 -- pycti/entities/opencti_narrative.py | 2 -- pycti/entities/opencti_note.py | 2 -- pycti/entities/opencti_observed_data.py | 2 -- pycti/entities/opencti_opinion.py | 2 -- pycti/entities/opencti_report.py | 2 -- pycti/entities/opencti_stix_core_object.py | 2 -- pycti/entities/opencti_stix_core_relationship.py | 2 -- pycti/entities/opencti_stix_cyber_observable.py | 2 -- pycti/entities/opencti_stix_domain_object.py | 2 -- pycti/entities/opencti_stix_nested_ref_relationship.py | 2 -- pycti/entities/opencti_stix_sighting_relationship.py | 2 -- pycti/entities/opencti_task.py | 2 -- pycti/entities/opencti_threat_actor.py | 2 -- pycti/entities/opencti_threat_actor_group.py | 2 -- pycti/entities/opencti_threat_actor_individual.py | 2 -- pycti/entities/opencti_tool.py | 2 -- pycti/entities/opencti_vulnerability.py | 2 -- 41 files changed, 7 insertions(+), 89 deletions(-) diff --git a/pycti/entities/opencti_attack_pattern.py b/pycti/entities/opencti_attack_pattern.py index beada5a16..cad17c1b8 100644 --- a/pycti/entities/opencti_attack_pattern.py +++ b/pycti/entities/opencti_attack_pattern.py @@ -256,8 +256,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Attack-Patterns with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_campaign.py b/pycti/entities/opencti_campaign.py index f3212de8f..58e03ec38 100644 --- a/pycti/entities/opencti_campaign.py +++ b/pycti/entities/opencti_campaign.py @@ -241,8 +241,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Campaigns with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_case_incident.py b/pycti/entities/opencti_case_incident.py index 1b0b81a58..596b7d081 100644 --- a/pycti/entities/opencti_case_incident.py +++ b/pycti/entities/opencti_case_incident.py @@ -467,7 +467,7 @@ def generate_id_from_data(data): """ List Case Incident objects - + :param filters: the filters to apply :param search: the search keyword :param first: return the first n rows from the after ID (or the beginning if not set) @@ -486,8 +486,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Case Incidents with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_case_rfi.py b/pycti/entities/opencti_case_rfi.py index 120342993..060474f43 100644 --- a/pycti/entities/opencti_case_rfi.py +++ b/pycti/entities/opencti_case_rfi.py @@ -206,7 +206,7 @@ def __init__(self, opencti): } ... on StixCyberObservable { observable_value - } + } ... on StixCoreRelationship { standard_id spec_version @@ -417,7 +417,7 @@ def __init__(self, opencti): } ... on StixCyberObservable { observable_value - } + } ... on StixCoreRelationship { standard_id spec_version @@ -465,7 +465,7 @@ def generate_id_from_data(data): """ List Case Rfi objects - + :param filters: the filters to apply :param search: the search keyword :param first: return the first n rows from the after ID (or the beginning if not set) @@ -484,8 +484,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Case Rfis with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_case_rft.py b/pycti/entities/opencti_case_rft.py index ecaf8f83e..372857171 100644 --- a/pycti/entities/opencti_case_rft.py +++ b/pycti/entities/opencti_case_rft.py @@ -206,7 +206,7 @@ def __init__(self, opencti): } ... on StixCyberObservable { observable_value - } + } ... on StixCoreRelationship { standard_id spec_version @@ -417,7 +417,7 @@ def __init__(self, opencti): } ... on StixCyberObservable { observable_value - } + } ... on StixCoreRelationship { standard_id spec_version @@ -465,7 +465,7 @@ def generate_id_from_data(data): """ List Case Rft objects - + :param filters: the filters to apply :param search: the search keyword :param first: return the first n rows from the after ID (or the beginning if not set) @@ -484,8 +484,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Case Rfts with filters", {"filters": json.dumps(filters)} ) diff --git a/pycti/entities/opencti_channel.py b/pycti/entities/opencti_channel.py index 9fc1b280e..d8a110858 100644 --- a/pycti/entities/opencti_channel.py +++ b/pycti/entities/opencti_channel.py @@ -237,8 +237,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Channels with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_course_of_action.py b/pycti/entities/opencti_course_of_action.py index af65bbbb2..94985ed2a 100644 --- a/pycti/entities/opencti_course_of_action.py +++ b/pycti/entities/opencti_course_of_action.py @@ -229,8 +229,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Courses-Of-Action with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_data_component.py b/pycti/entities/opencti_data_component.py index c34250d6c..428f33198 100644 --- a/pycti/entities/opencti_data_component.py +++ b/pycti/entities/opencti_data_component.py @@ -271,8 +271,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Data-Components with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_data_source.py b/pycti/entities/opencti_data_source.py index 3935a5074..311312a7c 100644 --- a/pycti/entities/opencti_data_source.py +++ b/pycti/entities/opencti_data_source.py @@ -229,8 +229,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Data-Sources with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_event.py b/pycti/entities/opencti_event.py index c07fcad06..1b20b9b28 100644 --- a/pycti/entities/opencti_event.py +++ b/pycti/entities/opencti_event.py @@ -241,8 +241,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Events with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_external_reference.py b/pycti/entities/opencti_external_reference.py index af238bd86..53c7b0484 100644 --- a/pycti/entities/opencti_external_reference.py +++ b/pycti/entities/opencti_external_reference.py @@ -93,8 +93,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing External-Reference with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_feedback.py b/pycti/entities/opencti_feedback.py index 0f8925dae..49de1a5c7 100644 --- a/pycti/entities/opencti_feedback.py +++ b/pycti/entities/opencti_feedback.py @@ -444,8 +444,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Feedbacks with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_grouping.py b/pycti/entities/opencti_grouping.py index f3d0be6ea..8467c7322 100644 --- a/pycti/entities/opencti_grouping.py +++ b/pycti/entities/opencti_grouping.py @@ -434,8 +434,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Groupings with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_identity.py b/pycti/entities/opencti_identity.py index dec283ad2..6a4319179 100644 --- a/pycti/entities/opencti_identity.py +++ b/pycti/entities/opencti_identity.py @@ -258,8 +258,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Identities with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_incident.py b/pycti/entities/opencti_incident.py index 6ada2f49f..0a587af4c 100644 --- a/pycti/entities/opencti_incident.py +++ b/pycti/entities/opencti_incident.py @@ -250,8 +250,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Incidents with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_infrastructure.py b/pycti/entities/opencti_infrastructure.py index d55d45740..b275bb2da 100644 --- a/pycti/entities/opencti_infrastructure.py +++ b/pycti/entities/opencti_infrastructure.py @@ -270,8 +270,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Infrastructures with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_intrusion_set.py b/pycti/entities/opencti_intrusion_set.py index 8f72b2eca..851f19e33 100644 --- a/pycti/entities/opencti_intrusion_set.py +++ b/pycti/entities/opencti_intrusion_set.py @@ -247,8 +247,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Intrusion-Sets with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_kill_chain_phase.py b/pycti/entities/opencti_kill_chain_phase.py index 093dd372c..f0093f780 100644 --- a/pycti/entities/opencti_kill_chain_phase.py +++ b/pycti/entities/opencti_kill_chain_phase.py @@ -50,8 +50,6 @@ def list(self, **kwargs): custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Kill-Chain-Phase with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_label.py b/pycti/entities/opencti_label.py index 726c7f1b7..c17f2863f 100644 --- a/pycti/entities/opencti_label.py +++ b/pycti/entities/opencti_label.py @@ -44,8 +44,6 @@ def list(self, **kwargs): custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Labels with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_language.py b/pycti/entities/opencti_language.py index 2790dbe6e..2270bf9d5 100644 --- a/pycti/entities/opencti_language.py +++ b/pycti/entities/opencti_language.py @@ -249,8 +249,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Languages with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_location.py b/pycti/entities/opencti_location.py index 12a921e6a..5d1be908e 100644 --- a/pycti/entities/opencti_location.py +++ b/pycti/entities/opencti_location.py @@ -260,8 +260,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Locations with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_malware.py b/pycti/entities/opencti_malware.py index 615c2fc2e..efaded401 100644 --- a/pycti/entities/opencti_malware.py +++ b/pycti/entities/opencti_malware.py @@ -275,8 +275,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Malwares with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_malware_analysis.py b/pycti/entities/opencti_malware_analysis.py index 2c44e7abc..ed7e62282 100644 --- a/pycti/entities/opencti_malware_analysis.py +++ b/pycti/entities/opencti_malware_analysis.py @@ -255,8 +255,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Malware analyses with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_marking_definition.py b/pycti/entities/opencti_marking_definition.py index cf01d5cac..ebb906be9 100644 --- a/pycti/entities/opencti_marking_definition.py +++ b/pycti/entities/opencti_marking_definition.py @@ -55,8 +55,6 @@ def list(self, **kwargs): custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Marking-Definitions with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_narrative.py b/pycti/entities/opencti_narrative.py index 32477cd36..6a4cdc252 100644 --- a/pycti/entities/opencti_narrative.py +++ b/pycti/entities/opencti_narrative.py @@ -227,8 +227,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Narratives with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_note.py b/pycti/entities/opencti_note.py index 7430a31ca..2cd01964c 100644 --- a/pycti/entities/opencti_note.py +++ b/pycti/entities/opencti_note.py @@ -473,8 +473,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Notes with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_observed_data.py b/pycti/entities/opencti_observed_data.py index dc1293a96..2f484e8e4 100644 --- a/pycti/entities/opencti_observed_data.py +++ b/pycti/entities/opencti_observed_data.py @@ -464,8 +464,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing ObservedDatas with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_opinion.py b/pycti/entities/opencti_opinion.py index 6b435c7ea..d297d2d53 100644 --- a/pycti/entities/opencti_opinion.py +++ b/pycti/entities/opencti_opinion.py @@ -250,8 +250,6 @@ def list(self, **kwargs): custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Opinions with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_report.py b/pycti/entities/opencti_report.py index 2ab74fc23..58d8e1e13 100644 --- a/pycti/entities/opencti_report.py +++ b/pycti/entities/opencti_report.py @@ -504,8 +504,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Reports with filters", diff --git a/pycti/entities/opencti_stix_core_object.py b/pycti/entities/opencti_stix_core_object.py index 4846cc16b..a2b17e369 100644 --- a/pycti/entities/opencti_stix_core_object.py +++ b/pycti/entities/opencti_stix_core_object.py @@ -1340,8 +1340,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Stix-Core-Objects with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_stix_core_relationship.py b/pycti/entities/opencti_stix_core_relationship.py index 2d56eb21a..e7fe991f1 100644 --- a/pycti/entities/opencti_stix_core_relationship.py +++ b/pycti/entities/opencti_stix_core_relationship.py @@ -408,8 +408,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) search = kwargs.get("search", None) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing stix_core_relationships", diff --git a/pycti/entities/opencti_stix_cyber_observable.py b/pycti/entities/opencti_stix_cyber_observable.py index af7097a1e..d307642a1 100644 --- a/pycti/entities/opencti_stix_cyber_observable.py +++ b/pycti/entities/opencti_stix_cyber_observable.py @@ -48,8 +48,6 @@ def list(self, **kwargs): with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing StixCyberObservables with filters", diff --git a/pycti/entities/opencti_stix_domain_object.py b/pycti/entities/opencti_stix_domain_object.py index e8d1530fe..0797ae0c3 100644 --- a/pycti/entities/opencti_stix_domain_object.py +++ b/pycti/entities/opencti_stix_domain_object.py @@ -1030,8 +1030,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Stix-Domain-Objects with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_stix_nested_ref_relationship.py b/pycti/entities/opencti_stix_nested_ref_relationship.py index 15705aa7c..3107a46d6 100644 --- a/pycti/entities/opencti_stix_nested_ref_relationship.py +++ b/pycti/entities/opencti_stix_nested_ref_relationship.py @@ -94,8 +94,6 @@ def list(self, **kwargs): custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing stix_nested_ref_relationships", diff --git a/pycti/entities/opencti_stix_sighting_relationship.py b/pycti/entities/opencti_stix_sighting_relationship.py index 3a44e4b2c..e3803bee7 100644 --- a/pycti/entities/opencti_stix_sighting_relationship.py +++ b/pycti/entities/opencti_stix_sighting_relationship.py @@ -340,8 +340,6 @@ def list(self, **kwargs): get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) search = kwargs.get("search", None) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing stix_sighting with {type: stix_sighting}", diff --git a/pycti/entities/opencti_task.py b/pycti/entities/opencti_task.py index 9aea86699..c49b2532e 100644 --- a/pycti/entities/opencti_task.py +++ b/pycti/entities/opencti_task.py @@ -257,8 +257,6 @@ def list(self, **kwargs): custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Tasks with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_threat_actor.py b/pycti/entities/opencti_threat_actor.py index 3e4002a40..dba8ce172 100644 --- a/pycti/entities/opencti_threat_actor.py +++ b/pycti/entities/opencti_threat_actor.py @@ -181,8 +181,6 @@ def list(self, **kwargs) -> dict: custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Threat-Actors with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_threat_actor_group.py b/pycti/entities/opencti_threat_actor_group.py index af9d23c24..87e48da6f 100644 --- a/pycti/entities/opencti_threat_actor_group.py +++ b/pycti/entities/opencti_threat_actor_group.py @@ -174,8 +174,6 @@ def list(self, **kwargs) -> dict: custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Threat-Actors-Group with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_threat_actor_individual.py b/pycti/entities/opencti_threat_actor_individual.py index ff1590d26..824405a55 100644 --- a/pycti/entities/opencti_threat_actor_individual.py +++ b/pycti/entities/opencti_threat_actor_individual.py @@ -174,8 +174,6 @@ def list(self, **kwargs) -> dict: custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 500 self.opencti.app_logger.info( "Listing Threat-Actors-Individual with filters", diff --git a/pycti/entities/opencti_tool.py b/pycti/entities/opencti_tool.py index 8609f5db9..32004c316 100644 --- a/pycti/entities/opencti_tool.py +++ b/pycti/entities/opencti_tool.py @@ -158,8 +158,6 @@ def list(self, **kwargs): custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Tools with filters", {"filters": json.dumps(filters)} diff --git a/pycti/entities/opencti_vulnerability.py b/pycti/entities/opencti_vulnerability.py index 70b31acaa..3df5855af 100644 --- a/pycti/entities/opencti_vulnerability.py +++ b/pycti/entities/opencti_vulnerability.py @@ -155,8 +155,6 @@ def list(self, **kwargs): custom_attributes = kwargs.get("customAttributes", None) get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) - if get_all: - first = 100 self.opencti.app_logger.info( "Listing Vulnerabilities with filters", {"filters": json.dumps(filters)} From cd37919811995b3dafe65094c74df0fc931eccc3 Mon Sep 17 00:00:00 2001 From: Axel Fahy Date: Fri, 17 Jan 2025 10:25:56 +0100 Subject: [PATCH 2/3] format with black --- pycti/entities/opencti_stix_cyber_observable.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pycti/entities/opencti_stix_cyber_observable.py b/pycti/entities/opencti_stix_cyber_observable.py index d307642a1..a79eaa944 100644 --- a/pycti/entities/opencti_stix_cyber_observable.py +++ b/pycti/entities/opencti_stix_cyber_observable.py @@ -48,7 +48,6 @@ def list(self, **kwargs): with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) - self.opencti.app_logger.info( "Listing StixCyberObservables with filters", {"filters": json.dumps(filters)}, From ed069d7e88d3dba49b5b041210ead688d87c458c Mon Sep 17 00:00:00 2001 From: Axel Fahy Date: Fri, 17 Jan 2025 10:44:19 +0100 Subject: [PATCH 3/3] remove unused getAll arg --- pycti/entities/opencti_kill_chain_phase.py | 1 - pycti/entities/opencti_location.py | 1 - pycti/entities/opencti_marking_definition.py | 1 - pycti/entities/opencti_observed_data.py | 9 ++++----- pycti/entities/opencti_stix_nested_ref_relationship.py | 9 ++++----- pycti/entities/opencti_threat_actor.py | 2 -- pycti/entities/opencti_threat_actor_group.py | 2 -- pycti/entities/opencti_threat_actor_individual.py | 2 -- 8 files changed, 8 insertions(+), 19 deletions(-) diff --git a/pycti/entities/opencti_kill_chain_phase.py b/pycti/entities/opencti_kill_chain_phase.py index f0093f780..56d7ca302 100644 --- a/pycti/entities/opencti_kill_chain_phase.py +++ b/pycti/entities/opencti_kill_chain_phase.py @@ -48,7 +48,6 @@ def list(self, **kwargs): order_by = kwargs.get("orderBy", None) order_mode = kwargs.get("orderMode", None) custom_attributes = kwargs.get("customAttributes", None) - get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) self.opencti.app_logger.info( diff --git a/pycti/entities/opencti_location.py b/pycti/entities/opencti_location.py index 5d1be908e..1ba7a4856 100644 --- a/pycti/entities/opencti_location.py +++ b/pycti/entities/opencti_location.py @@ -257,7 +257,6 @@ def list(self, **kwargs): order_by = kwargs.get("orderBy", None) order_mode = kwargs.get("orderMode", None) custom_attributes = kwargs.get("customAttributes", None) - get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) diff --git a/pycti/entities/opencti_marking_definition.py b/pycti/entities/opencti_marking_definition.py index ebb906be9..168a9d9c4 100644 --- a/pycti/entities/opencti_marking_definition.py +++ b/pycti/entities/opencti_marking_definition.py @@ -53,7 +53,6 @@ def list(self, **kwargs): order_by = kwargs.get("orderBy", None) order_mode = kwargs.get("orderMode", None) custom_attributes = kwargs.get("customAttributes", None) - get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) self.opencti.app_logger.info( diff --git a/pycti/entities/opencti_observed_data.py b/pycti/entities/opencti_observed_data.py index 2f484e8e4..ec242bf5d 100644 --- a/pycti/entities/opencti_observed_data.py +++ b/pycti/entities/opencti_observed_data.py @@ -190,7 +190,7 @@ def __init__(self, opencti): } ... on StixCyberObservable { observable_value - } + } ... on StixCoreRelationship { standard_id spec_version @@ -202,7 +202,7 @@ def __init__(self, opencti): spec_version created_at updated_at - } + } } } } @@ -401,7 +401,7 @@ def __init__(self, opencti): } ... on StixCyberObservable { observable_value - } + } ... on StixCoreRelationship { standard_id spec_version @@ -413,7 +413,7 @@ def __init__(self, opencti): spec_version created_at updated_at - } + } } } } @@ -461,7 +461,6 @@ def list(self, **kwargs): order_by = kwargs.get("orderBy", None) order_mode = kwargs.get("orderMode", None) custom_attributes = kwargs.get("customAttributes", None) - get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) with_files = kwargs.get("withFiles", False) diff --git a/pycti/entities/opencti_stix_nested_ref_relationship.py b/pycti/entities/opencti_stix_nested_ref_relationship.py index 3107a46d6..b59959c7d 100644 --- a/pycti/entities/opencti_stix_nested_ref_relationship.py +++ b/pycti/entities/opencti_stix_nested_ref_relationship.py @@ -24,13 +24,13 @@ def __init__(self, opencti): standard_id entity_type parent_types - } + } ... on StixSightingRelationship { id standard_id entity_type parent_types - } + } ... on StixCyberObservable { observable_value } @@ -47,13 +47,13 @@ def __init__(self, opencti): standard_id entity_type parent_types - } + } ... on StixSightingRelationship { id standard_id entity_type parent_types - } + } ... on StixCyberObservable { observable_value } @@ -92,7 +92,6 @@ def list(self, **kwargs): order_by = kwargs.get("orderBy", None) order_mode = kwargs.get("orderMode", None) custom_attributes = kwargs.get("customAttributes", None) - get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) self.opencti.app_logger.info( diff --git a/pycti/entities/opencti_threat_actor.py b/pycti/entities/opencti_threat_actor.py index dba8ce172..601489277 100644 --- a/pycti/entities/opencti_threat_actor.py +++ b/pycti/entities/opencti_threat_actor.py @@ -168,7 +168,6 @@ def list(self, **kwargs) -> dict: :param str after: (optional) OpenCTI object ID of the first row for pagination :param str orderBy: (optional) the field to order the response on :param bool orderMode: (optional) either "`asc`" or "`desc`" - :param bool getAll: (optional) switch to return all entries (be careful to use this without any other filters) :param bool withPagination: (optional) switch to use pagination """ @@ -179,7 +178,6 @@ def list(self, **kwargs) -> dict: order_by = kwargs.get("orderBy", None) order_mode = kwargs.get("orderMode", None) custom_attributes = kwargs.get("customAttributes", None) - get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) self.opencti.app_logger.info( diff --git a/pycti/entities/opencti_threat_actor_group.py b/pycti/entities/opencti_threat_actor_group.py index 87e48da6f..9e2f499ea 100644 --- a/pycti/entities/opencti_threat_actor_group.py +++ b/pycti/entities/opencti_threat_actor_group.py @@ -161,7 +161,6 @@ def list(self, **kwargs) -> dict: :param str after: (optional) OpenCTI object ID of the first row for pagination :param str orderBy: (optional) the field to order the response on :param bool orderMode: (optional) either "`asc`" or "`desc`" - :param bool getAll: (optional) switch to return all entries (be careful to use this without any other filters) :param bool withPagination: (optional) switch to use pagination """ @@ -172,7 +171,6 @@ def list(self, **kwargs) -> dict: order_by = kwargs.get("orderBy", None) order_mode = kwargs.get("orderMode", None) custom_attributes = kwargs.get("customAttributes", None) - get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) self.opencti.app_logger.info( diff --git a/pycti/entities/opencti_threat_actor_individual.py b/pycti/entities/opencti_threat_actor_individual.py index 824405a55..b4a5ea7c1 100644 --- a/pycti/entities/opencti_threat_actor_individual.py +++ b/pycti/entities/opencti_threat_actor_individual.py @@ -161,7 +161,6 @@ def list(self, **kwargs) -> dict: :param str after: (optional) OpenCTI object ID of the first row for pagination :param str orderBy: (optional) the field to order the response on :param bool orderMode: (optional) either "`asc`" or "`desc`" - :param bool getAll: (optional) switch to return all entries (be careful to use this without any other filters) :param bool withPagination: (optional) switch to use pagination """ @@ -172,7 +171,6 @@ def list(self, **kwargs) -> dict: order_by = kwargs.get("orderBy", None) order_mode = kwargs.get("orderMode", None) custom_attributes = kwargs.get("customAttributes", None) - get_all = kwargs.get("getAll", False) with_pagination = kwargs.get("withPagination", False) self.opencti.app_logger.info(