diff --git a/monkey/common/config_value_paths.py b/monkey/common/config_value_paths.py index c998f44fa..8f43960e0 100644 --- a/monkey/common/config_value_paths.py +++ b/monkey/common/config_value_paths.py @@ -10,5 +10,7 @@ SUBNET_SCAN_LIST_PATH = ["basic_network", "scope", "subnet_scan_list"] LOCAL_NETWORK_SCAN_PATH = ["basic_network", "scope", "local_network_scan"] LM_HASH_LIST_PATH = ["internal", "exploits", "exploit_lm_hash_list"] NTLM_HASH_LIST_PATH = ["internal", "exploits", "exploit_ntlm_hash_list"] -PBA_LINUX_FILENAME_PATH = ["monkey", "post_breach", "PBA_linux_filename"] -PBA_WINDOWS_FILENAME_PATH = ["monkey", "post_breach", "PBA_windows_filename"] + +# TODO: These are tuples so that they are immutable. Make the rest of these paths touples as well. +PBA_LINUX_FILENAME_PATH = ("monkey", "post_breach", "PBA_linux_filename") +PBA_WINDOWS_FILENAME_PATH = ("monkey", "post_breach", "PBA_windows_filename") diff --git a/monkey/monkey_island/cc/resources/pba_file_upload.py b/monkey/monkey_island/cc/resources/pba_file_upload.py index 2a27b324a..153c3774b 100644 --- a/monkey/monkey_island/cc/resources/pba_file_upload.py +++ b/monkey/monkey_island/cc/resources/pba_file_upload.py @@ -1,4 +1,3 @@ -import copy import logging from http import HTTPStatus @@ -43,10 +42,9 @@ class FileUpload(flask_restful.Resource): # Verify that file_name is indeed a file from config if target_os == LINUX_PBA_TYPE: - # TODO: Make these paths Tuples so we don't need to copy them - filename = ConfigService.get_config_value(copy.deepcopy(PBA_LINUX_FILENAME_PATH)) + filename = ConfigService.get_config_value(PBA_LINUX_FILENAME_PATH) else: - filename = ConfigService.get_config_value(copy.deepcopy(PBA_WINDOWS_FILENAME_PATH)) + filename = ConfigService.get_config_value(PBA_WINDOWS_FILENAME_PATH) try: file = self._file_storage_service.open_file(filename)