From 794ad6e5b0cba7ef33602bbbf8a1ace93bedf9c9 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 9 Jun 2022 15:17:37 -0700 Subject: [PATCH 1/4] Agent: Rename `credential_collector_classes` to `credential_collectors` --- monkey/infection_monkey/master/automated_master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/master/automated_master.py b/monkey/infection_monkey/master/automated_master.py index ac0429e1d..26de7227e 100644 --- a/monkey/infection_monkey/master/automated_master.py +++ b/monkey/infection_monkey/master/automated_master.py @@ -149,7 +149,7 @@ class AutomatedMaster(IMaster): target=self._run_plugins, name="CredentialCollectorThread", args=( - config["credential_collector_classes"], + config["credential_collectors"], "credential collector", self._collect_credentials, ), From 3368153507583646a5ad32ba934b0d934514cf7f Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 9 Jun 2022 15:18:38 -0700 Subject: [PATCH 2/4] Island: Rename `credential_collector_classes` to `credential_collectors` --- .../monkey_island/cc/services/config_schema/config_schema.py | 2 +- monkey/monkey_island/cc/services/config_schema/monkey.py | 4 ++-- .../cc/ui/src/components/configuration-components/UiSchema.js | 2 +- .../cc/ui/src/components/utils/SafeOptionValidator.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/monkey/monkey_island/cc/services/config_schema/config_schema.py b/monkey/monkey_island/cc/services/config_schema/config_schema.py index 2adefb455..7babfd1d3 100644 --- a/monkey/monkey_island/cc/services/config_schema/config_schema.py +++ b/monkey/monkey_island/cc/services/config_schema/config_schema.py @@ -20,7 +20,7 @@ SCHEMA = { # users will not accidentally chose unsafe options "definitions": { "exploiter_classes": EXPLOITER_CLASSES, - "credential_collector_classes": CREDENTIAL_COLLECTOR_CLASSES, + "credential_collectors": CREDENTIAL_COLLECTOR_CLASSES, "post_breach_actions": POST_BREACH_ACTIONS, "finger_classes": FINGER_CLASSES, }, diff --git a/monkey/monkey_island/cc/services/config_schema/monkey.py b/monkey/monkey_island/cc/services/config_schema/monkey.py index a9f9790f8..ed30a3c89 100644 --- a/monkey/monkey_island/cc/services/config_schema/monkey.py +++ b/monkey/monkey_island/cc/services/config_schema/monkey.py @@ -77,11 +77,11 @@ MONKEY = { "title": "Credential collection", "type": "object", "properties": { - "credential_collector_classes": { + "credential_collectors": { "title": "Credential collectors", "type": "array", "uniqueItems": True, - "items": {"$ref": "#/definitions/credential_collector_classes"}, + "items": {"$ref": "#/definitions/credential_collectors"}, "default": [ MIMIKATZ_COLLECTOR, SSH_COLLECTOR, diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js index c76d17fc2..632076921 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js @@ -95,7 +95,7 @@ export default function UiSchema(props) { } }, credential_collectors: { - credential_collector_classes: { + credential_collectors: { classNames: 'config-template-no-header', 'ui:widget': AdvancedMultiSelect } diff --git a/monkey/monkey_island/cc/ui/src/components/utils/SafeOptionValidator.js b/monkey/monkey_island/cc/ui/src/components/utils/SafeOptionValidator.js index 515ddfd9d..ac6702328 100644 --- a/monkey/monkey_island/cc/ui/src/components/utils/SafeOptionValidator.js +++ b/monkey/monkey_island/cc/ui/src/components/utils/SafeOptionValidator.js @@ -17,8 +17,8 @@ function getPluginDescriptors(schema, config) { }, { name: 'CredentialCollectors', - allPlugins: schema.definitions.credential_collector_classes.anyOf, - selectedPlugins: config.monkey.credential_collectors.credential_collector_classes + allPlugins: schema.definitions.credential_collectors.anyOf, + selectedPlugins: config.monkey.credential_collectors.credential_collectors } ]); } From 0ad5554dfa740c4f3f3b0aa23633f3b59225ae48 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 9 Jun 2022 15:19:07 -0700 Subject: [PATCH 3/4] UT: Rename `credential_collector_classes` to `credential_collectors` --- .../data_for_tests/monkey_configs/automated_master_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/tests/data_for_tests/monkey_configs/automated_master_config.json b/monkey/tests/data_for_tests/monkey_configs/automated_master_config.json index eb61845cf..0a98d0cbb 100644 --- a/monkey/tests/data_for_tests/monkey_configs/automated_master_config.json +++ b/monkey/tests/data_for_tests/monkey_configs/automated_master_config.json @@ -101,7 +101,7 @@ "other_behaviors": {"readme": true} } }, - "credential_collector_classes": [ + "credential_collectors": [ "MimikatzCollector", "SSHCollector" ] From 1cef7874d420edbb04344ebf675798fa17f4830c Mon Sep 17 00:00:00 2001 From: vakarisz Date: Fri, 10 Jun 2022 10:17:18 +0300 Subject: [PATCH 4/4] Island: Rename credential collector const --- .../monkey_island/cc/services/config_schema/config_schema.py | 4 ++-- .../config_schema/definitions/credential_collector_classes.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/services/config_schema/config_schema.py b/monkey/monkey_island/cc/services/config_schema/config_schema.py index 7babfd1d3..2993dc15e 100644 --- a/monkey/monkey_island/cc/services/config_schema/config_schema.py +++ b/monkey/monkey_island/cc/services/config_schema/config_schema.py @@ -1,7 +1,7 @@ from monkey_island.cc.services.config_schema.basic import BASIC from monkey_island.cc.services.config_schema.basic_network import BASIC_NETWORK from monkey_island.cc.services.config_schema.definitions.credential_collector_classes import ( - CREDENTIAL_COLLECTOR_CLASSES, + CREDENTIAL_COLLECTORS, ) from monkey_island.cc.services.config_schema.definitions.exploiter_classes import EXPLOITER_CLASSES from monkey_island.cc.services.config_schema.definitions.finger_classes import FINGER_CLASSES @@ -20,7 +20,7 @@ SCHEMA = { # users will not accidentally chose unsafe options "definitions": { "exploiter_classes": EXPLOITER_CLASSES, - "credential_collectors": CREDENTIAL_COLLECTOR_CLASSES, + "credential_collectors": CREDENTIAL_COLLECTORS, "post_breach_actions": POST_BREACH_ACTIONS, "finger_classes": FINGER_CLASSES, }, diff --git a/monkey/monkey_island/cc/services/config_schema/definitions/credential_collector_classes.py b/monkey/monkey_island/cc/services/config_schema/definitions/credential_collector_classes.py index 9c41a1f26..a16b8afac 100644 --- a/monkey/monkey_island/cc/services/config_schema/definitions/credential_collector_classes.py +++ b/monkey/monkey_island/cc/services/config_schema/definitions/credential_collector_classes.py @@ -1,6 +1,6 @@ from common.common_consts.credential_collector_names import MIMIKATZ_COLLECTOR, SSH_COLLECTOR -CREDENTIAL_COLLECTOR_CLASSES = { +CREDENTIAL_COLLECTORS = { "title": "Credential Collectors", "description": "Click on a credential collector to find out what it collects.", "type": "string",