From 33ec4f7ae963a43c8e977f9bf7729a09a17a24ab Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 24 Jun 2022 15:16:43 -0400 Subject: [PATCH] Agent: Log configuration when it's received from the Island --- monkey/infection_monkey/master/control_channel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/master/control_channel.py b/monkey/infection_monkey/master/control_channel.py index c83942f5d..d68f42bda 100644 --- a/monkey/infection_monkey/master/control_channel.py +++ b/monkey/infection_monkey/master/control_channel.py @@ -1,5 +1,6 @@ import json import logging +from pprint import pformat from typing import Mapping import requests @@ -58,7 +59,10 @@ class ControlChannel(IControlChannel): ) response.raise_for_status() - return AgentConfiguration.from_mapping(json.loads(response.text)["config"]) + config_dict = json.loads(response.text)["config"] + logger.debug(f"Received configuration:\n{pformat(json.loads(response.text))}") + + return AgentConfiguration.from_mapping(config_dict) except ( json.JSONDecodeError, requests.exceptions.ConnectionError,