From 4320d3e08cb1a130a5808e522aeaa9962e1ff4d9 Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 9 Jul 2021 19:53:08 +0530 Subject: [PATCH 1/9] cc: Change config field descriptions and add `info_box` field to ransomware config schema --- .../cc/services/config_schema/ransomware.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/monkey/monkey_island/cc/services/config_schema/ransomware.py b/monkey/monkey_island/cc/services/config_schema/ransomware.py index 64b986acb..70415110d 100644 --- a/monkey/monkey_island/cc/services/config_schema/ransomware.py +++ b/monkey/monkey_island/cc/services/config_schema/ransomware.py @@ -6,17 +6,14 @@ from common.common_consts.validation_formats import ( 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", + "title": "Simulation", "type": "object", + "description": "To simulate ransomware encryption, create a directory and put some " + "files there to be encrypted. Do this on each machine on which you want to run the " + "ransomware encryption simulation.\n\nProvide the path to the directory that was " + "created on each machine:", "properties": { "enabled": { "title": "Encrypt files", @@ -25,6 +22,12 @@ RANSOMWARE = { "description": "Ransomware encryption will be simulated by flipping every bit " "in the files contained within the target directories.", }, + "info_box": { + "title": "", + "type": "object", + "info": "No files will be encrypted if a directory is not specified or doesn't " + "exist on a victim machine.", + }, "directories": { "title": "Directories to encrypt", "type": "object", From 844399b608e528e51f75d80365cd4f3b9041a2ba Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 9 Jul 2021 19:53:46 +0530 Subject: [PATCH 2/9] cc: Add new `InfoField` component --- .../configuration-components/InfoField.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 monkey/monkey_island/cc/ui/src/components/configuration-components/InfoField.js diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoField.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoField.js new file mode 100644 index 000000000..ec6254943 --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoField.js @@ -0,0 +1,18 @@ +import * as React from 'react'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle'; + +class InfoField extends React.Component { + + render() { + return ( + <> +
+ + {this.props.schema.info} +
+ ); + } +} + +export default InfoField; From e6c9377908672fc0b45c79d4b17e3799272cf1d7 Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 9 Jul 2021 19:55:05 +0530 Subject: [PATCH 3/9] cc: Link `InfoField` widget to ransomware's `info_box` field in UI schema --- .../cc/ui/src/components/configuration-components/UiSchema.js | 4 ++++ 1 file changed, 4 insertions(+) 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 79dced094..684d9d416 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 @@ -2,6 +2,7 @@ import AdvancedMultiSelect from '../ui-components/AdvancedMultiSelect'; import PbaInput from './PbaInput'; import {API_PBA_LINUX, API_PBA_WINDOWS} from '../pages/ConfigurePage'; import FieldWithInfo from './FieldWithInfo'; +import InfoField from './InfoField'; export default function UiSchema(props) { const UiSchema = { @@ -73,6 +74,9 @@ export default function UiSchema(props) { }, ransomware: { encryption: { + info_box: { + 'ui:field': InfoField + }, directories: { // Directory inputs are dynamically hidden } From 677f995bb3728835fea5ec77067db0d431637071 Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 9 Jul 2021 20:19:38 +0530 Subject: [PATCH 4/9] cc: Change schema for Network configuration tab to decouple info box and blocked IPs' input field --- .../cc/services/config_schema/basic_network.py | 10 +++++++--- .../components/configuration-components/UiSchema.js | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/monkey/monkey_island/cc/services/config_schema/basic_network.py b/monkey/monkey_island/cc/services/config_schema/basic_network.py index 4512a7cc9..46c04284e 100644 --- a/monkey/monkey_island/cc/services/config_schema/basic_network.py +++ b/monkey/monkey_island/cc/services/config_schema/basic_network.py @@ -9,6 +9,13 @@ BASIC_NETWORK = { "title": "Scope", "type": "object", "properties": { + "info_box": { + "title": "", + "type": "object", + "info": 'The Monkey scans its subnet if "Local network scan" is ticked. ' + 'Additionally, the Monkey scans machines according to "Scan ' + 'target list".', + }, "blocked_ips": { "title": "Blocked IPs", "type": "array", @@ -19,9 +26,6 @@ BASIC_NETWORK = { }, "default": [], "description": "List of IPs that the Monkey will not scan.", - "info": 'The Monkey scans its subnet if "Local network scan" is ticked. ' - 'Additionally the monkey scans machines according to "Scan ' - 'target list".', }, "local_network_scan": { "title": "Local network scan", 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 684d9d416..aa93445e6 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 @@ -18,8 +18,8 @@ export default function UiSchema(props) { basic_network: { 'ui:order': ['scope', 'network_analysis'], scope: { - blocked_ips: { - 'ui:field': FieldWithInfo + info_box: { + 'ui:field': InfoField }, subnet_scan_list: { format: 'ip-list' From 67293b37ef67f3a4332de4ff0d6f21145a05237b Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 9 Jul 2021 20:20:12 +0530 Subject: [PATCH 5/9] cc: Remove unused `FieldWithInfo` component --- .../configuration-components/FieldWithInfo.js | 20 ------------------- .../configuration-components/UiSchema.js | 1 - 2 files changed, 21 deletions(-) delete mode 100644 monkey/monkey_island/cc/ui/src/components/configuration-components/FieldWithInfo.js diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/FieldWithInfo.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/FieldWithInfo.js deleted file mode 100644 index 8a0bc0c04..000000000 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/FieldWithInfo.js +++ /dev/null @@ -1,20 +0,0 @@ -import ObjectField from 'react-jsonschema-form-bs4/lib/components/fields/ArrayField'; -import * as React from 'react'; -import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; -import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle'; - -class FieldWithInfo extends React.Component { - - render() { - return ( - <> -
- - {this.props.schema.info} -
- - ); - } -} - -export default FieldWithInfo; 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 aa93445e6..37a89e87c 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 @@ -1,7 +1,6 @@ import AdvancedMultiSelect from '../ui-components/AdvancedMultiSelect'; import PbaInput from './PbaInput'; import {API_PBA_LINUX, API_PBA_WINDOWS} from '../pages/ConfigurePage'; -import FieldWithInfo from './FieldWithInfo'; import InfoField from './InfoField'; export default function UiSchema(props) { From e16b019b85526e9ddb6d66b4d0f84198ed393d43 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 12 Jul 2021 11:51:03 +0530 Subject: [PATCH 6/9] cc: Rename component `InfoField` to `InfoBox` --- .../configuration-components/{InfoField.js => InfoBox.js} | 4 ++-- .../ui/src/components/configuration-components/UiSchema.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename monkey/monkey_island/cc/ui/src/components/configuration-components/{InfoField.js => InfoBox.js} (85%) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoField.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js similarity index 85% rename from monkey/monkey_island/cc/ui/src/components/configuration-components/InfoField.js rename to monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js index ec6254943..1542676ce 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoField.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js @@ -2,7 +2,7 @@ import * as React from 'react'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle'; -class InfoField extends React.Component { +class InfoBox extends React.Component { render() { return ( @@ -15,4 +15,4 @@ class InfoField extends React.Component { } } -export default InfoField; +export default InfoBox; 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 37a89e87c..541132bb4 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 @@ -1,7 +1,7 @@ import AdvancedMultiSelect from '../ui-components/AdvancedMultiSelect'; import PbaInput from './PbaInput'; import {API_PBA_LINUX, API_PBA_WINDOWS} from '../pages/ConfigurePage'; -import InfoField from './InfoField'; +import InfoBox from './InfoBox'; export default function UiSchema(props) { const UiSchema = { @@ -18,7 +18,7 @@ export default function UiSchema(props) { 'ui:order': ['scope', 'network_analysis'], scope: { info_box: { - 'ui:field': InfoField + 'ui:field': InfoBox }, subnet_scan_list: { format: 'ip-list' @@ -74,7 +74,7 @@ export default function UiSchema(props) { ransomware: { encryption: { info_box: { - 'ui:field': InfoField + 'ui:field': InfoBox }, directories: { // Directory inputs are dynamically hidden From 9cb6dca220df76d32989095e41bb4e3f312d4e93 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 12 Jul 2021 11:52:18 +0530 Subject: [PATCH 7/9] cc: Remove unused empty tags in `InfoBox.js` --- .../components/configuration-components/InfoBox.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js index 1542676ce..ba6957aef 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js @@ -6,12 +6,11 @@ class InfoBox extends React.Component { render() { return ( - <> -
- - {this.props.schema.info} -
- ); +
+ + {this.props.schema.info} +
+ ); } } From 6f33b04e1faceb485baf3c98aad7053f8ef33ca1 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 12 Jul 2021 13:44:04 +0530 Subject: [PATCH 8/9] cc: Reword info box for local network scan in Network configuration tab Co-authored-by: VakarisZ <36815064+VakarisZ@users.noreply.github.com> --- monkey/monkey_island/cc/services/config_schema/basic_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/services/config_schema/basic_network.py b/monkey/monkey_island/cc/services/config_schema/basic_network.py index 46c04284e..e1dd95c17 100644 --- a/monkey/monkey_island/cc/services/config_schema/basic_network.py +++ b/monkey/monkey_island/cc/services/config_schema/basic_network.py @@ -12,7 +12,7 @@ BASIC_NETWORK = { "info_box": { "title": "", "type": "object", - "info": 'The Monkey scans its subnet if "Local network scan" is ticked. ' + "info": 'The Monkey scans its subnet if "Local network scan" is checked. ' 'Additionally, the Monkey scans machines according to "Scan ' 'target list".', }, From 22ff22f3895f602707851369d3de7908ec385577 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 12 Jul 2021 13:44:45 -0400 Subject: [PATCH 9/9] Island: Reword ransomware simulation description --- .../monkey_island/cc/services/config_schema/ransomware.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/services/config_schema/ransomware.py b/monkey/monkey_island/cc/services/config_schema/ransomware.py index 70415110d..f42f9f53b 100644 --- a/monkey/monkey_island/cc/services/config_schema/ransomware.py +++ b/monkey/monkey_island/cc/services/config_schema/ransomware.py @@ -10,10 +10,10 @@ RANSOMWARE = { "encryption": { "title": "Simulation", "type": "object", - "description": "To simulate ransomware encryption, create a directory and put some " - "files there to be encrypted. Do this on each machine on which you want to run the " - "ransomware encryption simulation.\n\nProvide the path to the directory that was " - "created on each machine:", + "description": "To simulate ransomware encryption, you'll need to provide Infection " + "Monkey with files that it can safely encrypt. On each machine where you would like " + "the ransomware simulation to run, create a directory and put some files in it." + "\n\nProvide the path to the directory that was created on each machine.", "properties": { "enabled": { "title": "Encrypt files",