diff --git a/Packs/SumoLogic_Cloud_SIEM/ReleaseNotes/1_1_27.md b/Packs/SumoLogic_Cloud_SIEM/ReleaseNotes/1_1_27.md new file mode 100644 index 000000000000..24528d8716ee --- /dev/null +++ b/Packs/SumoLogic_Cloud_SIEM/ReleaseNotes/1_1_27.md @@ -0,0 +1,9 @@ +#### Scripts + +##### SumoLogicCloseLinkSignalIncidents +- Code functionality improvements. +- Updated the Docker image to: *demisto/python3:3.11.10.116949*. + +##### SumoLogicLinkSignalIncidents +- Code functionality improvements. +- Updated the Docker image to: *demisto/python3:3.11.10.116949*. \ No newline at end of file diff --git a/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicCloseLinkSignalIncidents/SumoLogicCloseLinkSignalIncidents.py b/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicCloseLinkSignalIncidents/SumoLogicCloseLinkSignalIncidents.py index e6651784e796..a26070c84a09 100644 --- a/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicCloseLinkSignalIncidents/SumoLogicCloseLinkSignalIncidents.py +++ b/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicCloseLinkSignalIncidents/SumoLogicCloseLinkSignalIncidents.py @@ -9,7 +9,7 @@ Linting: https://xsoar.pan.dev/docs/integrations/linting """ -from typing import Dict, Any +from typing import Any import traceback @@ -18,8 +18,8 @@ ''' COMMAND FUNCTION ''' -def close_linked_signal_incidents_command(args: Dict[str, Any]) -> CommandResults: - if not ('id' in args): +def close_linked_signal_incidents_command(args: dict[str, Any]) -> CommandResults: + if 'id' not in args: cur_incident = demisto.incident() # print(f"Get current incident {cur_incident}") else: @@ -30,9 +30,13 @@ def close_linked_signal_incidents_command(args: Dict[str, Any]) -> CommandResult cur_incident = None else: cur_incident = search_raw[0]['Contents']['data'][0] + result = {} + demisto.debug(f"{search_raw[0]['Contents']['total']=} != 0 -> {result=}") if cur_incident is not None and cur_incident['rawType'] != 'Sumo Logic Insight': result = {'message': 'Please run this on a valid Sumo Logic Insight incident only'} elif cur_incident is not None: + result = {} + demisto.debug(f"Initializing {result=}") linked_incidents = cur_incident.get('linkedIncidents') if (linked_incidents): # print('Current Linked Signal Incidents:', linked_incidents) @@ -45,6 +49,9 @@ def close_linked_signal_incidents_command(args: Dict[str, Any]) -> CommandResult else: # print('There are no linked Signal Incidents') result = {'message': 'There are no linked incidents'} + else: + result = {} + demisto.debug(f"cur_incident is None. {result=}") return CommandResults( outputs_prefix='BaseScript', diff --git a/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicCloseLinkSignalIncidents/SumoLogicCloseLinkSignalIncidents.yml b/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicCloseLinkSignalIncidents/SumoLogicCloseLinkSignalIncidents.yml index 80a3f36498f2..d503f8af5fb9 100644 --- a/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicCloseLinkSignalIncidents/SumoLogicCloseLinkSignalIncidents.yml +++ b/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicCloseLinkSignalIncidents/SumoLogicCloseLinkSignalIncidents.yml @@ -6,7 +6,7 @@ comment: Close the linked signal incidents when the main Insight incident is clo commonfields: id: SumoLogicCloseLinkSignalIncidents version: -1 -dockerimage: demisto/python3:3.11.10.115186 +dockerimage: demisto/python3:3.11.10.116949 enabled: true name: SumoLogicCloseLinkSignalIncidents runas: DBotWeakRole diff --git a/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicLinkSignalIncidents/SumoLogicLinkSignalIncidents.py b/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicLinkSignalIncidents/SumoLogicLinkSignalIncidents.py index 7034b148c306..dd09398a8c18 100644 --- a/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicLinkSignalIncidents/SumoLogicLinkSignalIncidents.py +++ b/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicLinkSignalIncidents/SumoLogicLinkSignalIncidents.py @@ -1,7 +1,7 @@ import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 import traceback -from typing import Any, Dict +from typing import Any ''' STANDALONE FUNCTION ''' @@ -17,15 +17,17 @@ def find_field_from_labels(labels: list, type_name: str) -> Any: ''' COMMAND FUNCTION ''' -def link_incidents_command(args: Dict[str, Any]) -> CommandResults: +def link_incidents_command(args: dict[str, Any]) -> CommandResults: """Find and link the Signal incidents to the current Insight incident. :param args :return: Result of link action :rtype: CommandResults """ + result: dict = {} + demisto.debug(f"Initializing {result=}") - if not ('id' in demisto.args()): + if 'id' not in demisto.args(): cur_incident = demisto.incident() else: incident_id = demisto.args()['id'] diff --git a/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicLinkSignalIncidents/SumoLogicLinkSignalIncidents.yml b/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicLinkSignalIncidents/SumoLogicLinkSignalIncidents.yml index 97945621759d..3b528e6ebef8 100644 --- a/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicLinkSignalIncidents/SumoLogicLinkSignalIncidents.yml +++ b/Packs/SumoLogic_Cloud_SIEM/Scripts/SumoLogicLinkSignalIncidents/SumoLogicLinkSignalIncidents.yml @@ -5,7 +5,7 @@ comment: "Command to link associated Signal Incidents to the Insight Incident." commonfields: id: SumoLogicLinkSignalIncidents version: -1 -dockerimage: demisto/python3:3.11.10.115186 +dockerimage: demisto/python3:3.11.10.116949 enabled: true name: SumoLogicLinkSignalIncidents runas: DBotWeakRole diff --git a/Packs/SumoLogic_Cloud_SIEM/pack_metadata.json b/Packs/SumoLogic_Cloud_SIEM/pack_metadata.json index d431752034e3..d3a2ea9014a3 100644 --- a/Packs/SumoLogic_Cloud_SIEM/pack_metadata.json +++ b/Packs/SumoLogic_Cloud_SIEM/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Sumo Logic Cloud SIEM", "description": "Sumo Logic Cloud SIEM provides threat detection and incident response for modern IT environments. This content pack will allow you to apply automation to perform actual SOC analyst workflows. Using this content pack you will be able to fetch Incidents via Insights, update status of an Insight, add items to match list, add Threat Intel Indicators to Threat Intel Sources, and so on.", "support": "partner", - "currentVersion": "1.1.26", + "currentVersion": "1.1.27", "author": "Sumo Logic", "url": "https://www.sumologic.com/solutions/cloud-siem-enterprise/", "email": "support@sumologic.com", diff --git a/Packs/SuspiciousDomainHunting/ReleaseNotes/1_0_10.md b/Packs/SuspiciousDomainHunting/ReleaseNotes/1_0_10.md new file mode 100644 index 000000000000..e392b4e90cb8 --- /dev/null +++ b/Packs/SuspiciousDomainHunting/ReleaseNotes/1_0_10.md @@ -0,0 +1,9 @@ +#### Scripts + +##### RasterizeImageSuspicious +- Code functionality improvements. +- Updated the Docker image to: *demisto/processing-image-file:1.0.0.1858714*. + +##### RasterizeImageOriginal +- Code functionality improvements. +- Updated the Docker image to: *demisto/processing-image-file:1.0.0.1858714*. \ No newline at end of file diff --git a/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageOriginal/RasterizeImageOriginal.py b/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageOriginal/RasterizeImageOriginal.py index 855c0164074c..bb7875d6de9b 100644 --- a/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageOriginal/RasterizeImageOriginal.py +++ b/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageOriginal/RasterizeImageOriginal.py @@ -30,6 +30,9 @@ def main(): server_url_res = demisto.executeCommand("GetServerURL", {}) if server_url_res and len(server_url_res) > 0: server_url = server_url_res[0].get("Contents") + else: + server_url = "" + demisto.debug(f"{server_url_res=} -> {server_url=}") link = f"{server_url}/entry/download/{entry_id}" if server_url else None diff --git a/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageOriginal/RasterizeImageOriginal.yml b/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageOriginal/RasterizeImageOriginal.yml index 327739da2f50..11da3093f619 100644 --- a/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageOriginal/RasterizeImageOriginal.yml +++ b/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageOriginal/RasterizeImageOriginal.yml @@ -10,7 +10,7 @@ enabled: true scripttarget: 0 subtype: python3 runonce: false -dockerimage: demisto/processing-image-file:1.0.0.115372 +dockerimage: demisto/processing-image-file:1.0.0.1858714 runas: DBotWeakRole engineinfo: {} fromversion: 6.10.0 diff --git a/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageSuspicious/RasterizeImageSuspicious.py b/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageSuspicious/RasterizeImageSuspicious.py index fb46ad31f809..3f4f13ffd3e4 100644 --- a/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageSuspicious/RasterizeImageSuspicious.py +++ b/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageSuspicious/RasterizeImageSuspicious.py @@ -30,6 +30,9 @@ def main(): server_url_res = demisto.executeCommand("GetServerURL", {}) if server_url_res and len(server_url_res) > 0: server_url = server_url_res[0].get("Contents") + else: + server_url = "" + demisto.debug(f"{server_url_res=} -> {server_url=}") link = f"{server_url}/entry/download/{entry_id}" if server_url else None diff --git a/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageSuspicious/RasterizeImageSuspicious.yml b/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageSuspicious/RasterizeImageSuspicious.yml index 8cbc46cc7165..e916449232cb 100644 --- a/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageSuspicious/RasterizeImageSuspicious.yml +++ b/Packs/SuspiciousDomainHunting/Scripts/RasterizeImageSuspicious/RasterizeImageSuspicious.yml @@ -10,7 +10,7 @@ enabled: true scripttarget: 0 subtype: python3 runonce: false -dockerimage: demisto/processing-image-file:1.0.0.115372 +dockerimage: demisto/processing-image-file:1.0.0.1858714 runas: DBotWeakRole engineinfo: {} fromversion: 6.10.0 diff --git a/Packs/SuspiciousDomainHunting/pack_metadata.json b/Packs/SuspiciousDomainHunting/pack_metadata.json index 8daa661e5ec9..2c5c1bb0d1bc 100644 --- a/Packs/SuspiciousDomainHunting/pack_metadata.json +++ b/Packs/SuspiciousDomainHunting/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Suspicious Domain Hunting", "description": "This pack provides all the necessary tools for the Suspicious Domain Hunting use case. It uses the CertStream integration to ingest new SSL certificates and alert for type-squatting domains with SSL certificate, these alerts are then analyzed and mitigated.", "support": "community", - "currentVersion": "1.0.9", + "currentVersion": "1.0.10", "author": "Cortex XSOAR", "url": "https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/bd-p/Cortex_XSOAR_Discussions", "email": "", diff --git a/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2.py b/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2.py index f510d70e217d..79388db80f0a 100644 --- a/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2.py +++ b/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2.py @@ -123,6 +123,7 @@ def do_post(token, is_xml, suffix, body): url = fix_url(server) + suffix res = requests.post(url, headers={'Authorization': 'Bearer ' + token}, data=body, verify=not insecure) res.raise_for_status() + parsed_response = {} if is_xml: if res.content: parsed_response = xml2json(res.content) @@ -252,6 +253,7 @@ def get_computer_id_by_hostname(token, hostname): def get_computer_id(token, endpoint_ip, endpoint_host_name): + computer_id = "" if endpoint_ip: try: computer_id = get_computer_id_by_ip(token, endpoint_ip) @@ -496,6 +498,7 @@ def get_location_list(token, group_id): def get_id_by_endpoint(token, endpoint): + computer_id = "" if not endpoint: return_error('Please provide the IP address or the hostname of endpoint.') elif validate_ip(endpoint): diff --git a/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2.yml b/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2.yml index 2023412e5b5a..61daf9dd1ee9 100644 --- a/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2.yml +++ b/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2.yml @@ -360,7 +360,7 @@ script: name: pageSize - description: The name of the group to which the endpoint belongs. A wild card search can be done using '*'at the end of the query. name: groupName - - description: desiredVersion + - description: desiredVersion. name: desiredVersion description: Get endpoints for a running version that is different than the target version or the desired version (if specified). name: sep-identify-old-clients @@ -368,7 +368,7 @@ script: script: '-' type: python subtype: python3 - dockerimage: demisto/python3:3.11.10.116439 + dockerimage: demisto/python3:3.11.10.116949 tests: - SymantecEndpointProtection_Test fromversion: 5.0.0 diff --git a/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2_test.py b/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2_test.py index 34865478e35d..068def41a7c5 100644 --- a/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2_test.py +++ b/Packs/SymantecEndpointProtection/Integrations/SymantecEndpointProtection_V2/SymantecEndpointProtection_V2_test.py @@ -8,14 +8,14 @@ def mock_demisto(mocker): def _get_api_response(): response = "test-data/SEPM-endpoint-api-response.json" - with open(response, 'r') as f: + with open(response) as f: api_response = json.loads(f.read()) return api_response def _get_expected_output(): response = "test-data/SEPM-expected-endpoint-extract.json" - with open(response, 'r') as f: + with open(response) as f: api_response = json.loads(f.read()) return api_response diff --git a/Packs/SymantecEndpointProtection/ReleaseNotes/1_1_16.md b/Packs/SymantecEndpointProtection/ReleaseNotes/1_1_16.md new file mode 100644 index 000000000000..6df545ad242d --- /dev/null +++ b/Packs/SymantecEndpointProtection/ReleaseNotes/1_1_16.md @@ -0,0 +1,5 @@ +#### Integrations + +##### Symantec Endpoint Protection v2 +- Code functionality improvements. +- Updated the Docker image to: *demisto/python3:3.11.10.116949*. \ No newline at end of file diff --git a/Packs/SymantecEndpointProtection/pack_metadata.json b/Packs/SymantecEndpointProtection/pack_metadata.json index 18fecedb49d6..a0165a287b34 100644 --- a/Packs/SymantecEndpointProtection/pack_metadata.json +++ b/Packs/SymantecEndpointProtection/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Symantec Endpoint Protection", "description": "Query the Symantec Endpoint Protection Manager using the official REST API.", "support": "xsoar", - "currentVersion": "1.1.15", + "currentVersion": "1.1.16", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", diff --git a/Packs/Symantec_Messaging_Gateway/Integrations/SymantecMessagingGateway/SymantecMessagingGateway.py b/Packs/Symantec_Messaging_Gateway/Integrations/SymantecMessagingGateway/SymantecMessagingGateway.py index 8315168e9cd5..dc8587bc32b2 100644 --- a/Packs/Symantec_Messaging_Gateway/Integrations/SymantecMessagingGateway/SymantecMessagingGateway.py +++ b/Packs/Symantec_Messaging_Gateway/Integrations/SymantecMessagingGateway/SymantecMessagingGateway.py @@ -50,6 +50,7 @@ def login(): soup = BeautifulSoup(login_do_response.text, "lxml") hidden_tags = soup.find_all("input", type="hidden") # Parse + last_login = "" for tag in hidden_tags: name = tag.attrs.get('name', None) if name == 'lastlogin': @@ -57,6 +58,7 @@ def login(): cookies = { 'JSESSIONID': login_jsession } + demisto.debug(f"{last_login=}") data = { 'lastlogin': last_login, 'username': USERNAME, diff --git a/Packs/Symantec_Messaging_Gateway/ReleaseNotes/1_0_19.md b/Packs/Symantec_Messaging_Gateway/ReleaseNotes/1_0_19.md new file mode 100644 index 000000000000..92e474f16dff --- /dev/null +++ b/Packs/Symantec_Messaging_Gateway/ReleaseNotes/1_0_19.md @@ -0,0 +1,4 @@ +#### Integrations + +##### Symantec Messaging Gateway +Code functionality improvements. \ No newline at end of file diff --git a/Packs/Symantec_Messaging_Gateway/pack_metadata.json b/Packs/Symantec_Messaging_Gateway/pack_metadata.json index 5bb89c5d2bd7..ea82fdcc318d 100644 --- a/Packs/Symantec_Messaging_Gateway/pack_metadata.json +++ b/Packs/Symantec_Messaging_Gateway/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Symantec Messaging Gateway", "description": "Symantec Messaging Gateway protects against spam, malware, and targeted attacks and provides advanced content filtering, data loss prevention, and email encryption.", "support": "xsoar", - "currentVersion": "1.0.18", + "currentVersion": "1.0.19", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", diff --git a/Packs/Synapse/Integrations/Synapse/Synapse.py b/Packs/Synapse/Integrations/Synapse/Synapse.py index be18b0ecb965..441694dd08d1 100644 --- a/Packs/Synapse/Integrations/Synapse/Synapse.py +++ b/Packs/Synapse/Integrations/Synapse/Synapse.py @@ -31,7 +31,7 @@ def __init__(self, base_url, username, password, proxy, **kwargs): self.proxy = proxy self.auth = (username, password) self.aio_auth = aiohttp.BasicAuth(username, password) - super(Client, self).__init__(base_url, **kwargs) + super().__init__(base_url, **kwargs) def _check_for_error(self, resp): """ @@ -164,7 +164,7 @@ async def synapse_get_nodes(self, data, limit=100): address = urljoin(self._base_url, '/storm') query = {'query': my_query} async with sess.get(address, json=query, auth=self.aio_auth) as resp: - async for byts, x in resp.content.iter_chunks(): + async for byts, _x in resp.content.iter_chunks(): if not byts: break mesg = json.loads(byts) @@ -214,13 +214,13 @@ def get_full_tags_helper(data): """ tags = [] - temp_tags = [t for t in data.keys()] + temp_tags = list(data.keys()) if temp_tags: tags.append(temp_tags.pop(0)) else: return tags - for i in range(0, len(temp_tags)): + for _i in range(0, len(temp_tags)): if temp_tags: temp = temp_tags.pop(0) else: @@ -258,8 +258,8 @@ def model_query_helper(model, query): Returns properties for given node type. Raises error not found if not present. """ parsed_data = {'query': query} - mod_types = [t for t in model['types'].keys()] - mod_forms = [f for f in model['forms'].keys()] + mod_types = list(model['types'].keys()) + mod_forms = list(model['forms'].keys()) if (query not in mod_types) and (query not in mod_forms): raise Exception(f'Error: Query "{query}" not found in model. Try adjusting syntax (i.e. "inet:ipv4").') @@ -613,7 +613,7 @@ def storm_query_command(client, args): if len(nodes) == 1: name_single = 'Synapse Node Properties' - headers_single = [h for h in data[0][1]['props'].keys()] + headers_single = list(data[0][1]['props'].keys()) readable_output += tableToMarkdown(name_single, data[0][1]['props'], headers=headers_single, removeNull=False) results = CommandResults( @@ -819,7 +819,7 @@ def query_model_command(client, args): if full_resp.get('Form'): name_form = f'Synapse `{full_resp.get("Valu")}` Form Properties' - headers_form = [h for h in q_form['Properties'].keys()] + headers_form = list(q_form['Properties'].keys()) readable_output += tableToMarkdown(name_form, q_form['Properties'], headers=headers_form, removeNull=False) results = CommandResults( diff --git a/Packs/Synapse/Integrations/Synapse/Synapse.yml b/Packs/Synapse/Integrations/Synapse/Synapse.yml index 37ffb5afe19a..c1bc5874204e 100644 --- a/Packs/Synapse/Integrations/Synapse/Synapse.yml +++ b/Packs/Synapse/Integrations/Synapse/Synapse.yml @@ -421,7 +421,7 @@ script: - contextPath: Synapse.Model.Valu description: The given value of the Synapse object type. type: String - dockerimage: demisto/py3-tools:1.0.0.114656 + dockerimage: demisto/py3-tools:1.0.0.117220 runonce: false script: '-' subtype: python3 diff --git a/Packs/Synapse/Integrations/Synapse/Synapse_test.py b/Packs/Synapse/Integrations/Synapse/Synapse_test.py index 41f5c60cbad2..7205fae5dbc6 100644 --- a/Packs/Synapse/Integrations/Synapse/Synapse_test.py +++ b/Packs/Synapse/Integrations/Synapse/Synapse_test.py @@ -1,14 +1,13 @@ import json -import io def util_load_json(path): - with io.open(path, mode='r', encoding='utf-8') as f: + with open(path, encoding='utf-8') as f: return json.loads(f.read()) def util_load_bytes(path): - with io.open(path, mode='r') as f: + with open(path) as f: return f.read() diff --git a/Packs/Synapse/ReleaseNotes/1_0_9.md b/Packs/Synapse/ReleaseNotes/1_0_9.md new file mode 100644 index 000000000000..f9cbe4e7c2e7 --- /dev/null +++ b/Packs/Synapse/ReleaseNotes/1_0_9.md @@ -0,0 +1,5 @@ +#### Integrations + +##### Synapse +- Code functionality improvements. +- Updated the Docker image to: *demisto/py3-tools:1.0.0.117220*. \ No newline at end of file diff --git a/Packs/Synapse/pack_metadata.json b/Packs/Synapse/pack_metadata.json index 128ccaba43f1..3013952dc4d5 100644 --- a/Packs/Synapse/pack_metadata.json +++ b/Packs/Synapse/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Synapse", "description": "Vertex Synapse intelligence analysis framework.", "support": "community", - "currentVersion": "1.0.8", + "currentVersion": "1.0.9", "author": "Jordan Berry", "url": "", "email": "", diff --git a/Packs/SysAid/Integrations/SysAid/SysAid.py b/Packs/SysAid/Integrations/SysAid/SysAid.py index 02ba007f541e..d4cb442d3622 100644 --- a/Packs/SysAid/Integrations/SysAid/SysAid.py +++ b/Packs/SysAid/Integrations/SysAid/SysAid.py @@ -9,7 +9,8 @@ import requests -from typing import Dict, Any, Tuple, Callable +from typing import Any +from collections.abc import Callable # Disable insecure warnings urllib3.disable_warnings() @@ -109,7 +110,7 @@ def user_search_request(self, query: str, fields: str = None, record_type: str = return response def service_record_list_request(self, record_type: str, fields: str = None, offset: int = None, limit: int = None, - ids: List[str] = None, archive: int = None, filters: Dict[str, Any] = None, ): + ids: List[str] = None, archive: int = None, filters: dict[str, Any] = None, ): params = assign_params(type=record_type, fields=fields, offset=offset, limit=limit, ids=ids, archive=archive) params.update(filters or {}) response = self._http_request('GET', 'sr', params=params, cookies=self._cookies) @@ -117,7 +118,7 @@ def service_record_list_request(self, record_type: str, fields: str = None, offs return response def service_record_search_request(self, record_type: str, query: str, fields: str = None, offset: int = None, - limit: int = None, archive: int = None, filters: Dict[str, Any] = None): + limit: int = None, archive: int = None, filters: dict[str, Any] = None): params = assign_params(type=record_type, fields=fields, offset=offset, limit=limit, query=query, archive=archive) params.update(filters) @@ -125,7 +126,7 @@ def service_record_search_request(self, record_type: str, query: str, fields: st return response - def service_record_update_request(self, id_: str, info: List[Dict[str, str]] = None): + def service_record_update_request(self, id_: str, info: List[dict[str, str]] = None): data = {"id": id_, "info": info} response = self._http_request('PUT', f'sr/{id_}', json_data=data, cookies=self._cookies, resp_type='response') @@ -148,7 +149,7 @@ def service_record_template_get_request(self, record_type: str, fields: str = No return response - def service_record_create_request(self, record_type: str, info: List[Dict[str, str]], fields: str = None, + def service_record_create_request(self, record_type: str, info: List[dict[str, str]], fields: str = None, template_id: str = None): params = assign_params(fields=fields, type=record_type, template=template_id) data = {"info": info} @@ -223,7 +224,7 @@ def service_record_add_note_request(self, sr_id: str, note: str, username: str): ''' HELPER FUNCTIONS ''' -def read_file(file_id: str) -> Tuple[bytes, int, str]: +def read_file(file_id: str) -> tuple[bytes, int, str]: """ Reads file that was uploaded to War Room. @@ -261,7 +262,7 @@ def get_content_type(file_name: str): def create_readable_response(responses: Union[dict, List[dict], str], handle_one_response: Callable, remove_if_null: str = None) \ - -> Union[str, List[Dict[str, str]]]: + -> Union[str, List[dict[str, str]]]: """ Creates a readable response for responses that have fields in the form of: { @@ -293,7 +294,7 @@ def create_readable_response(responses: Union[dict, List[dict], str], handle_one return readable_response -def asset_list_handler(response: Dict[str, Any], remove_if_null: str): +def asset_list_handler(response: dict[str, Any], remove_if_null: str): """ Creates a readable response for one asset response. Is sent as **handle_one_response** to *create_readable_response*. @@ -311,7 +312,7 @@ def asset_list_handler(response: Dict[str, Any], remove_if_null: str): return response_entry -def filter_list_handler(response: Dict[str, Any]): +def filter_list_handler(response: dict[str, Any]): """ Creates a readable response for one filter response. Is sent as **handle_one_response** to *create_readable_response*. @@ -327,7 +328,7 @@ def filter_list_handler(response: Dict[str, Any]): return response_entry -def service_record_handler(response: Dict[str, Any]): +def service_record_handler(response: dict[str, Any]): """ Creates a readable response for one service record response. Is sent as **handle_one_response** to *create_readable_response*. @@ -346,7 +347,7 @@ def service_record_handler(response: Dict[str, Any]): return None -def service_record_response_handler(response: Dict[str, Any]): +def service_record_response_handler(response: dict[str, Any]): """ Creates a response for one service record response. Is sent as **handle_one_response** to *create_readable_response*. Saves all fields with their key names. @@ -359,7 +360,7 @@ def service_record_response_handler(response: Dict[str, Any]): return response -def extract_filters(custom_fields_keys: List[str], custom_fields_values: List[str]) -> Dict[str, Any]: +def extract_filters(custom_fields_keys: List[str], custom_fields_values: List[str]) -> dict[str, Any]: """ Additional filters are sent in a request in a form of: {filter1}={filter1_value}&{filter2}={filter2_value} @@ -371,7 +372,7 @@ def extract_filters(custom_fields_keys: List[str], custom_fields_values: List[st return filters -def set_service_record_info(args: Dict[str, Any]) -> List[Dict[str, str]]: +def set_service_record_info(args: dict[str, Any]) -> List[dict[str, str]]: """ Update and create service record commands have many arguments, this function organizes the arguments in the form they need to appear in the body of the request. @@ -391,7 +392,7 @@ def set_service_record_info(args: Dict[str, Any]) -> List[Dict[str, str]]: return info -def template_readable_response(responses: Union[dict, List[dict], str]) -> Union[str, List[Dict[str, Any]]]: +def template_readable_response(responses: Union[dict, List[dict], str]) -> Union[str, List[dict[str, Any]]]: """ Creates a readable response for responses that have fields in the form of: { @@ -474,8 +475,8 @@ def fetch_request(client: Client, fetch_types: str = None, include_archived: boo return responses -def filter_service_records_by_time(service_records: List[Dict[str, Any]], fetch_start_datetime: datetime) \ - -> List[Dict[str, Any]]: +def filter_service_records_by_time(service_records: List[dict[str, Any]], fetch_start_datetime: datetime) \ + -> List[dict[str, Any]]: """ Returns the service records that changed after the fetch_start_datetime, from the service_records given. @@ -491,15 +492,15 @@ def filter_service_records_by_time(service_records: List[Dict[str, Any]], fetch_ return filtered_service_records -def filter_service_records_by_id(service_records: List[Dict[str, Any]], fetch_start_datetime: datetime, last_id_fetched: str): +def filter_service_records_by_id(service_records: List[dict[str, Any]], fetch_start_datetime: datetime, last_id_fetched: str): # only for service_records with the same update_time as fetch_start_datetime return [service_record for service_record in service_records if get_service_record_update_time(service_record) != fetch_start_datetime or service_record['id'] > last_id_fetched] -def reduce_service_records_to_limit(service_records: List[Dict[str, Any]], limit: int, last_fetch: datetime, - last_id_fetched: str) -> Tuple[datetime, str, List[Dict[str, Any]]]: +def reduce_service_records_to_limit(service_records: List[dict[str, Any]], limit: int, last_fetch: datetime, + last_id_fetched: str) -> tuple[datetime, str, List[dict[str, Any]]]: incidents_count = min(limit, len(service_records)) # limit can't be 0 or less, but there could be no service_records at the wanted time if incidents_count > 0: @@ -510,8 +511,8 @@ def reduce_service_records_to_limit(service_records: List[Dict[str, Any]], limit return last_fetch, last_id_fetched, service_records -def parse_service_records(service_records: List[Dict[str, Any]], limit: int, fetch_start_datetime: datetime, - last_id_fetched: str) -> Tuple[datetime, str, List[Dict[str, Any]]]: +def parse_service_records(service_records: List[dict[str, Any]], limit: int, fetch_start_datetime: datetime, + last_id_fetched: str) -> tuple[datetime, str, List[dict[str, Any]]]: service_records = filter_service_records_by_time(service_records, fetch_start_datetime) service_records = filter_service_records_by_id(service_records, fetch_start_datetime, last_id_fetched) @@ -521,7 +522,7 @@ def parse_service_records(service_records: List[Dict[str, Any]], limit: int, fet last_fetch, last_id_fetched, service_records = reduce_service_records_to_limit(service_records, limit, fetch_start_datetime, last_id_fetched) - incidents: List[Dict[str, Any]] = [service_record_to_incident_context(service_record) for service_record in service_records] + incidents: List[dict[str, Any]] = [service_record_to_incident_context(service_record) for service_record in service_records] return last_fetch, last_id_fetched, incidents @@ -538,7 +539,7 @@ def calculate_fetch_start_datetime(last_fetch: str, first_fetch: str): return max(last_fetch_datetime, first_fetch_datetime) -def get_service_record_update_time(service_record: Dict[str, Any]) -> Optional[datetime]: +def get_service_record_update_time(service_record: dict[str, Any]) -> Optional[datetime]: for service_record_info in service_record['info']: if service_record_info['key'] == 'update_time': # We are using 'valueCaption' and not 'value' as they hold different values @@ -549,7 +550,7 @@ def get_service_record_update_time(service_record: Dict[str, Any]) -> Optional[d return None -def service_record_to_incident_context(service_record: Dict[str, Any]): +def service_record_to_incident_context(service_record: dict[str, Any]): title, record_type = '', '' for service_record_info in service_record['info']: if service_record_info['key'] == 'sr_type': @@ -558,8 +559,7 @@ def service_record_to_incident_context(service_record: Dict[str, Any]): title = service_record_info['valueCaption'] occurred_datetime = get_service_record_update_time(service_record) - if occurred_datetime: - occurred = occurred_datetime.strftime(DATE_FORMAT) + occurred = occurred_datetime.strftime(DATE_FORMAT) if occurred_datetime else None incident_context = { 'name': title, @@ -575,7 +575,7 @@ def service_record_to_incident_context(service_record: Dict[str, Any]): ''' COMMAND FUNCTIONS ''' -def table_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def table_list_command(client: Client, args: dict[str, Any]) -> CommandResults: entity = args.get('entity') entity_id = args.get('entity_id') entity_type = arg_to_number(args.get('entity_type')) @@ -603,7 +603,7 @@ def table_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: return command_results -def asset_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def asset_list_command(client: Client, args: dict[str, Any]) -> CommandResults: asset_id = args.get('asset_id') fields = set_returned_fields(args.get('fields')) @@ -635,7 +635,7 @@ def asset_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: return command_results -def asset_search_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def asset_search_command(client: Client, args: dict[str, Any]) -> CommandResults: query = args.get('query') fields = set_returned_fields(args.get('fields')) @@ -661,7 +661,7 @@ def asset_search_command(client: Client, args: Dict[str, Any]) -> CommandResults return command_results -def filter_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def filter_list_command(client: Client, args: dict[str, Any]) -> CommandResults: fields = set_returned_fields(args.get('fields')) response = client.filter_list_request(fields) @@ -682,7 +682,7 @@ def filter_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: return command_results -def user_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def user_list_command(client: Client, args: dict[str, Any]) -> CommandResults: fields = set_returned_fields(args.get('fields')) record_type = args.get('type') @@ -706,7 +706,7 @@ def user_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: return command_results -def user_search_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def user_search_command(client: Client, args: dict[str, Any]) -> CommandResults: query = args.get('query') fields = set_returned_fields(args.get('fields')) record_type = args.get('type') @@ -731,7 +731,7 @@ def user_search_command(client: Client, args: Dict[str, Any]) -> CommandResults: return command_results -def service_record_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_list_command(client: Client, args: dict[str, Any]) -> CommandResults: record_type = args.get('type') fields = set_returned_fields(args.get('fields')) ids = args.get('ids') @@ -768,7 +768,7 @@ def service_record_list_command(client: Client, args: Dict[str, Any]) -> Command return command_results -def service_record_search_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_search_command(client: Client, args: dict[str, Any]) -> CommandResults: query = args.get('query') record_type = args.get('type') fields = set_returned_fields(args.get('fields')) @@ -801,7 +801,7 @@ def service_record_search_command(client: Client, args: Dict[str, Any]) -> Comma return command_results -def service_record_update_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_update_command(client: Client, args: dict[str, Any]) -> CommandResults: id_ = args.get('id') info = set_service_record_info(args) @@ -818,7 +818,7 @@ def service_record_update_command(client: Client, args: Dict[str, Any]) -> Comma return command_results -def service_record_close_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_close_command(client: Client, args: dict[str, Any]) -> CommandResults: id_ = args.get('id') solution = args.get('solution') @@ -837,7 +837,7 @@ def service_record_close_command(client: Client, args: Dict[str, Any]) -> Comman return command_results -def service_record_template_get_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_template_get_command(client: Client, args: dict[str, Any]) -> CommandResults: fields = set_returned_fields(args.get('fields')) record_type = args.get('type') template_id = args.get('template_id') @@ -859,7 +859,7 @@ def service_record_template_get_command(client: Client, args: Dict[str, Any]) -> return command_results -def service_record_create_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_create_command(client: Client, args: dict[str, Any]) -> CommandResults: fields = set_returned_fields(args.get('fields')) record_type = args.get('type') template_id = args.get('template_id') @@ -885,7 +885,7 @@ def service_record_create_command(client: Client, args: Dict[str, Any]) -> Comma return command_results -def service_record_delete_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_delete_command(client: Client, args: dict[str, Any]) -> CommandResults: ids = str(args.get('ids')) solution = args.get('solution') @@ -904,7 +904,7 @@ def service_record_delete_command(client: Client, args: Dict[str, Any]) -> Comma return command_results -def service_record_attach_file_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_attach_file_command(client: Client, args: dict[str, Any]) -> CommandResults: sr_id = str(args.get('id')) file_id = str(args.get('file_id')) @@ -922,7 +922,7 @@ def service_record_attach_file_command(client: Client, args: Dict[str, Any]) -> return command_results -def service_record_get_file_command(client: Client, args: Dict[str, Any]): +def service_record_get_file_command(client: Client, args: dict[str, Any]): sr_id = str(args.get('id')) file_id = str(args.get('file_id')) file_name = str(args.get('file_name')) @@ -941,7 +941,7 @@ def service_record_get_file_command(client: Client, args: Dict[str, Any]): return_error(msg) -def service_record_delete_file_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_delete_file_command(client: Client, args: dict[str, Any]) -> CommandResults: sr_id = str(args.get('id')) file_id = str(args.get('file_id')) @@ -959,7 +959,7 @@ def service_record_delete_file_command(client: Client, args: Dict[str, Any]) -> return command_results -def service_record_get_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_get_command(client: Client, args: dict[str, Any]) -> CommandResults: sr_id = str(args.get('id')) fields = set_returned_fields(args.get('fields')) @@ -982,7 +982,7 @@ def service_record_get_command(client: Client, args: Dict[str, Any]) -> CommandR return command_results -def service_record_add_note_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def service_record_add_note_command(client: Client, args: dict[str, Any]) -> CommandResults: sr_id = str(args.get('id')) note = str(args.get('note')) username = str(args.get('username')) @@ -1053,8 +1053,8 @@ def test_module(client: Client, params: dict) -> None: def main() -> None: - params: Dict[str, Any] = demisto.params() - args: Dict[str, Any] = demisto.args() + params: dict[str, Any] = demisto.params() + args: dict[str, Any] = demisto.args() url = params.get('url') verify_certificate: bool = not params.get('insecure', False) proxy = params.get('proxy', False) diff --git a/Packs/SysAid/Integrations/SysAid/SysAid.yml b/Packs/SysAid/Integrations/SysAid/SysAid.yml index 025990f1bf0e..d77e7967ddfd 100644 --- a/Packs/SysAid/Integrations/SysAid/SysAid.yml +++ b/Packs/SysAid/Integrations/SysAid/SysAid.yml @@ -696,7 +696,7 @@ script: script: '-' type: python subtype: python3 - dockerimage: demisto/python3:3.11.10.115186 + dockerimage: demisto/python3:3.11.10.116949 fromversion: 6.0.0 defaultclassifier: SysAid Classifier defaultmapperin: SysAid Mapper diff --git a/Packs/SysAid/ReleaseNotes/1_0_17.md b/Packs/SysAid/ReleaseNotes/1_0_17.md new file mode 100644 index 000000000000..b4ccca912e42 --- /dev/null +++ b/Packs/SysAid/ReleaseNotes/1_0_17.md @@ -0,0 +1,5 @@ +#### Integrations + +##### SysAid +- Code functionality improvements. +- Updated the Docker image to: *demisto/python3:3.11.10.116949*. \ No newline at end of file diff --git a/Packs/SysAid/pack_metadata.json b/Packs/SysAid/pack_metadata.json index 5ce29a887e31..94b2db751f4a 100644 --- a/Packs/SysAid/pack_metadata.json +++ b/Packs/SysAid/pack_metadata.json @@ -2,7 +2,7 @@ "name": "SysAid", "description": "SysAid is a robust IT management system that was designed to meet all of your needs as an IT department.", "support": "xsoar", - "currentVersion": "1.0.16", + "currentVersion": "1.0.17", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",