From fcfbef995b8c24843768ff5f98b45217a1276526 Mon Sep 17 00:00:00 2001 From: Ace Pace Date: Sun, 12 Apr 2020 15:02:28 +0300 Subject: [PATCH] Brute force fix for #613 --- monkey/infection_monkey/telemetry/base_telem.py | 8 ++++++-- monkey/infection_monkey/telemetry/system_info_telem.py | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/telemetry/base_telem.py b/monkey/infection_monkey/telemetry/base_telem.py index 2d59b9cbf..da63353fc 100644 --- a/monkey/infection_monkey/telemetry/base_telem.py +++ b/monkey/infection_monkey/telemetry/base_telem.py @@ -17,12 +17,16 @@ class BaseTelem(object, metaclass=abc.ABCMeta): def __init__(self): pass - def send(self): + def send(self, display_data=True): """ Sends telemetry to island """ data = self.get_data() - logger.debug("Sending {} telemetry. Data: {}".format(self.telem_category, json.dumps(data))) + if display_data: + data_to_display = json.dumps(data) + else: + data_to_display = 'redacted' + logger.debug("Sending {} telemetry. Data: {}".format(self.telem_category, data_to_display)) ControlClient.send_telemetry(self.telem_category, data) @property diff --git a/monkey/infection_monkey/telemetry/system_info_telem.py b/monkey/infection_monkey/telemetry/system_info_telem.py index a4b1c0bd0..b0e7d779a 100644 --- a/monkey/infection_monkey/telemetry/system_info_telem.py +++ b/monkey/infection_monkey/telemetry/system_info_telem.py @@ -17,3 +17,6 @@ class SystemInfoTelem(BaseTelem): def get_data(self): return self.system_info + + def send(self, display_data=False): + super(SystemInfoTelem, self).send(False)