From 946641f9a25a6e9b6786b8518bec6c8c39dfc5e8 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 30 Jun 2021 07:29:53 -0400 Subject: [PATCH] Rename {windows,linux}_dir to *_target_dir for consistency --- .../infection_monkey/ransomware/ransomware_payload.py | 10 ++++++---- .../cc/services/config_schema/ransomware.py | 4 ++-- .../ransomware/test_ransomware_payload.py | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/monkey/infection_monkey/ransomware/ransomware_payload.py b/monkey/infection_monkey/ransomware/ransomware_payload.py index 6486fb4d8..13e8015d6 100644 --- a/monkey/infection_monkey/ransomware/ransomware_payload.py +++ b/monkey/infection_monkey/ransomware/ransomware_payload.py @@ -28,14 +28,16 @@ class RansomwarePayload: target_directories = config["encryption"]["directories"] LOG.info( - f"Windows dir configured for encryption is \"{target_directories['windows_dir']}\"" + "Windows dir configured for encryption is " + target_directories["windows_target_dir"] + ) + LOG.info( + f"Linux dir configured for encryption is \"{target_directories['linux_target_dir']}\"" ) - LOG.info(f"Linux dir configured for encryption is \"{target_directories['linux_dir']}\"") self._target_dir = ( - target_directories["windows_dir"] + target_directories["windows_target_dir"] if is_windows_os() - else target_directories["linux_dir"] + else target_directories["linux_target_dir"] ) self._readme_enabled = config["other_behaviors"]["readme"] diff --git a/monkey/monkey_island/cc/services/config_schema/ransomware.py b/monkey/monkey_island/cc/services/config_schema/ransomware.py index fbc2e485e..c30c1a392 100644 --- a/monkey/monkey_island/cc/services/config_schema/ransomware.py +++ b/monkey/monkey_island/cc/services/config_schema/ransomware.py @@ -17,7 +17,7 @@ RANSOMWARE = { "title": "Directories to encrypt", "type": "object", "properties": { - "linux_dir": { + "linux_target_dir": { "title": "Linux target directory", "type": "string", "default": "", @@ -25,7 +25,7 @@ RANSOMWARE = { "used to safely simulate the encryption behavior of ransomware. If no " "directory is specified, no files will be encrypted.", }, - "windows_dir": { + "windows_target_dir": { "title": "Windows target directory", "type": "string", "default": "", 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 d5b2fae57..36dc6615e 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 @@ -35,8 +35,8 @@ def ransomware_payload_config(ransomware_target): "encryption": { "enabled": True, "directories": { - "linux_dir": str(ransomware_target), - "windows_dir": str(ransomware_target), + "linux_target_dir": str(ransomware_target), + "windows_target_dir": str(ransomware_target), }, }, "other_behaviors": {"readme": False},