From 6b45d62d813066ab690b954b439f9e38392284cb Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Tue, 21 Jun 2022 15:31:38 -0700 Subject: [PATCH] Island: Fix logic to remove metadata from config in new configuration resource's POST --- monkey/monkey_island/cc/resources/configuration.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/resources/configuration.py b/monkey/monkey_island/cc/resources/configuration.py index 2ec3c095a..2ed567561 100644 --- a/monkey/monkey_island/cc/resources/configuration.py +++ b/monkey/monkey_island/cc/resources/configuration.py @@ -58,12 +58,10 @@ class AgentConfiguration(AbstractResource): ).form_response() @staticmethod - # Q: why is this really needed? besides the fact that it just doesn't belong in the config - # which is being saved in mongo? if nothing, can't we just wait to change the exploiters - # to plugins? def _remove_metadata_from_config(configuration_json: Mapping): for exploiter in chain( configuration_json["propagation"]["exploitation"]["brute_force"], configuration_json["propagation"]["exploitation"]["vulnerability"], ): - del exploiter["supported_os"] + if "supported_os" in exploiter: + del exploiter["supported_os"]