From 938022fc5212bec6ecfcbd47479f8f2a3e334f30 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 30 Jun 2021 14:09:26 -0400 Subject: [PATCH 1/2] Island: Allow HTML in config_schema descriptions to be renedered --- .../configuration-components/HtmlFieldDescription.js | 8 ++++++++ .../cc/ui/src/components/pages/ConfigurePage.js | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 monkey/monkey_island/cc/ui/src/components/configuration-components/HtmlFieldDescription.js diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/HtmlFieldDescription.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/HtmlFieldDescription.js new file mode 100644 index 000000000..2d8df9020 --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/HtmlFieldDescription.js @@ -0,0 +1,8 @@ +import React from 'react'; + +function HtmlFieldDescription(props) { + var content_obj = {__html: props.description}; + return

; +} + +export default HtmlFieldDescription; diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index 310555408..a5ea68107 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -17,6 +17,7 @@ import isUnsafeOptionSelected from '../utils/SafeOptionValidator.js'; import ConfigExportModal from '../configuration-components/ExportConfigModal'; import ConfigImportModal from '../configuration-components/ImportConfigModal'; import applyUiSchemaManipulators from '../configuration-components/UISchemaManipulators.tsx'; +import HtmlFieldDescription from '../configuration-components/HtmlFieldDescription.js'; const ATTACK_URL = '/api/attack'; const CONFIG_URL = '/api/configuration/island'; @@ -411,6 +412,7 @@ class ConfigurePageComponent extends AuthComponent { setPbaFilenameLinux: this.setPbaFilenameLinux, selectedSection: this.state.selectedSection }) + formProperties['fields'] = {DescriptionField: HtmlFieldDescription}; formProperties['formData'] = this.state.currentFormData; formProperties['onChange'] = this.onChange; formProperties['customFormats'] = formValidationFormats; From e1263ec75356dfa389f211f51cef0435d32089a4 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 30 Jun 2021 14:10:15 -0400 Subject: [PATCH 2/2] Island: Add a ransomware description to the ransomware config_schema --- .../monkey_island/cc/services/config_schema/ransomware.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/monkey/monkey_island/cc/services/config_schema/ransomware.py b/monkey/monkey_island/cc/services/config_schema/ransomware.py index 116a6ca70..9c445a833 100644 --- a/monkey/monkey_island/cc/services/config_schema/ransomware.py +++ b/monkey/monkey_island/cc/services/config_schema/ransomware.py @@ -1,6 +1,13 @@ RANSOMWARE = { "title": "Ransomware", "type": "object", + "description": "This page allows you to configure the Infection Monkey to execute a ransomware " + "simulation. The Infection Monkey is capable of simulating a ransomware attack on your network " + "using a set of configurable behaviors. A number of precautions have been taken to ensure that " + "this ransomware simulation is safe for production environments.\n\nFor more information about " + "configuring the ransomware simulation, see " + ' the documentation.', "properties": { "encryption": { "title": "Encryption",