Skip to content

Commit

Permalink
remove n
Browse files Browse the repository at this point in the history
  • Loading branch information
RotemAmit committed Jan 9, 2025
1 parent ea70d3d commit 1152133
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions Packs/NationalVulnerabilityDatabaseFeed/ReleaseNotes/1_0_9.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/NationalVulnerabilityDatabaseFeed/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
2 changes: 1 addition & 1 deletion Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
2 changes: 1 addition & 1 deletion Packs/Netcraft_V2/Integrations/Netcraft/Netcraft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions Packs/Netcraft_V2/ReleaseNotes/1_0_4.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/Netcraft_V2/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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 = []

Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.'
Expand Down Expand Up @@ -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: '-'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import io
from copy import deepcopy

import pytest
Expand All @@ -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())


Expand Down
5 changes: 0 additions & 5 deletions Packs/NetscoutArborSightline/ReleaseNotes/1_0_19.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/NetscoutArborSightline/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
Expand Down
42 changes: 25 additions & 17 deletions Packs/Nexthink/Integrations/Nexthink/Nexthink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))"

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion Packs/Nexthink/Integrations/Nexthink/Nexthink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions Packs/Nexthink/ReleaseNotes/1_0_6.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/Nexthink/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down

0 comments on commit 1152133

Please sign in to comment.