diff --git a/CHANGES b/CHANGES index 28fb539..5209749 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1.19.7 +------ +- Removed validating optional directories in endpoint scans + 1.19.6 ------ - Add InvalidUrlError diff --git a/intezer_sdk/__init__.py b/intezer_sdk/__init__.py index 7a1a040..2fba467 100644 --- a/intezer_sdk/__init__.py +++ b/intezer_sdk/__init__.py @@ -1 +1 @@ -__version__ = '1.19.6' +__version__ = '1.19.7' diff --git a/intezer_sdk/endpoint_analysis.py b/intezer_sdk/endpoint_analysis.py index 5628b6e..cb6ac5a 100644 --- a/intezer_sdk/endpoint_analysis.py +++ b/intezer_sdk/endpoint_analysis.py @@ -126,10 +126,6 @@ def _send_analyze_to_api(self, **additional_parameters) -> str: raise ValueError('Scan directory does not exist') if not os.path.isdir(self._files_dir): raise ValueError('Files directory does not exist') - if not os.path.isdir(self._fileless_dir): - raise ValueError('Fileless directory does not exist') - if not os.path.isdir(self._memory_modules_dir): - raise ValueError('Memory modules directory does not exist') self._scan_id, self.analysis_id = self._create_scan() @@ -212,7 +208,7 @@ def _send_loaded_modules_info(self): def _send_files_info_and_upload_required(self): logger.info(f'Endpoint analysis: {self.analysis_id}, uploading files info and uploading required files') with concurrent.futures.ThreadPoolExecutor() as executor: - for files_info_file in glob.glob(os.path.join(self._offline_scan_directory, 'files_info_*.json')): + for files_info_file in glob.glob(os.path.join(self._offline_scan_directory, 'files_info*.json')): logger.debug(f'Endpoint analysis: {self.analysis_id}, uploading {files_info_file}') with open(files_info_file, encoding='utf-8') as f: @@ -233,13 +229,19 @@ def _send_files_info_and_upload_required(self): def _send_module_differences(self): logger.info(f'Endpoint analysis: {self.analysis_id}, uploading file module differences info') - with open(os.path.join(self._offline_scan_directory, 'file_module_differences.json'), encoding='utf-8') as f: + path = os.path.join(self._offline_scan_directory, 'file_module_differences.json') + if not os.path.isfile(path): + return + with open(path, encoding='utf-8') as f: file_module_differences = json.load(f) self._scan_api.send_file_module_differences(file_module_differences) def _send_injected_modules_info(self): logger.info(f'Endpoint analysis: {self.analysis_id}, uploading injected modules info') - with open(os.path.join(self._offline_scan_directory, 'injected_modules_info.json'), encoding='utf-8') as f: + path = os.path.join(self._offline_scan_directory, 'injected_modules_info.json') + if not os.path.isfile(path): + return + with open(path, encoding='utf-8') as f: injected_modules_info = json.load(f) self._scan_api.send_injected_modules_info(injected_modules_info) @@ -247,7 +249,7 @@ def _send_memory_module_dump_info_and_upload_required(self): logger.info(f'Endpoint analysis: {self.analysis_id}, uploading memory module dump info') with concurrent.futures.ThreadPoolExecutor() as executor: for memory_module_dump_info_file in glob.glob(os.path.join(self._offline_scan_directory, - 'memory_module_dump_info_*.json')): + 'memory_module_dump_info*.json')): logger.debug(f'Endpoint analysis: {self.analysis_id}, uploading {memory_module_dump_info_file}') with open(memory_module_dump_info_file, encoding='utf-8') as f: