From 851296d5faf5ec1ce7f15e8004490de616f40d14 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 27 Jun 2022 09:09:07 -0400 Subject: [PATCH] UT: Remove disused automated_master_config --- .../automated_master_config.json | 107 ------------------ .../unit_tests/infection_monkey/conftest.py | 5 - .../master/test_automated_master.py | 4 +- 3 files changed, 2 insertions(+), 114 deletions(-) delete mode 100644 monkey/tests/data_for_tests/monkey_configs/automated_master_config.json diff --git a/monkey/tests/data_for_tests/monkey_configs/automated_master_config.json b/monkey/tests/data_for_tests/monkey_configs/automated_master_config.json deleted file mode 100644 index c0c035b9d..000000000 --- a/monkey/tests/data_for_tests/monkey_configs/automated_master_config.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "config": { - "propagation": { - "network_scan": { - "tcp": { - "timeout_ms": 3000, - "ports": [ - 22, - 2222, - 445, - 135, - 3389, - 80, - 8080, - 443, - 8008, - 3306, - 7001, - 8088, - 9200 - ] - }, - "icmp": { - "timeout_ms": 1000 - }, - "fingerprinters": [ - "SMBFinger", - "SSHFinger", - "HTTPFinger", - "MySQLFinger", - "MSSQLFinger", - "ElasticFinger" - ] - }, - "targets": { - "blocked_ips": ["192.168.1.1", "192.168.1.100"], - "inaccessible_subnets": ["10.0.0.0/24", "10.0.10.0/24"], - "local_network_scan": true, - "subnet_scan_list": [ - "192.168.1.50", - "192.168.56.0/24", - "10.0.33.0/30", - "10.0.0.1", - "10.0.0.2" - ] - }, - "exploiters": { - "options": {}, - "brute_force": [ - {"name": "MSSQLExploiter", "options": {}}, - {"name": "PowerShellExploiter", "options": {}}, - {"name": "SmbExploiter", "options": {}}, - {"name": "SSHExploiter", "options": {}}, - {"name": "WmiExploiter", "options": {}} - ], - "vulnerability": [ - {"name": "HadoopExploiter", "options": {}}, - {"name": "ShellShockExploiter", "options": {}}, - {"name": "ZerologonExploiter", "options": {}} - ] - } - }, - "PBA_linux_filename": "", - "PBA_windows_filename": "", - "custom_pbas": { - "linux_command": "", - "windows_command": "" - }, - "depth": 2, - "exploit_lm_hash_list": ["DEADBEEF", "FACADE"], - "exploit_ntlm_hash_list": ["BEADED", "ACCEDE", "DECADE"], - "exploit_password_list": ["p1", "p2", "p3"], - "exploit_ssh_keys": "hidden", - "exploit_user_list": ["u1", "u2", "u3"], - "exploiter_classes": [], - "max_depth": 2, - "post_breach_actions": { - "CommunicateAsBackdoorUser": {}, - "ModifyShellStartupFiles": {}, - "HiddenFiles": {}, - "TrapCommand": {}, - "ChangeSetuidSetgid": {}, - "ScheduleJobs": {}, - "Timestomping": {}, - "AccountDiscovery": {}, - "Custom": { - "linux_command": "chmod u+x my_exec && ./my_exec", - "windows_cmd": "powershell test_driver.ps1", - "linux_filename": "my_exec", - "windows_filename": "test_driver.ps1" - } - }, - "payloads": { - "ransomware": { - "encryption": { - "directories": {"linux_target_dir": "", "windows_target_dir": ""}, - "enabled": true - }, - "other_behaviors": {"readme": true} - } - }, - "credential_collectors": [ - "MimikatzCollector", - "SSHCollector" - ] - } -} diff --git a/monkey/tests/unit_tests/infection_monkey/conftest.py b/monkey/tests/unit_tests/infection_monkey/conftest.py index 14a193112..533572f98 100644 --- a/monkey/tests/unit_tests/infection_monkey/conftest.py +++ b/monkey/tests/unit_tests/infection_monkey/conftest.py @@ -15,8 +15,3 @@ class TelemetryMessengerSpy(ITelemetryMessenger): @pytest.fixture def telemetry_messenger_spy(): return TelemetryMessengerSpy() - - -@pytest.fixture -def automated_master_config(load_monkey_config): - return load_monkey_config("automated_master_config.json") diff --git a/monkey/tests/unit_tests/infection_monkey/master/test_automated_master.py b/monkey/tests/unit_tests/infection_monkey/master/test_automated_master.py index cf0112d59..9029ce480 100644 --- a/monkey/tests/unit_tests/infection_monkey/master/test_automated_master.py +++ b/monkey/tests/unit_tests/infection_monkey/master/test_automated_master.py @@ -41,14 +41,14 @@ def test_stop_if_cant_get_config_from_island(monkeypatch): @pytest.fixture -def sleep_and_return_config(automated_master_config): +def sleep_and_return_config(default_agent_configuration): # Ensure that should_agent_stop times out before get_config() returns to prevent the # Propagator's sub-threads from hanging get_config_sleep_time = INTERVAL * (CHECK_FOR_STOP_AGENT_COUNT + 1) def _inner(): time.sleep(get_config_sleep_time) - return automated_master_config + return default_agent_configuration return _inner