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

Ransomware config UI description
This commit is contained in:
Mike Salvatore 2021-07-05 07:30:47 -04:00 committed by GitHub
commit 94bf91c447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -1,6 +1,13 @@
RANSOMWARE = { RANSOMWARE = {
"title": "Ransomware", "title": "Ransomware",
"type": "object", "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": { "properties": {
"encryption": { "encryption": {
"title": "Encryption", "title": "Encryption",

View File

@ -0,0 +1,8 @@
import React from 'react';
function HtmlFieldDescription(props) {
var content_obj = {__html: props.description};
return <p id={props.id} className='field-description' dangerouslySetInnerHTML={content_obj} />;
}
export default HtmlFieldDescription;

View File

@ -17,6 +17,7 @@ import isUnsafeOptionSelected from '../utils/SafeOptionValidator.js';
import ConfigExportModal from '../configuration-components/ExportConfigModal'; import ConfigExportModal from '../configuration-components/ExportConfigModal';
import ConfigImportModal from '../configuration-components/ImportConfigModal'; import ConfigImportModal from '../configuration-components/ImportConfigModal';
import applyUiSchemaManipulators from '../configuration-components/UISchemaManipulators.tsx'; import applyUiSchemaManipulators from '../configuration-components/UISchemaManipulators.tsx';
import HtmlFieldDescription from '../configuration-components/HtmlFieldDescription.js';
const ATTACK_URL = '/api/attack'; const ATTACK_URL = '/api/attack';
const CONFIG_URL = '/api/configuration/island'; const CONFIG_URL = '/api/configuration/island';
@ -411,6 +412,7 @@ class ConfigurePageComponent extends AuthComponent {
setPbaFilenameLinux: this.setPbaFilenameLinux, setPbaFilenameLinux: this.setPbaFilenameLinux,
selectedSection: this.state.selectedSection selectedSection: this.state.selectedSection
}) })
formProperties['fields'] = {DescriptionField: HtmlFieldDescription};
formProperties['formData'] = this.state.currentFormData; formProperties['formData'] = this.state.currentFormData;
formProperties['onChange'] = this.onChange; formProperties['onChange'] = this.onChange;
formProperties['customFormats'] = formValidationFormats; formProperties['customFormats'] = formValidationFormats;