diff --git a/monkey/common/config_value_paths.py b/monkey/common/config_value_paths.py index db10fb9e1..c998f44fa 100644 --- a/monkey/common/config_value_paths.py +++ b/monkey/common/config_value_paths.py @@ -1,5 +1,4 @@ AWS_KEYS_PATH = ["internal", "monkey", "aws_keys"] -STARTED_ON_ISLAND_PATH = ["internal", "general", "started_on_island"] EXPORT_MONKEY_TELEMS_PATH = ["internal", "testing", "export_monkey_telems"] CURRENT_SERVER_PATH = ["internal", "island_server", "current_server"] SSH_KEYS_PATH = ["internal", "exploits", "exploit_ssh_keys"] diff --git a/monkey/infection_monkey/config.py b/monkey/infection_monkey/config.py index 8f4984ba6..557ecdf0f 100644 --- a/monkey/infection_monkey/config.py +++ b/monkey/infection_monkey/config.py @@ -112,7 +112,6 @@ class Configuration(object): # depth of propagation depth = 2 max_depth = None - started_on_island = False current_server = "" # Configuration servers to try to connect to, in this order. @@ -232,8 +231,5 @@ class Configuration(object): ########################### export_monkey_telems = False - def get_hop_distance_to_island(self): - return self.max_depth - self.depth - WormConfiguration = Configuration() diff --git a/monkey/infection_monkey/control.py b/monkey/infection_monkey/control.py index 71e1fb8f0..c4b4b9555 100644 --- a/monkey/infection_monkey/control.py +++ b/monkey/infection_monkey/control.py @@ -401,12 +401,3 @@ class ControlClient(object): ) except requests.exceptions.RequestException: return False - - @staticmethod - def report_start_on_island(): - requests.post( # noqa: DUO123 - f"https://{WormConfiguration.current_server}/api/monkey_control/started_on_island", - data=json.dumps({"started_on_island": True}), - verify=False, - timeout=MEDIUM_REQUEST_TIMEOUT, - ) diff --git a/monkey/monkey_island/cc/app.py b/monkey/monkey_island/cc/app.py index ce223bda4..e90091168 100644 --- a/monkey/monkey_island/cc/app.py +++ b/monkey/monkey_island/cc/app.py @@ -8,11 +8,7 @@ from werkzeug.exceptions import NotFound from common.common_consts.api_url_consts import T1216_PBA_FILE_DOWNLOAD_PATH from monkey_island.cc.database import database, mongo -from monkey_island.cc.resources.agent_controls import ( - StartedOnIsland, - StopAgentCheck, - StopAllAgents, -) +from monkey_island.cc.resources.agent_controls import StopAgentCheck, StopAllAgents from monkey_island.cc.resources.attack.attack_report import AttackReport from monkey_island.cc.resources.auth.auth import Authenticate, init_jwt from monkey_island.cc.resources.auth.registration import Registration @@ -172,7 +168,6 @@ def init_api_resources(api): api.add_resource(PropagationCredentials, "/api/propagation-credentials/") api.add_resource(RemoteRun, "/api/remote-monkey") api.add_resource(VersionUpdate, "/api/version-update") - api.add_resource(StartedOnIsland, "/api/monkey_control/started_on_island") api.add_resource(StopAgentCheck, "/api/monkey_control/needs-to-stop/") api.add_resource(StopAllAgents, "/api/monkey_control/stop-all-agents") api.add_resource(ScoutSuiteAuth, "/api/scoutsuite_auth/") diff --git a/monkey/monkey_island/cc/resources/agent_controls/__init__.py b/monkey/monkey_island/cc/resources/agent_controls/__init__.py index c4f63322f..211696e4c 100644 --- a/monkey/monkey_island/cc/resources/agent_controls/__init__.py +++ b/monkey/monkey_island/cc/resources/agent_controls/__init__.py @@ -1,3 +1,2 @@ from .stop_all_agents import StopAllAgents -from .started_on_island import StartedOnIsland from .stop_agent_check import StopAgentCheck diff --git a/monkey/monkey_island/cc/resources/agent_controls/started_on_island.py b/monkey/monkey_island/cc/resources/agent_controls/started_on_island.py deleted file mode 100644 index f0d7e411f..000000000 --- a/monkey/monkey_island/cc/resources/agent_controls/started_on_island.py +++ /dev/null @@ -1,16 +0,0 @@ -import json - -import flask_restful -from flask import make_response, request - -from monkey_island.cc.services.config import ConfigService - - -class StartedOnIsland(flask_restful.Resource): - - # Used by monkey. can't secure. - def post(self): - data = json.loads(request.data) - if data["started_on_island"]: - ConfigService.set_started_on_island(True) - return make_response({}, 200) diff --git a/monkey/monkey_island/cc/services/config.py b/monkey/monkey_island/cc/services/config.py index af9c0a155..1daec8a76 100644 --- a/monkey/monkey_island/cc/services/config.py +++ b/monkey/monkey_island/cc/services/config.py @@ -15,7 +15,6 @@ from common.config_value_paths import ( PBA_LINUX_FILENAME_PATH, PBA_WINDOWS_FILENAME_PATH, SSH_KEYS_PATH, - STARTED_ON_ISLAND_PATH, USER_LIST_PATH, ) from monkey_island.cc.database import mongo @@ -405,10 +404,6 @@ class ConfigService: def is_test_telem_export_enabled(): return ConfigService.get_config_value(EXPORT_MONKEY_TELEMS_PATH) - @staticmethod - def set_started_on_island(value: bool): - ConfigService.set_config_value(STARTED_ON_ISLAND_PATH, value) - @staticmethod def get_config_propagation_credentials_from_flat_config(config): return { diff --git a/monkey/monkey_island/cc/services/config_schema/internal.py b/monkey/monkey_island/cc/services/config_schema/internal.py index 86318eaf1..a145233f9 100644 --- a/monkey/monkey_island/cc/services/config_schema/internal.py +++ b/monkey/monkey_island/cc/services/config_schema/internal.py @@ -15,13 +15,6 @@ INTERNAL = { "description": "Time to keep tunnel open before going down after last exploit " "(in seconds)", }, - "started_on_island": { - "title": "Started on island", - "type": "boolean", - "default": False, - "description": "Was exploitation started from island" - "(did monkey with max depth ran on island)", - }, }, }, "monkey": { diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js index 36053ef22..cd24fc040 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js @@ -117,9 +117,6 @@ export default function UiSchema(props) { other_behaviors : {'ui:widget': 'hidden'} }, internal: { - general: { - started_on_island: {'ui:widget': 'hidden'} - }, classes: { finger_classes: { classNames: 'config-template-no-header', 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 972f9e947..8f024b9b9 100644 --- a/monkey/tests/data_for_tests/monkey_configs/flat_config.json +++ b/monkey/tests/data_for_tests/monkey_configs/flat_config.json @@ -101,7 +101,6 @@ "skip_exploit_if_file_exist": false, "smb_download_timeout": 300, "smb_service_name": "InfectionMonkey", - "started_on_island": false, "subnet_scan_list": [], "system_info_collector_classes": [ "AwsCollector", diff --git a/monkey/tests/data_for_tests/monkey_configs/monkey_config_standard.json b/monkey/tests/data_for_tests/monkey_configs/monkey_config_standard.json index 112d649d8..ba16a75ae 100644 --- a/monkey/tests/data_for_tests/monkey_configs/monkey_config_standard.json +++ b/monkey/tests/data_for_tests/monkey_configs/monkey_config_standard.json @@ -44,8 +44,7 @@ }, "internal": { "general": { - "keep_tunnel_open_time": 60, - "started_on_island": false + "keep_tunnel_open_time": 60 }, "monkey": { "victims_max_find": 100,