diff --git a/Packs/ApiModules/Scripts/CrowdStrikeApiModule/CrowdStrikeApiModule.py b/Packs/ApiModules/Scripts/CrowdStrikeApiModule/CrowdStrikeApiModule.py index 9bfb501e175c..3aa45e6bf809 100644 --- a/Packs/ApiModules/Scripts/CrowdStrikeApiModule/CrowdStrikeApiModule.py +++ b/Packs/ApiModules/Scripts/CrowdStrikeApiModule/CrowdStrikeApiModule.py @@ -52,7 +52,7 @@ def _error_handler(res: requests.Response): raise DemistoException(err_msg) def http_request(self, method, url_suffix, full_url=None, headers=None, json_data=None, params=None, data=None, - files=None, timeout=10, ok_codes=None, return_empty_response=False, auth=None): + files=None, timeout=10, ok_codes=None, return_empty_response=False, auth=None, resp_type='json'): """A wrapper for requests lib to send our requests and handle requests and responses better. :type method: ``str`` @@ -107,7 +107,7 @@ def http_request(self, method, url_suffix, full_url=None, headers=None, json_dat return super()._http_request(method=method, url_suffix=url_suffix, full_url=full_url, headers=headers, json_data=json_data, params=params, data=data, files=files, timeout=req_timeout, ok_codes=ok_codes, return_empty_response=return_empty_response, auth=auth, - error_handler=self._error_handler) + error_handler=self._error_handler, resp_type=resp_type) def _get_token(self, force_gen_new_token=False): """ diff --git a/Packs/CrowdStrikeOpenAPI/Integrations/CrowdStrikeOpenAPI/CrowdStrikeOpenAPI.py b/Packs/CrowdStrikeOpenAPI/Integrations/CrowdStrikeOpenAPI/CrowdStrikeOpenAPI.py index b7ef027045f6..09257062c3ae 100644 --- a/Packs/CrowdStrikeOpenAPI/Integrations/CrowdStrikeOpenAPI/CrowdStrikeOpenAPI.py +++ b/Packs/CrowdStrikeOpenAPI/Integrations/CrowdStrikeOpenAPI/CrowdStrikeOpenAPI.py @@ -840,7 +840,8 @@ def download_sensor_installer_by_id_request(self, id_): headers = self.cs_client._headers - response = self.cs_client.http_request('get', 'sensors/entities/download-installer/v1', params=params, headers=headers) + response = self.cs_client.http_request('get', 'sensors/entities/download-installer/v1', params=params, headers=headers, + resp_type='response') return response @@ -4985,16 +4986,15 @@ def devices_ran_on_command(client, args): def download_sensor_installer_by_id_command(client, args): id_ = str(args.get('id_', '')) - response = client.download_sensor_installer_by_id_request(id_) - command_results = CommandResults( - outputs_prefix='CrowdStrike.domainDownloadItem', - outputs_key_field='', - outputs=response, - raw_response=response - ) + data = response.content + try: + file_name = response.headers.get('Content-Disposition').split('attachment; filename=')[1] + except Exception as err: + demisto.debug(f'Failed extracting filename from response headers - [{str(err)}]') + file_name = f'cs_installer-id-{id_}' - return command_results + return fileResult(filename=file_name, data=data, file_type=EntryType.FILE) def entitiesprocesses_command(client, args): diff --git a/Packs/CrowdStrikeOpenAPI/Integrations/CrowdStrikeOpenAPI/CrowdStrikeOpenAPI.yml b/Packs/CrowdStrikeOpenAPI/Integrations/CrowdStrikeOpenAPI/CrowdStrikeOpenAPI.yml index 2fa048e6f7ea..0c4ec898ace1 100644 --- a/Packs/CrowdStrikeOpenAPI/Integrations/CrowdStrikeOpenAPI/CrowdStrikeOpenAPI.yml +++ b/Packs/CrowdStrikeOpenAPI/Integrations/CrowdStrikeOpenAPI/CrowdStrikeOpenAPI.yml @@ -27274,7 +27274,7 @@ script: - contextPath: CrowdStrike.deviceNetworkHistory.resources.history.timestamp description: '' type: String - dockerimage: demisto/python3:3.10.11.54132 + dockerimage: demisto/python3:3.10.12.63474 feed: false isfetch: false longRunning: false diff --git a/Packs/CrowdStrikeOpenAPI/ReleaseNotes/1_0_16.md b/Packs/CrowdStrikeOpenAPI/ReleaseNotes/1_0_16.md new file mode 100644 index 000000000000..1fbf830056e8 --- /dev/null +++ b/Packs/CrowdStrikeOpenAPI/ReleaseNotes/1_0_16.md @@ -0,0 +1,5 @@ + +#### Integrations +##### CrowdStrike OpenAPI (Beta) +- Fixed an issue where the ***cs-download-sensor-installer-by-id*** command failed. +- Updated the Docker image to: *demisto/python3:3.10.12.63474*. \ No newline at end of file diff --git a/Packs/CrowdStrikeOpenAPI/pack_metadata.json b/Packs/CrowdStrikeOpenAPI/pack_metadata.json index c9cbcbc056c0..a0630de37c4f 100644 --- a/Packs/CrowdStrikeOpenAPI/pack_metadata.json +++ b/Packs/CrowdStrikeOpenAPI/pack_metadata.json @@ -2,7 +2,7 @@ "name": "CrowdStrike OpenAPI", "description": "Use the CrowdStrike OpenAPI integration to interact with CrowdStrike APIs that do not have dedicated integrations in Cortex XSOAR, for example, CrowdStrike FalconX, etc.", "support": "xsoar", - "currentVersion": "1.0.15", + "currentVersion": "1.0.16", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",