From 594d2155980a6557850879244b1550a54bbf7bd7 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 2 Jun 2022 15:34:58 +0530 Subject: [PATCH] Island: Rename resource MonkeyDownload to AgentBinaries --- monkey/monkey_island/cc/app.py | 4 ++-- .../cc/resources/{monkey_download.py => agent_binaries.py} | 2 +- monkey/monkey_island/cc/server_setup.py | 4 ++-- monkey/monkey_island/cc/services/run_local_monkey.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename monkey/monkey_island/cc/resources/{monkey_download.py => agent_binaries.py} (98%) diff --git a/monkey/monkey_island/cc/app.py b/monkey/monkey_island/cc/app.py index 138e73625..0d21ca928 100644 --- a/monkey/monkey_island/cc/app.py +++ b/monkey/monkey_island/cc/app.py @@ -12,6 +12,7 @@ from common import DIContainer from monkey_island.cc.database import database, mongo from monkey_island.cc.resources import RemoteRun from monkey_island.cc.resources.AbstractResource import AbstractResource +from monkey_island.cc.resources.agent_binaries import AgentBinaries 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 @@ -33,7 +34,6 @@ from monkey_island.cc.resources.island_mode import IslandMode from monkey_island.cc.resources.local_run import LocalRun from monkey_island.cc.resources.log import Log from monkey_island.cc.resources.monkey import Monkey -from monkey_island.cc.resources.monkey_download import MonkeyDownload from monkey_island.cc.resources.netmap import NetMap from monkey_island.cc.resources.node import Node from monkey_island.cc.resources.node_states import NodeStates @@ -155,7 +155,7 @@ def init_api_resources(api: FlaskDIWrapper): api.add_resource(IslandConfiguration) api.add_resource(ConfigurationExport) api.add_resource(ConfigurationImport) - api.add_resource(MonkeyDownload) + api.add_resource(AgentBinaries) api.add_resource(NetMap) api.add_resource(Edge) api.add_resource(Node) diff --git a/monkey/monkey_island/cc/resources/monkey_download.py b/monkey/monkey_island/cc/resources/agent_binaries.py similarity index 98% rename from monkey/monkey_island/cc/resources/monkey_download.py rename to monkey/monkey_island/cc/resources/agent_binaries.py index 3ecceaf5c..2f70bdb70 100644 --- a/monkey/monkey_island/cc/resources/monkey_download.py +++ b/monkey/monkey_island/cc/resources/agent_binaries.py @@ -19,7 +19,7 @@ class UnsupportedOSError(Exception): pass -class MonkeyDownload(AbstractResource): +class AgentBinaries(AbstractResource): # API Spec: Rename to /api/agent-binaries, because information about agent runs # and binary files are different resources urls = ["/api/agent/download/"] diff --git a/monkey/monkey_island/cc/server_setup.py b/monkey/monkey_island/cc/server_setup.py index 8b1e56015..fdd222bc5 100644 --- a/monkey/monkey_island/cc/server_setup.py +++ b/monkey/monkey_island/cc/server_setup.py @@ -21,7 +21,7 @@ from common.version import get_version # noqa: E402 from monkey_island.cc.app import init_app # noqa: E402 from monkey_island.cc.arg_parser import IslandCmdArgs # noqa: E402 from monkey_island.cc.arg_parser import parse_cli_args # noqa: E402 -from monkey_island.cc.resources.monkey_download import MonkeyDownload # noqa: E402 +from monkey_island.cc.resources.agent_binaries import AgentBinaries # noqa: E402 from monkey_island.cc.server_utils.consts import ( # noqa: E402 GEVENT_EXCEPTION_LOG, MONGO_CONNECTION_TIMEOUT, @@ -154,7 +154,7 @@ def _start_island_server( def _log_init_info(): - MonkeyDownload.log_executable_hashes() + AgentBinaries.log_executable_hashes() logger.info("Monkey Island Server is running!") logger.info(f"version: {get_version()}") diff --git a/monkey/monkey_island/cc/services/run_local_monkey.py b/monkey/monkey_island/cc/services/run_local_monkey.py index a1ae3f6e3..1f022c0e4 100644 --- a/monkey/monkey_island/cc/services/run_local_monkey.py +++ b/monkey/monkey_island/cc/services/run_local_monkey.py @@ -6,7 +6,7 @@ import subprocess from pathlib import Path from shutil import copyfile -from monkey_island.cc.resources.monkey_download import get_agent_executable_path +from monkey_island.cc.resources.agent_binaries import get_agent_executable_path from monkey_island.cc.server_utils.consts import ISLAND_PORT from monkey_island.cc.services.utils.network_utils import local_ip_addresses