diff --git a/monkey/monkey_island/cc/services/config.py b/monkey/monkey_island/cc/services/config.py index afc4742ba..87f949ce8 100644 --- a/monkey/monkey_island/cc/services/config.py +++ b/monkey/monkey_island/cc/services/config.py @@ -52,6 +52,8 @@ SENSITIVE_SSH_KEY_FIELDS = [ SensitiveField(path="public_key", field_encryptor=StringEncryptor), ] +SMB_DOWNLOAD_TIMEOUT = 30 + class ConfigService: default_config = None @@ -584,19 +586,19 @@ class ConfigService: config.pop(flat_config_exploiter_classes_field, None) formatted_exploiters_config = ConfigService._add_smb_download_timeout_to_exploiters( - config, formatted_exploiters_config + formatted_exploiters_config ) return ConfigService._add_supported_os_to_exploiters(formatted_exploiters_config) @staticmethod def _add_smb_download_timeout_to_exploiters( - flat_config: Dict, formatted_config: Dict + formatted_config: Dict, ) -> Dict[str, List[Dict[str, Any]]]: new_config = copy.deepcopy(formatted_config) uses_smb_timeout = {"SmbExploiter", "WmiExploiter"} for exploiter in filter(lambda e: e["name"] in uses_smb_timeout, new_config["brute_force"]): - exploiter["options"]["smb_download_timeout"] = flat_config["smb_download_timeout"] + exploiter["options"]["smb_download_timeout"] = SMB_DOWNLOAD_TIMEOUT return new_config diff --git a/monkey/monkey_island/cc/services/config_schema/internal.py b/monkey/monkey_island/cc/services/config_schema/internal.py index 906f7520f..9c28425f3 100644 --- a/monkey/monkey_island/cc/services/config_schema/internal.py +++ b/monkey/monkey_island/cc/services/config_schema/internal.py @@ -165,19 +165,6 @@ INTERNAL = { "items": {"type": "string"}, "description": "List of SSH key pairs to use, when trying to ssh into servers", }, - "smb_service": { - "title": "SMB service", - "type": "object", - "properties": { - "smb_download_timeout": { - "title": "SMB download timeout", - "type": "integer", - "default": 30, - "description": "Timeout (in seconds) for SMB download operation (used " - "in various exploits using SMB)", - }, - }, - }, }, }, "testing": { diff --git a/monkey/tests/data_for_tests/monkey_configs/flat_config.json b/monkey/tests/data_for_tests/monkey_configs/flat_config.json index c1b924439..18d849e16 100644 --- a/monkey/tests/data_for_tests/monkey_configs/flat_config.json +++ b/monkey/tests/data_for_tests/monkey_configs/flat_config.json @@ -82,7 +82,6 @@ "readme": true } }, - "smb_download_timeout": 300, "subnet_scan_list": ["192.168.1.50", "192.168.56.0/24", "10.0.33.0/30"], "system_info_collector_classes": [ "MimikatzCollector" diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/test_config.py b/monkey/tests/unit_tests/monkey_island/cc/services/test_config.py index 41c78cb8c..bc804c68a 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/services/test_config.py +++ b/monkey/tests/unit_tests/monkey_island/cc/services/test_config.py @@ -195,12 +195,12 @@ def test_format_config_for_agent__exploiters(): { "name": "SmbExploiter", "supported_os": ["windows"], - "options": {"smb_download_timeout": 300}, + "options": {"smb_download_timeout": 30}, }, { "name": "WmiExploiter", "supported_os": ["windows"], - "options": {"smb_download_timeout": 300}, + "options": {"smb_download_timeout": 30}, }, ], "vulnerability": [