From 115213305bd428ff877deae18812a163fc10bcee Mon Sep 17 00:00:00 2001 From: RotemAmit Date: Thu, 9 Jan 2025 11:40:20 +0200 Subject: [PATCH] remove n --- .../NationalVulnerabilityDatabaseFeed.py | 2 - .../NationalVulnerabilityDatabaseFeed.yml | 2 +- .../ReleaseNotes/1_0_9.md | 5 --- .../pack_metadata.json | 2 +- .../Integrations/Netcraft/Netcraft.py | 2 +- .../Integrations/Netcraft/Netcraft.yml | 2 +- Packs/Netcraft_V2/ReleaseNotes/1_0_4.md | 5 --- Packs/Netcraft_V2/pack_metadata.json | 2 +- .../NetscoutArborSightline.py | 21 ++++------ .../NetscoutArborSightline.yml | 8 ++-- .../NetscoutArborSightline_test.py | 3 +- .../ReleaseNotes/1_0_19.md | 5 --- .../NetscoutArborSightline/pack_metadata.json | 2 +- .../Integrations/Nexthink/Nexthink.py | 42 +++++++++++-------- .../Integrations/Nexthink/Nexthink.yml | 2 +- Packs/Nexthink/ReleaseNotes/1_0_6.md | 5 --- Packs/Nexthink/pack_metadata.json | 2 +- 17 files changed, 48 insertions(+), 64 deletions(-) delete mode 100644 Packs/NationalVulnerabilityDatabaseFeed/ReleaseNotes/1_0_9.md delete mode 100644 Packs/Netcraft_V2/ReleaseNotes/1_0_4.md delete mode 100644 Packs/NetscoutArborSightline/ReleaseNotes/1_0_19.md delete mode 100644 Packs/Nexthink/ReleaseNotes/1_0_6.md diff --git a/Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.py b/Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.py index e519afb94ca9..b7256b3519aa 100644 --- a/Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.py +++ b/Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.py @@ -276,8 +276,6 @@ def fetch_indicators_command(client, params): outputs=data_items, readable_output=tableToMarkdown("National Vulnerability Database CVEs:", outputs) ) - else: - command_results = CommandResults('No result was found') return_results(command_results) # Else if this is fetch-indicators diff --git a/Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.yml b/Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.yml index 6093ea5ecf40..5581d3b9d6b7 100644 --- a/Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.yml +++ b/Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.yml @@ -215,7 +215,7 @@ script: - contextPath: CPE.titles description: This element contains the human-readable, English title for the CPE. type: Unknown - dockerimage: demisto/python3:3.11.10.116949 + dockerimage: demisto/python3:3.11.10.115186 feed: true subtype: python3 isFetchSamples: true diff --git a/Packs/NationalVulnerabilityDatabaseFeed/ReleaseNotes/1_0_9.md b/Packs/NationalVulnerabilityDatabaseFeed/ReleaseNotes/1_0_9.md deleted file mode 100644 index de4b8236cd5e..000000000000 --- a/Packs/NationalVulnerabilityDatabaseFeed/ReleaseNotes/1_0_9.md +++ /dev/null @@ -1,5 +0,0 @@ -#### Integrations - -##### National Vulnerability Database -- Code functionality improvements. -- Updated the Docker image to: *demisto/python3:3.11.10.116949*. \ No newline at end of file diff --git a/Packs/NationalVulnerabilityDatabaseFeed/pack_metadata.json b/Packs/NationalVulnerabilityDatabaseFeed/pack_metadata.json index a910a499ba7b..69b71f4cfd69 100644 --- a/Packs/NationalVulnerabilityDatabaseFeed/pack_metadata.json +++ b/Packs/NationalVulnerabilityDatabaseFeed/pack_metadata.json @@ -2,7 +2,7 @@ "name": "National Vulnerability Database Feed", "description": "CVE and CPE feed from the National Vulnerability Database", "support": "community", - "currentVersion": "1.0.9", + "currentVersion": "1.0.8", "author": "Adam Burt", "url": "https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/bd-p/Cortex_XSOAR_Discussions", "email": "", diff --git a/Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.py b/Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.py index 72276ec2535a..cb0555af7ace 100644 --- a/Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.py +++ b/Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.py @@ -961,7 +961,7 @@ def file_screenshot_get_command(args: dict, client: Client) -> dict | CommandRes def email_report_submit_command(args: dict, client: Client) -> CommandResults: - message = '' + if from_message := args.get('message'): message = from_message if from_entry_id := args.get('entry_id'): diff --git a/Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.yml b/Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.yml index 0db7e7239331..8c736ebc45db 100644 --- a/Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.yml +++ b/Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.yml @@ -1499,7 +1499,7 @@ script: type: string script: '-' type: python - dockerimage: demisto/python3:3.11.10.116949 + dockerimage: demisto/python3:3.11.10.115186 subtype: python3 isfetch: true runonce: false diff --git a/Packs/Netcraft_V2/ReleaseNotes/1_0_4.md b/Packs/Netcraft_V2/ReleaseNotes/1_0_4.md deleted file mode 100644 index 19b021ebb90f..000000000000 --- a/Packs/Netcraft_V2/ReleaseNotes/1_0_4.md +++ /dev/null @@ -1,5 +0,0 @@ -#### Integrations - -##### Netcraft -- Code functionality improvements. -- Updated the Docker image to: *demisto/python3:3.11.10.116949*. \ No newline at end of file diff --git a/Packs/Netcraft_V2/pack_metadata.json b/Packs/Netcraft_V2/pack_metadata.json index 3779b7e2ece2..5582ba32d4f0 100644 --- a/Packs/Netcraft_V2/pack_metadata.json +++ b/Packs/Netcraft_V2/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Netcraft", "description": "Netcraft takedown, submission and screenshot management.", "support": "xsoar", - "currentVersion": "1.0.4", + "currentVersion": "1.0.3", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", diff --git a/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.py b/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.py index 704b9edf2a7f..d1c2d0291409 100644 --- a/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.py +++ b/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.py @@ -5,7 +5,8 @@ from copy import deepcopy import requests -from datetime import UTC +from typing import Dict, Tuple +from datetime import timezone import urllib3 # Disable insecure warnings @@ -185,7 +186,7 @@ def build_relationships(self, **kwargs) -> dict: Returns: (dict): Netscout relationships object """ - relationships: dict[str, Any] = {} + relationships: Dict[str, Any] = {} for key, val in kwargs.items(): if val: # In some cases the name of the relationships is not the same as the type (most cases it is) @@ -238,7 +239,7 @@ def build_data_attribute_filter(self, attributes_dict: dict) -> str: param_list.append(f'/data/attributes/{key + operator + val}') return ' AND '.join(param_list) - def fetch_incidents(self, params_dict: dict) -> tuple[list, str]: + def fetch_incidents(self, params_dict: dict) -> Tuple[list, str]: """ Perform fetch incidents process. 1. We first save the current time to know what was the time at the beginning of the incidents counting process. @@ -262,7 +263,7 @@ def fetch_incidents(self, params_dict: dict) -> tuple[list, str]: # We calculate the page size to query, by performing an incidents query with page size = 1, the amount of # returned pages will equal to amount of incidents - now = datetime.now(UTC).isoformat() + now = datetime.now(timezone.utc).isoformat() amount_of_incidents = self.calculate_amount_of_incidents(start_time=last_start_time, params_dict=params_dict) incidents: list = [] @@ -293,7 +294,7 @@ def fetch_incidents(self, params_dict: dict) -> tuple[list, str]: }) return incidents, new_last_start_time - def fetch_incidents_loop(self) -> tuple[list, str]: + def fetch_incidents_loop(self) -> Tuple[list, str]: """ Calls the fetch incidents function to pull incidents with for each alert_type/alert_class separately. @@ -312,10 +313,6 @@ def fetch_incidents_loop(self) -> tuple[list, str]: elif self.alert_class: key = 'alert_class' class_type_list = self.alert_class - else: - key = '' - class_type_list = [] - demisto.debug(f"No condition was matched {key=} {class_type_list=}") if self.alert_class or self.alert_type: for item in class_type_list: @@ -477,7 +474,7 @@ def build_human_readable(data: dict) -> dict: def build_output(data: dict, extend_data: bool = False, key_to_flat: str = 'attributes', keys_to_remove: list = None) -> dict: - keys_to_remove = keys_to_remove if keys_to_remove else ['relationships'] + keys_to_remove = ['relationships'] if not keys_to_remove else keys_to_remove data_copy = deepcopy(data) clean_links(data_copy) if key_to_flat: @@ -630,7 +627,7 @@ def mitigation_create_command(client: NetscoutClient, args: dict): raw_response=raw_result) -def mitigation_delete_command(client: NetscoutClient, args: dict[str, str]): +def mitigation_delete_command(client: NetscoutClient, args: Dict[str, str]): mitigation_id = args.get('mitigation_id', '') client.delete_mitigation(mitigation_id) hr = f'### Mitigation {mitigation_id} was deleted' @@ -729,7 +726,7 @@ def main() -> None: demisto.debug(f'Command being called is {demisto.command()}') - headers: dict = { + headers: Dict = { 'X-Arbux-APIToken': api_token } diff --git a/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.yml b/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.yml index c5047c77dae0..06080aa36ed8 100644 --- a/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.yml +++ b/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.yml @@ -285,7 +285,7 @@ script: description: The ID of the alert. type: String - contextPath: NASightline.Alert.importance - description: 'Importance of the alert. One of the following 2: high, 1: medium, 0: low.' + description: 'Importance of the alert. One of the following 2: high, 1: medium, 0: low' type: Number - contextPath: NASightline.Alert.ongoing description: Whether the alert is currently active. @@ -300,7 +300,7 @@ script: description: Type of the returned object. type: String - contextPath: NASightline.Alert.classification - description: 'Classification of the alert. One of the following: False Positive, Flash Crowd, Network Failure, Possible Attack, Trivial, Verified Attack.' + description: 'Classification of the alert. One of the following: False Positive, Flash Crowd, Network Failure, Possible Attack, Trivial, Verified Attack ' type: String - contextPath: NASightline.Alert.stop_time description: Date and time at which the alert activity was no longer detected. @@ -542,7 +542,7 @@ script: description: 'The router license type: core, edge, or unset. For more information, see “Configuring Routers” in the Sightline and TMS User Guide.' type: String - contextPath: NASightline.Router.name - description: Router name. + description: Router name type: String - contextPath: NASightline.Router.snmp_authprotocol description: 'SNMP v3 authentication protocol. One of the following: md5, sha, sha-224, sha-256, sha-384, sha-512.' @@ -777,7 +777,7 @@ script: type: String description: Get a list of available TMS groups. name: na-sightline-tms-group-list - dockerimage: demisto/python3:3.11.10.116949 + dockerimage: demisto/python3:3.10.13.86272 isfetch: true runonce: false script: '-' diff --git a/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline_test.py b/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline_test.py index 9527d3d03b82..73f14a967c6c 100644 --- a/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline_test.py +++ b/Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline_test.py @@ -1,4 +1,5 @@ import json +import io from copy import deepcopy import pytest @@ -13,7 +14,7 @@ # from Packs def util_load_json(path): - with open(path, encoding='utf-8') as f: + with io.open(path, mode='r', encoding='utf-8') as f: return json.loads(f.read()) diff --git a/Packs/NetscoutArborSightline/ReleaseNotes/1_0_19.md b/Packs/NetscoutArborSightline/ReleaseNotes/1_0_19.md deleted file mode 100644 index 094a96c6a598..000000000000 --- a/Packs/NetscoutArborSightline/ReleaseNotes/1_0_19.md +++ /dev/null @@ -1,5 +0,0 @@ -#### Integrations - -##### Netscout Arbor Sightline (Peakflow) -- Code functionality improvements. -- Updated the Docker image to: *demisto/python3:3.11.10.116949*. \ No newline at end of file diff --git a/Packs/NetscoutArborSightline/pack_metadata.json b/Packs/NetscoutArborSightline/pack_metadata.json index 94624c307f62..3d1eb793fc7e 100644 --- a/Packs/NetscoutArborSightline/pack_metadata.json +++ b/Packs/NetscoutArborSightline/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Netscout Arbor Sightline", "description": "Identify Potential Network Outages & Gain Business Insights to Solve Your Problems", "support": "partner", - "currentVersion": "1.0.19", + "currentVersion": "1.0.18", "author": "Netscout", "url": "https://www.netscout.com/product/arbor-sightline", "email": "supportmanagement@netscout.com", diff --git a/Packs/Nexthink/Integrations/Nexthink/Nexthink.py b/Packs/Nexthink/Integrations/Nexthink/Nexthink.py index 2846196e704c..42cd03ea684a 100644 --- a/Packs/Nexthink/Integrations/Nexthink/Nexthink.py +++ b/Packs/Nexthink/Integrations/Nexthink/Nexthink.py @@ -16,17 +16,26 @@ args = demisto.args() -device = args.get('hostname', None) - -ip = args.get('ipaddress', None) - -package = args.get('package', None) - -SEARCH_DEVICE_USING_IP = f"(select (*) (from device (where device ( eq ip_addresses (ip_address '{ip}')))))" -SEARCH_DEVICE_USING_DEVICE = f"(select (*) (from device (where device ( eq name (string {device})))))" +if 'hostname' in args: + device = args['hostname'] +else: + device = None + +if 'ipaddress' in args: + ip = args['ipaddress'] +else: + ip = None + +if 'package' in args: + package = args['package'] +else: + package = None + +SEARCH_DEVICE_USING_IP = "(select (*) (from device (where device ( eq ip_addresses (ip_address '{0}')))))".format(ip) +SEARCH_DEVICE_USING_DEVICE = "(select (*) (from device (where device ( eq name (string {0})))))".format(device) SEARCH_COMPLIANCE_PACKAGE_DEVICE = """(select ((device (*)) (package (*))) (from (device package) -(with package (where package (eq name (pattern '*{}*'))) -(where device (eq name (pattern '{}'))))) +(with package (where package (eq name (pattern '*{0}*'))) +(where device (eq name (pattern '{1}'))))) (limit 100))""".format(package, device) TEST_MODULE = "(select (name) (from device ) (limit 1))" @@ -55,7 +64,7 @@ def nexthink_request(method, nxql): "https": None, } - BASE_URL = f'https://{base_url}:{port}/2/query?platform=windows&format=json&query=' + BASE_URL = 'https://{0}:{1}/2/query?platform=windows&format=json&query='.format(base_url, port) NXQL = urllib.parse.quote(nxql) urlFragment = BASE_URL + NXQL @@ -110,9 +119,9 @@ def nexthink_endpoint_details(device: None, ip: None): return dArgs else: if not device: - return f'No endpoint found with ip "{ip}"' + return 'No endpoint found with ip "{0}"'.format(ip) else: - return f'No endpoint found with hostname "{device}"' + return 'No endpoint found with hostname "{0}"'.format(device) def nexthink_installed_packages(device: None, package: None): @@ -143,11 +152,10 @@ def nexthink_installed_packages(device: None, package: None): return dArgs else: - return f'No package "{package}" found on endpoint {device}' + return 'No package "{0}" found on endpoint {1}'.format(package, device) def nexthink_compliance_check(device: None, ip: None): - data = "" if not device and not ip: return_results('Please provide hostname or ipaddress argument') sys.exit(0) @@ -192,9 +200,9 @@ def nexthink_compliance_check(device: None, ip: None): return dArgs else: if not device: - return f'No endpoint found with ip "{ip}"' + return 'No endpoint found with ip "{0}"'.format(ip) else: - return f'No endpoint found with hostname "{device}"' + return 'No endpoint found with hostname "{0}"'.format(device) def main(): diff --git a/Packs/Nexthink/Integrations/Nexthink/Nexthink.yml b/Packs/Nexthink/Integrations/Nexthink/Nexthink.yml index 16b16ab06b35..32dc0b2dcac0 100644 --- a/Packs/Nexthink/Integrations/Nexthink/Nexthink.yml +++ b/Packs/Nexthink/Integrations/Nexthink/Nexthink.yml @@ -121,7 +121,7 @@ script: - contextPath: Nexthink.Endpoint.MACAddress description: Endpoint MAC address. type: string - dockerimage: demisto/python3:3.11.10.116949 + dockerimage: demisto/python3:3.11.10.115186 runonce: false script: '' subtype: python3 diff --git a/Packs/Nexthink/ReleaseNotes/1_0_6.md b/Packs/Nexthink/ReleaseNotes/1_0_6.md deleted file mode 100644 index b4aafbb5e023..000000000000 --- a/Packs/Nexthink/ReleaseNotes/1_0_6.md +++ /dev/null @@ -1,5 +0,0 @@ -#### Integrations - -##### Nexthink -- Code functionality improvements. -- Updated the Docker image to: *demisto/python3:3.11.10.116949*. \ No newline at end of file diff --git a/Packs/Nexthink/pack_metadata.json b/Packs/Nexthink/pack_metadata.json index 061fbd4d5a94..e368a7aef909 100644 --- a/Packs/Nexthink/pack_metadata.json +++ b/Packs/Nexthink/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Nexthink", "description": "Nexthink helps IT teams deliver on the promise of the modern digital workplace.", "support": "community", - "currentVersion": "1.0.6", + "currentVersion": "1.0.5", "author": "Farrukh Ahmed", "url": "", "email": "",