diff --git a/monkey/infection_monkey/ransomware/ransomware_payload.py b/monkey/infection_monkey/ransomware/ransomware_payload.py index 1027b5def..d252db389 100644 --- a/monkey/infection_monkey/ransomware/ransomware_payload.py +++ b/monkey/infection_monkey/ransomware/ransomware_payload.py @@ -21,8 +21,8 @@ README_DEST = "README.txt" class RansomwarePayload: def __init__(self, config: dict, telemetry_messenger: ITelemetryMessenger): - self.should_encrypt = config["encryption"]["should_encrypt"] - LOG.info(f"Encryption routine for ransomware simulation enabled: {self.should_encrypt}") + self.encryption_enabled = config["encryption"]["enabled"] + LOG.info(f"Encryption routine for ransomware simulation enabled: {self.encryption_enabled}") target_directories = config["encryption"]["directories"] LOG.info( @@ -47,7 +47,7 @@ class RansomwarePayload: self._telemetry_messenger = telemetry_messenger def run_payload(self): - if self.should_encrypt: + if self.encryption_enabled: LOG.info("Running ransomware payload") file_list = self._find_files() self._encrypt_files(file_list) diff --git a/monkey/monkey_island/cc/services/config_schema/ransomware.py b/monkey/monkey_island/cc/services/config_schema/ransomware.py index 17475d019..50f23f162 100644 --- a/monkey/monkey_island/cc/services/config_schema/ransomware.py +++ b/monkey/monkey_island/cc/services/config_schema/ransomware.py @@ -6,7 +6,7 @@ RANSOMWARE = { "title": "Encryption", "type": "object", "properties": { - "should_encrypt": { + "enabled": { "title": "Encrypt files", "type": "boolean", "default": True, 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 d5c48e815..d5b2fae57 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 @@ -33,7 +33,7 @@ def with_extension(filename): def ransomware_payload_config(ransomware_target): return { "encryption": { - "should_encrypt": True, + "enabled": True, "directories": { "linux_dir": str(ransomware_target), "windows_dir": str(ransomware_target), @@ -136,7 +136,7 @@ def test_skip_already_encrypted_file(ransomware_target, ransomware_payload): def test_encryption_skipped_if_configured_false( ransomware_payload_config, ransomware_target, telemetry_messenger_spy ): - ransomware_payload_config["encryption"]["should_encrypt"] = False + ransomware_payload_config["encryption"]["enabled"] = False ransomware_payload = RansomwarePayload(ransomware_payload_config, telemetry_messenger_spy) ransomware_payload.run_payload()