diff --git a/monkey/infection_monkey/ransomware/ransomware_payload.py b/monkey/infection_monkey/ransomware/ransomware_payload.py index 49525902b..f46c5ae72 100644 --- a/monkey/infection_monkey/ransomware/ransomware_payload.py +++ b/monkey/infection_monkey/ransomware/ransomware_payload.py @@ -17,10 +17,17 @@ CHUNK_SIZE = 4096 * 24 class RansomewarePayload: def __init__(self, config: dict, telemetry_messenger: ITelemetryMessenger): - LOG.info(f"Windows dir configured for encryption is \"{config['windows_dir']}\"") - LOG.info(f"Linux dir configured for encryption is \"{config['linux_dir']}\"") + target_directories = config["directories"] + LOG.info( + f"Windows dir configured for encryption is \"{target_directories['windows_dir']}\"" + ) + LOG.info(f"Linux dir configured for encryption is \"{target_directories['linux_dir']}\"") - self._target_dir = config["windows_dir"] if is_windows_os() else config["linux_dir"] + self._target_dir = ( + target_directories["windows_dir"] + if is_windows_os() + else target_directories["linux_dir"] + ) self._new_file_extension = EXTENSION self._valid_file_extensions_for_encryption = VALID_FILE_EXTENSIONS_FOR_ENCRYPTION.copy() diff --git a/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py b/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py index 138c60004..35aef048c 100644 --- a/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py +++ b/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py @@ -41,7 +41,9 @@ def with_extension(filename): @pytest.fixture def ransomware_payload_config(ransomware_target): - return {"linux_dir": str(ransomware_target), "windows_dir": str(ransomware_target)} + return { + "directories": {"linux_dir": str(ransomware_target), "windows_dir": str(ransomware_target)} + } @pytest.fixture