Merge pull request #1311 from guardicore/ransomware-fix-config-ui-description

Ransomware: fix description and add info box
This commit is contained in:
Mike Salvatore 2021-07-12 13:45:27 -04:00 committed by GitHub
commit 3b80221c38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 34 deletions

View File

@ -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",

View File

@ -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 "
'<a href="https://guardicore.com/infectionmonkey/docs/usage/use-cases/ransomware-simulation" '
'target="_blank"> the documentation</a>.',
"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",

View File

@ -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 (
<>
<div className='alert alert-info'>
<FontAwesomeIcon icon={faInfoCircle} style={{'marginRight': '5px'}}/>
{this.props.schema.info}
</div>
<ObjectField {...this.props} />
</>);
}
}
export default FieldWithInfo;

View File

@ -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 (
<div className='alert alert-info'>
<FontAwesomeIcon icon={faInfoCircle} style={{'marginRight': '5px'}}/>
{this.props.schema.info}
</div>
);
}
}
export default InfoBox;

View File

@ -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
},