From 672c19ef0d183c1395187140bbeb202342fecb71 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Fri, 2 Oct 2020 11:00:06 +0300 Subject: [PATCH] Fixed scoutsuite bug that caused bad exception handling --- monkey/common/cloud/scoutsuite | 2 +- monkey/infection_monkey/monkey.py | 2 +- .../collectors/scoutsuite_collector/scoutsuite_collector.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/common/cloud/scoutsuite b/monkey/common/cloud/scoutsuite index 6d7178d7a..b80659387 160000 --- a/monkey/common/cloud/scoutsuite +++ b/monkey/common/cloud/scoutsuite @@ -1 +1 @@ -Subproject commit 6d7178d7a1249024bea0ec20985f73aa35ab4809 +Subproject commit b806593875e7927f1b1b20cb5bc27da0025dbb51 diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 6b0e68dff..54fce9642 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -250,7 +250,7 @@ class InfectionMonkey(object): LOG.debug("Running with depth: %d" % WormConfiguration.depth) def collect_system_info_if_configured(self): - LOG.debug("Calling system info collection") + LOG.debug("Calling for system info collection") system_info_collector = SystemInfoCollector() system_info = system_info_collector.get_info() SystemInfoTelem(system_info).send() diff --git a/monkey/infection_monkey/system_info/collectors/scoutsuite_collector/scoutsuite_collector.py b/monkey/infection_monkey/system_info/collectors/scoutsuite_collector/scoutsuite_collector.py index 6965e53c7..06bdf91e8 100644 --- a/monkey/infection_monkey/system_info/collectors/scoutsuite_collector/scoutsuite_collector.py +++ b/monkey/infection_monkey/system_info/collectors/scoutsuite_collector/scoutsuite_collector.py @@ -11,7 +11,7 @@ logger = logging.getLogger(__name__) def scan_cloud_security(cloud_type: PROVIDERS): try: results = run_scoutsuite(cloud_type.value) - if 'error' in results and results['error']: + if isinstance(results, dict) and 'error' in results and results['error']: raise Exception(results['error']) send_results(results) except Exception as e: