From e730695407856305b2c06cb7572fcb5f75ab51c8 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 17 Jun 2022 13:11:30 -0400 Subject: [PATCH] Agent: Remove disused Configuration class --- monkey/infection_monkey/config.py | 55 ------------------------------- 1 file changed, 55 deletions(-) diff --git a/monkey/infection_monkey/config.py b/monkey/infection_monkey/config.py index 1b7b7f60f..5c48a4b1e 100644 --- a/monkey/infection_monkey/config.py +++ b/monkey/infection_monkey/config.py @@ -1,5 +1,4 @@ import uuid -from abc import ABCMeta GUID = str(uuid.getnode()) @@ -10,57 +9,3 @@ SENSITIVE_FIELDS = [ ] LOCAL_CONFIG_VARS = ["name", "id", "max_depth"] HIDDEN_FIELD_REPLACEMENT_CONTENT = "hidden" - - -class Configuration(object): - def from_kv(self, formatted_data): - for key, value in list(formatted_data.items()): - if key.startswith("_"): - continue - if key in LOCAL_CONFIG_VARS: - continue - if hasattr(self, key): - setattr(self, key, value) - if not self.max_depth: - self.max_depth = self.depth - - @staticmethod - def hide_sensitive_info(config_dict): - for field in SENSITIVE_FIELDS: - config_dict[field] = HIDDEN_FIELD_REPLACEMENT_CONTENT - return config_dict - - def as_dict(self): - result = {} - for key in dir(Configuration): - if key.startswith("_"): - continue - try: - value = getattr(self, key) - except AttributeError: - continue - - val_type = type(value) - - if callable(value): - continue - - if val_type in (type, ABCMeta): - value = value.__name__ - elif val_type is tuple or val_type is list: - if len(value) != 0 and type(value[0]) in (type, ABCMeta): - value = val_type([x.__name__ for x in value]) - - result[key] = value - - return result - - ########################### - # monkey config - ########################### - - # depth of propagation - depth = 2 - max_depth = None - - keep_tunnel_open_time = 30