diff --git a/monkey/infection_monkey/system_info/collectors/scoutsuite_collector.py b/monkey/infection_monkey/system_info/collectors/scout_suite_collector.py similarity index 74% rename from monkey/infection_monkey/system_info/collectors/scoutsuite_collector.py rename to monkey/infection_monkey/system_info/collectors/scout_suite_collector.py index 38c6d7c0f..09adf94e4 100644 --- a/monkey/infection_monkey/system_info/collectors/scoutsuite_collector.py +++ b/monkey/infection_monkey/system_info/collectors/scout_suite_collector.py @@ -1,4 +1,5 @@ import logging +import tempfile from common.cloud.environment_names import Environment from common.data.system_info_collectors_names import SCOUTSUITE_COLLECTOR @@ -15,12 +16,20 @@ class ScoutSuiteCollector(SystemInfoCollector): def collect(self) -> dict: env = get_monkey_environment() + env = "AWS" if env == Environment.ON_PREMISE.value: logger.info("Monkey is not on cloud; not running ScoutSuite") return {} else: - logger.info(f"Attempting to execute ScoutSuite with {env.lower()}") - scout_suite_results = run(env.lower(), debug=True, quiet=False) + tmp_dir_path = tempfile.mkdtemp() + logger.info(f"Attempting to execute ScoutSuite with {env.lower()}, saving results in {tmp_dir_path}") + + scout_suite_results = run( + env.lower(), + debug=True, + quiet=False, + no_browser=True, + report_dir=tmp_dir_path) return { "Environment": env, "Results": scout_suite_results diff --git a/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/scoutsuite.py b/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/scoutsuite.py index 85d053e47..c0a2517f2 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/scoutsuite.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/scoutsuite.py @@ -6,4 +6,4 @@ logger = logging.getLogger(__name__) def process_scout_suite_telemetry(collector_results, monkey_guid): # Monkey.get_single_monkey_by_guid(monkey_guid).set_hostname(collector_results["hostname"]) - logger.info(f"\n\n{json.dumps(collector_results, indent=2)}\n{monkey_guid}") + logger.info(f"ScoutSuite results:\n{json.dumps(collector_results, indent=2)}")