Island: Make PBA_*_FILENAME_PATH tuples

This commit is contained in:
Mike Salvatore 2022-04-27 09:52:02 -04:00
parent 97300376ef
commit 08cd631c95
2 changed files with 6 additions and 6 deletions

View File

@ -10,5 +10,7 @@ SUBNET_SCAN_LIST_PATH = ["basic_network", "scope", "subnet_scan_list"]
LOCAL_NETWORK_SCAN_PATH = ["basic_network", "scope", "local_network_scan"] LOCAL_NETWORK_SCAN_PATH = ["basic_network", "scope", "local_network_scan"]
LM_HASH_LIST_PATH = ["internal", "exploits", "exploit_lm_hash_list"] LM_HASH_LIST_PATH = ["internal", "exploits", "exploit_lm_hash_list"]
NTLM_HASH_LIST_PATH = ["internal", "exploits", "exploit_ntlm_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")

View File

@ -1,4 +1,3 @@
import copy
import logging import logging
from http import HTTPStatus from http import HTTPStatus
@ -43,10 +42,9 @@ class FileUpload(flask_restful.Resource):
# Verify that file_name is indeed a file from config # Verify that file_name is indeed a file from config
if target_os == LINUX_PBA_TYPE: if target_os == LINUX_PBA_TYPE:
# TODO: Make these paths Tuples so we don't need to copy them filename = ConfigService.get_config_value(PBA_LINUX_FILENAME_PATH)
filename = ConfigService.get_config_value(copy.deepcopy(PBA_LINUX_FILENAME_PATH))
else: else:
filename = ConfigService.get_config_value(copy.deepcopy(PBA_WINDOWS_FILENAME_PATH)) filename = ConfigService.get_config_value(PBA_WINDOWS_FILENAME_PATH)
try: try:
file = self._file_storage_service.open_file(filename) file = self._file_storage_service.open_file(filename)