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..e1dd95c17 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 checked. ' + '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/services/config_schema/ransomware.py b/monkey/monkey_island/cc/services/config_schema/ransomware.py index 245044043..03c5e8438 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, 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", @@ -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", 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/InfoBox.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js new file mode 100644 index 000000000..ba6957aef --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/InfoBox.js @@ -0,0 +1,17 @@ +import * as React from 'react'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle'; + +class InfoBox extends React.Component { + + render() { + return ( +
+ + {this.props.schema.info} +
+ ); + } +} + +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 9039ca36f..5d1211407 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 FieldWithInfo from './FieldWithInfo'; +import InfoBox from './InfoBox'; export default function UiSchema(props) { const UiSchema = { @@ -17,8 +17,8 @@ export default function UiSchema(props) { basic_network: { 'ui:order': ['scope', 'network_analysis'], scope: { - blocked_ips: { - 'ui:field': FieldWithInfo + info_box: { + 'ui:field': InfoBox }, subnet_scan_list: { format: 'ip-list' @@ -73,6 +73,9 @@ export default function UiSchema(props) { }, ransomware: { encryption: { + info_box: { + 'ui:field': InfoBox + }, directories: { // Directory inputs are dynamically hidden },