forked from p15670423/monkey
Merge pull request #1645 from guardicore/1635-remove-should_monkey_run-config-field
Remove started_on_island config field
This commit is contained in:
commit
1c76ea20f2
|
@ -1,5 +1,4 @@
|
||||||
AWS_KEYS_PATH = ["internal", "monkey", "aws_keys"]
|
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"]
|
EXPORT_MONKEY_TELEMS_PATH = ["internal", "testing", "export_monkey_telems"]
|
||||||
CURRENT_SERVER_PATH = ["internal", "island_server", "current_server"]
|
CURRENT_SERVER_PATH = ["internal", "island_server", "current_server"]
|
||||||
SSH_KEYS_PATH = ["internal", "exploits", "exploit_ssh_keys"]
|
SSH_KEYS_PATH = ["internal", "exploits", "exploit_ssh_keys"]
|
||||||
|
|
|
@ -112,7 +112,6 @@ class Configuration(object):
|
||||||
# depth of propagation
|
# depth of propagation
|
||||||
depth = 2
|
depth = 2
|
||||||
max_depth = None
|
max_depth = None
|
||||||
started_on_island = False
|
|
||||||
current_server = ""
|
current_server = ""
|
||||||
|
|
||||||
# Configuration servers to try to connect to, in this order.
|
# Configuration servers to try to connect to, in this order.
|
||||||
|
@ -232,8 +231,5 @@ class Configuration(object):
|
||||||
###########################
|
###########################
|
||||||
export_monkey_telems = False
|
export_monkey_telems = False
|
||||||
|
|
||||||
def get_hop_distance_to_island(self):
|
|
||||||
return self.max_depth - self.depth
|
|
||||||
|
|
||||||
|
|
||||||
WormConfiguration = Configuration()
|
WormConfiguration = Configuration()
|
||||||
|
|
|
@ -401,12 +401,3 @@ class ControlClient(object):
|
||||||
)
|
)
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
return False
|
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,
|
|
||||||
)
|
|
||||||
|
|
|
@ -8,11 +8,7 @@ from werkzeug.exceptions import NotFound
|
||||||
|
|
||||||
from common.common_consts.api_url_consts import T1216_PBA_FILE_DOWNLOAD_PATH
|
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.database import database, mongo
|
||||||
from monkey_island.cc.resources.agent_controls import (
|
from monkey_island.cc.resources.agent_controls import StopAgentCheck, StopAllAgents
|
||||||
StartedOnIsland,
|
|
||||||
StopAgentCheck,
|
|
||||||
StopAllAgents,
|
|
||||||
)
|
|
||||||
from monkey_island.cc.resources.attack.attack_report import AttackReport
|
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.auth import Authenticate, init_jwt
|
||||||
from monkey_island.cc.resources.auth.registration import Registration
|
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/<string:guid>")
|
api.add_resource(PropagationCredentials, "/api/propagation-credentials/<string:guid>")
|
||||||
api.add_resource(RemoteRun, "/api/remote-monkey")
|
api.add_resource(RemoteRun, "/api/remote-monkey")
|
||||||
api.add_resource(VersionUpdate, "/api/version-update")
|
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/<int:monkey_guid>")
|
api.add_resource(StopAgentCheck, "/api/monkey_control/needs-to-stop/<int:monkey_guid>")
|
||||||
api.add_resource(StopAllAgents, "/api/monkey_control/stop-all-agents")
|
api.add_resource(StopAllAgents, "/api/monkey_control/stop-all-agents")
|
||||||
api.add_resource(ScoutSuiteAuth, "/api/scoutsuite_auth/<string:provider>")
|
api.add_resource(ScoutSuiteAuth, "/api/scoutsuite_auth/<string:provider>")
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
from .stop_all_agents import StopAllAgents
|
from .stop_all_agents import StopAllAgents
|
||||||
from .started_on_island import StartedOnIsland
|
|
||||||
from .stop_agent_check import StopAgentCheck
|
from .stop_agent_check import StopAgentCheck
|
||||||
|
|
|
@ -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)
|
|
|
@ -15,7 +15,6 @@ from common.config_value_paths import (
|
||||||
PBA_LINUX_FILENAME_PATH,
|
PBA_LINUX_FILENAME_PATH,
|
||||||
PBA_WINDOWS_FILENAME_PATH,
|
PBA_WINDOWS_FILENAME_PATH,
|
||||||
SSH_KEYS_PATH,
|
SSH_KEYS_PATH,
|
||||||
STARTED_ON_ISLAND_PATH,
|
|
||||||
USER_LIST_PATH,
|
USER_LIST_PATH,
|
||||||
)
|
)
|
||||||
from monkey_island.cc.database import mongo
|
from monkey_island.cc.database import mongo
|
||||||
|
@ -405,10 +404,6 @@ class ConfigService:
|
||||||
def is_test_telem_export_enabled():
|
def is_test_telem_export_enabled():
|
||||||
return ConfigService.get_config_value(EXPORT_MONKEY_TELEMS_PATH)
|
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
|
@staticmethod
|
||||||
def get_config_propagation_credentials_from_flat_config(config):
|
def get_config_propagation_credentials_from_flat_config(config):
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -15,13 +15,6 @@ INTERNAL = {
|
||||||
"description": "Time to keep tunnel open before going down after last exploit "
|
"description": "Time to keep tunnel open before going down after last exploit "
|
||||||
"(in seconds)",
|
"(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": {
|
"monkey": {
|
||||||
|
|
|
@ -117,9 +117,6 @@ export default function UiSchema(props) {
|
||||||
other_behaviors : {'ui:widget': 'hidden'}
|
other_behaviors : {'ui:widget': 'hidden'}
|
||||||
},
|
},
|
||||||
internal: {
|
internal: {
|
||||||
general: {
|
|
||||||
started_on_island: {'ui:widget': 'hidden'}
|
|
||||||
},
|
|
||||||
classes: {
|
classes: {
|
||||||
finger_classes: {
|
finger_classes: {
|
||||||
classNames: 'config-template-no-header',
|
classNames: 'config-template-no-header',
|
||||||
|
|
|
@ -101,7 +101,6 @@
|
||||||
"skip_exploit_if_file_exist": false,
|
"skip_exploit_if_file_exist": false,
|
||||||
"smb_download_timeout": 300,
|
"smb_download_timeout": 300,
|
||||||
"smb_service_name": "InfectionMonkey",
|
"smb_service_name": "InfectionMonkey",
|
||||||
"started_on_island": false,
|
|
||||||
"subnet_scan_list": [],
|
"subnet_scan_list": [],
|
||||||
"system_info_collector_classes": [
|
"system_info_collector_classes": [
|
||||||
"AwsCollector",
|
"AwsCollector",
|
||||||
|
|
|
@ -44,8 +44,7 @@
|
||||||
},
|
},
|
||||||
"internal": {
|
"internal": {
|
||||||
"general": {
|
"general": {
|
||||||
"keep_tunnel_open_time": 60,
|
"keep_tunnel_open_time": 60
|
||||||
"started_on_island": false
|
|
||||||
},
|
},
|
||||||
"monkey": {
|
"monkey": {
|
||||||
"victims_max_find": 100,
|
"victims_max_find": 100,
|
||||||
|
|
Loading…
Reference in New Issue