Merge pull request #2082 from guardicore/1965-add-credentials-ui-form

1965 add credentials UI form
This commit is contained in:
Mike Salvatore 2022-07-15 07:47:22 -04:00 committed by GitHub
commit 3c4883b304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 326 additions and 193 deletions

View File

@ -0,0 +1,98 @@
import Form from 'react-jsonschema-form-bs4';
import React, {useState, useEffect} from 'react';
import {Nav} from 'react-bootstrap';
import _ from 'lodash';
const sectionOrder = [
'exploitation',
'network_scan',
'credentials',
'maximum_depth'
];
const initialSection = sectionOrder[0];
export default function PropagationConfig(props) {
const {
schema,
uiSchema,
onChange,
customFormats,
className,
formData
} = props;
const [selectedSection, setSelectedSection] = useState(initialSection);
const [displayedSchema, setDisplayedSchema] = useState(getSchemaByKey(schema, initialSection));
const [displayedSchemaUi, setDisplayedSchemaUi] = useState(getUiSchemaByKey(uiSchema, initialSection));
const [localFormData, setLocalFormData] = useState(formData[initialSection]);
useEffect(() => {
setLocalFormData(formData[selectedSection]);
setDisplayedSchema(getSchemaByKey(schema, selectedSection));
setDisplayedSchemaUi(getUiSchemaByKey(uiSchema, selectedSection));
setLocalFormData(formData[selectedSection]);
}, [selectedSection])
useEffect(() => {
setLocalFormData(formData[selectedSection]);
}, [formData])
const onInnerDataChange = (innerData) => {
let innerDataClone = _.clone(innerData);
let formDataClone = _.clone(formData);
formDataClone[selectedSection] = innerDataClone.formData;
onChange({formData: formDataClone});
}
const setSection = (sectionKey) => {
setSelectedSection(sectionKey);
}
const renderNav = () => {
return (<Nav variant='tabs'
fill
activeKey={selectedSection} onSelect={setSection}
style={{'marginBottom': '2em'}}
className={'config-nav'}>
{sectionOrder.map(section => {
return (
<Nav.Item key={section}>
<Nav.Link eventKey={section}>{getNavTitle(schema, section)}</Nav.Link>
</Nav.Item>);
})}
</Nav>)
}
return (<div>
{renderNav()}
<Form schema={displayedSchema}
uiSchema={displayedSchemaUi}
formData={localFormData}
onChange={onInnerDataChange}
customFormats={customFormats}
className={className}
liveValidate>
<button type='submit' className={'hidden'}>Submit</button>
</Form>
</div>)
}
function getSchemaByKey(schema, key) {
return schema['properties'][key];
}
function getUiSchemaByKey(uiSchema, key) {
return uiSchema[key];
}
function getNavTitle(schema, key) {
if (key === 'maximum_depth') {
return 'General';
}
if (key === 'credentials') {
return 'Credentials';
}
return schema['properties'][key].title;
}

View File

@ -30,6 +30,16 @@ export default function UiSchema(props) {
} }
} }
}, },
credentials: {
exploit_ssh_keys: {
items: {
public_key: {
},
private_key: {
}
}
}
},
network_scan: { network_scan: {
targets: { targets: {
info_box: { info_box: {

View File

@ -8,6 +8,7 @@ import {faCheck} from '@fortawesome/free-solid-svg-icons/faCheck';
import {faExclamationCircle} from '@fortawesome/free-solid-svg-icons/faExclamationCircle'; import {faExclamationCircle} from '@fortawesome/free-solid-svg-icons/faExclamationCircle';
import {formValidationFormats} from '../configuration-components/ValidationFormats'; import {formValidationFormats} from '../configuration-components/ValidationFormats';
import transformErrors from '../configuration-components/ValidationErrorMessages'; import transformErrors from '../configuration-components/ValidationErrorMessages';
import PropagationConfig from '../configuration-components/PropagationConfig'
import UnsafeConfigOptionsConfirmationModal import UnsafeConfigOptionsConfirmationModal
from '../configuration-components/UnsafeConfigOptionsConfirmationModal.js'; from '../configuration-components/UnsafeConfigOptionsConfirmationModal.js';
import isUnsafeOptionSelected from '../utils/SafeOptionValidator.js'; import isUnsafeOptionSelected from '../utils/SafeOptionValidator.js';
@ -16,7 +17,7 @@ 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'; import HtmlFieldDescription from '../configuration-components/HtmlFieldDescription.js';
import CONFIGURATION_TABS_PER_MODE from '../configuration-components/ConfigurationTabs.js'; import CONFIGURATION_TABS_PER_MODE from '../configuration-components/ConfigurationTabs.js';
import {SCHEMA} from '../../services/configuration/config_schema.js'; import {SCHEMA} from '../../services/configuration/configSchema.js';
import {reformatConfig} from '../configuration-components/ReformatHook'; import {reformatConfig} from '../configuration-components/ReformatHook';
const CONFIG_URL = '/api/agent-configuration'; const CONFIG_URL = '/api/agent-configuration';
@ -296,6 +297,9 @@ class ConfigurePageComponent extends AuthComponent {
formProperties['formData'], formProperties['formData'],
formProperties['uiSchema']); formProperties['uiSchema']);
if (this.state.selectedSection === 'propagation') {
return (<PropagationConfig {...formProperties}/>)
} else {
return ( return (
<div> <div>
<Form {...formProperties} key={displayedSchema.title}> <Form {...formProperties} key={displayedSchema.title}>
@ -303,6 +307,7 @@ class ConfigurePageComponent extends AuthComponent {
</Form> </Form>
</div> </div>
) )
}
}; };
setPbaFilenameWindows = (filename) => { setPbaFilenameWindows = (filename) => {

View File

@ -6,7 +6,7 @@ import {cloneDeep} from 'lodash';
import {getDefaultPaneParams, InfoPane, WarningType} from './InfoPane'; import {getDefaultPaneParams, InfoPane, WarningType} from './InfoPane';
import {MasterCheckbox, MasterCheckboxState} from './MasterCheckbox'; import {MasterCheckbox, MasterCheckboxState} from './MasterCheckbox';
import ChildCheckboxContainer from './ChildCheckbox'; import ChildCheckboxContainer from './ChildCheckbox';
import {getFullDefinitionByKey, getObjectFromRegistryByRef} from './JsonSchemaHelpers'; import {getFullDefinitionByKey} from './JsonSchemaHelpers';
function AdvancedMultiSelectHeader(props) { function AdvancedMultiSelectHeader(props) {
const { const {
@ -38,14 +38,12 @@ class AdvancedMultiSelect extends React.Component {
this.state = { this.state = {
infoPaneParams: getDefaultPaneParams( infoPaneParams: getDefaultPaneParams(
this.props.schema.items.$ref, this.props.schema.items,
this.props.registry,
this.isUnsafeOptionSelected(selectedPluginNames) this.isUnsafeOptionSelected(selectedPluginNames)
), ),
allPluginNames: allPluginNames, allPluginNames: allPluginNames,
masterCheckboxState: this.getMasterCheckboxState(selectedPluginNames), masterCheckboxState: this.getMasterCheckboxState(selectedPluginNames),
pluginDefinitions: getObjectFromRegistryByRef(this.props.schema.items.$ref, pluginDefinitions: this.props.schema.items.pluginDefs,
this.props.registry).pluginDefs,
selectedPluginNames: selectedPluginNames selectedPluginNames: selectedPluginNames
}; };
} }
@ -55,23 +53,17 @@ class AdvancedMultiSelect extends React.Component {
} }
onChange = (strValues) => { onChange = (strValues) => {
let newValues = []; let pluginArray = this.namesToPlugins(strValues, this.state.pluginDefinitions);
for (let j = 0; j < strValues.length; j++) { this.props.onChange(pluginArray)
let found = false; this.setState({selectedPluginNames: pluginArray.map(v => v.name)});
for (let i = 0; i < this.state.allPluginNames.length; i++) {
if (strValues[j] === this.state.allPluginNames[i]['name']) {
newValues.push(JSON.parse(JSON.stringify(this.props.value[i])))
found = true;
break;
} }
namesToPlugins = (names, allPlugins) => {
let plugins = [];
for (let i = 0; i < names.length; i++){
plugins.push(cloneDeep(allPlugins[names[i]]));
} }
if (!found) { return plugins
newValues.push(this.state.pluginDefinitions[strValues[j]]);
}
}
newValues = JSON.parse(JSON.stringify(newValues));
this.props.onChange(newValues)
this.setState({selectedPluginNames: newValues.map(v => v.name)});
} }
// Sort options alphabetically. "Unsafe" options float to the top so that they // Sort options alphabetically. "Unsafe" options float to the top so that they
@ -146,14 +138,12 @@ class AdvancedMultiSelect extends React.Component {
} }
isSafe = (itemKey) => { isSafe = (itemKey) => {
let fullDef = getFullDefinitionByKey(this.props.schema.items.$ref, let fullDef = getFullDefinitionByKey(this.props.schema.items, itemKey);
this.props.registry, itemKey);
return fullDef.safe; return fullDef.safe;
} }
setPaneInfo = (itemKey) => { setPaneInfo = (itemKey) => {
let definitionObj = getFullDefinitionByKey(this.props.schema.items.$ref, let definitionObj = getFullDefinitionByKey(this.props.schema.items, itemKey);
this.props.registry, itemKey);
this.setState( this.setState(
{ {
infoPaneParams: { infoPaneParams: {

View File

@ -1,9 +1,7 @@
import {Card, Button} from 'react-bootstrap'; import {Button, Card} from 'react-bootstrap';
import React from 'react'; import React from 'react';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons'; import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons';
import {getObjectFromRegistryByRef} from './JsonSchemaHelpers';
import WarningIcon from './WarningIcon'; import WarningIcon from './WarningIcon';
const WarningType = { const WarningType = {
@ -12,8 +10,8 @@ const WarningType = {
MULTIPLE: 2 MULTIPLE: 2
} }
function getDefaultPaneParams(refString, registry, isUnsafeOptionSelected) { function getDefaultPaneParams(items, isUnsafeOptionSelected) {
let configSection = getObjectFromRegistryByRef(refString, registry); let configSection = items;
return ( return (
{ {
title: configSection.title, title: configSection.title,

View File

@ -1,19 +1,6 @@
import {resolveObjectPath} from './utils/ObjectPathResolver'; function getFullDefinitionByKey(items, itemKey) {
let fullArray = items.anyOf;
function getFullDefinitionByKey(refString, registry, itemKey) {
let fullArray = getFullDefinitionsFromRegistry(refString, registry);
return fullArray.filter(e => (e.enum[0] === itemKey))[0]; return fullArray.filter(e => (e.enum[0] === itemKey))[0];
} }
// Definitions passed to components only contains value and label, export {getFullDefinitionByKey};
// custom fields like "info" or "links" must be pulled from registry object using this function
function getFullDefinitionsFromRegistry(refString, registry) {
return getObjectFromRegistryByRef(refString, registry).anyOf;
}
function getObjectFromRegistryByRef(refString, registry) {
let refArray = refString.replace('#', '').split('/');
return resolveObjectPath(refArray, registry);
}
export {getFullDefinitionByKey, getObjectFromRegistryByRef};

View File

@ -1,11 +0,0 @@
// Resolves object's path if it's specified in a dot notation.
// (e.g. params: "firstLevel.secondLevel.property", myObject)
export function resolveObjectPath(pathArray, obj) {
return pathArray.reduce(function(prev, curr) {
if(curr === '')
return prev;
else
return prev ? prev[curr] : null;
}, obj || self)
}

View File

@ -2,27 +2,27 @@ function getPluginDescriptors(schema, config) {
return ([ return ([
{ {
name: 'Brute force exploiters', name: 'Brute force exploiters',
allPlugins: schema.definitions.brute_force_classes.anyOf, allPlugins: schema.properties.propagation.properties.exploitation.properties.brute_force.items.anyOf,
selectedPlugins: config.propagation.exploitation.brute_force selectedPlugins: config.propagation.exploitation.brute_force
}, },
{ {
name: 'Vulnerability exploiters', name: 'Vulnerability exploiters',
allPlugins: schema.definitions.vulnerability_classes.anyOf, allPlugins: schema.properties.propagation.properties.exploitation.properties.vulnerability.items.anyOf,
selectedPlugins: config.propagation.exploitation.vulnerability selectedPlugins: config.propagation.exploitation.vulnerability
}, },
{ {
name: 'Fingerprinters', name: 'Fingerprinters',
allPlugins: schema.definitions.fingerprinter_classes.anyOf, allPlugins: schema.properties.propagation.properties.network_scan.properties.fingerprinters.items.anyOf,
selectedPlugins: config.propagation.network_scan.fingerprinters selectedPlugins: config.propagation.network_scan.fingerprinters
}, },
{ {
name: 'PostBreachActions', name: 'PostBreachActions',
allPlugins: schema.definitions.post_breach_actions.anyOf, allPlugins: schema.properties.post_breach_actions.items.anyOf,
selectedPlugins: config.post_breach_actions selectedPlugins: config.post_breach_actions
}, },
{ {
name: 'CredentialCollectors', name: 'CredentialCollectors',
allPlugins: schema.definitions.credential_collectors_classes.anyOf, allPlugins: schema.properties.credential_collectors.items.anyOf,
selectedPlugins: config.credential_collectors selectedPlugins: config.credential_collectors
} }
]); ]);

View File

@ -0,0 +1,40 @@
import PROPAGATION_CONFIGURATION_SCHEMA from './propagation/propagation.js';
import CREDENTIAL_COLLECTORS from './credentialCollectors.js';
import POST_BREACH_ACTIONS from './postBreachActions.js';
import RANSOMWARE_SCHEMA from './ransomware';
import CUSTOM_PBA_CONFIGURATION_SCHEMA from './customPBAs';
export const SCHEMA = {
'title': 'Monkey',
'type': 'object',
'properties': {
'propagation': PROPAGATION_CONFIGURATION_SCHEMA,
'post_breach_actions': {
'title': 'Post-breach actions',
'type': 'array',
'uniqueItems': true,
'items': POST_BREACH_ACTIONS
},
'custom_pbas': CUSTOM_PBA_CONFIGURATION_SCHEMA,
'payloads': RANSOMWARE_SCHEMA,
'credential_collectors': {
'title': 'Credential collectors',
'type': 'array',
'uniqueItems': true,
'items': CREDENTIAL_COLLECTORS
},
'advanced': {
'title': 'Advanced',
'type': 'object',
'properties':{
'keep_tunnel_open_time': {
'title': 'Keep tunnel open time',
'type': 'number',
'default': 30,
'description': 'Time to keep tunnel open before going down after last exploit (in seconds)'
}
}
}
},
'options': {'collapsed': true}
}

View File

@ -1,58 +0,0 @@
import {customPBAConfigurationSchema} from './definitions/custom_pbas.js';
import {ransomwareSchema} from './definitions/ransomware.js';
import {propagationConfigurationSchema} from './definitions/propagation.js';
import {bruteForceExploiters, vulnerabilityExploiters} from './definitions/exploiter_classes.js';
import {credentialCollectors} from './definitions/credential_collectors.js';
import {postBreachActions} from './definitions/post_breach_actions.js';
import {fingerprinterClasses} from './definitions/fingerprinter_classes.js'
export const SCHEMA = {
'title': 'Monkey',
'type': 'object',
'definitions': {
'brute_force_classes': bruteForceExploiters,
'vulnerability_classes': vulnerabilityExploiters,
'credential_collectors_classes': credentialCollectors,
'post_breach_actions': postBreachActions,
'fingerprinter_classes': fingerprinterClasses
},
'properties': {
'propagation': propagationConfigurationSchema,
'post_breach_actions': {
'title': 'Post-breach actions',
'type': 'array',
'uniqueItems': true,
'items': {
'$ref': '#/definitions/post_breach_actions'
}
},
'custom_pbas': customPBAConfigurationSchema,
'payloads': ransomwareSchema,
'credential_collectors': {
'title': 'Credential collectors',
'type': 'array',
'uniqueItems': true,
'items': {
'$ref': '#/definitions/credential_collectors_classes'
},
'default': [
'MimikatzCollector',
'SSHCollector'
]
},
'advanced': {
'title': 'Advanced',
'type': 'object',
'properties':{
'keep_tunnel_open_time': {
'title': 'Keep tunnel open time',
'format': 'float',
'type': 'number',
'default': 30,
'description': 'Time to keep tunnel open before going down after last exploit (in seconds)'
}
}
}
},
'options': {'collapsed': true}
}

View File

@ -1,4 +1,4 @@
export const credentialCollectors = { const CREDENTIAL_COLLECTORS = {
'title': 'Credential Collectors', 'title': 'Credential Collectors',
'description': 'Click on a credential collector to find out what it collects.', 'description': 'Click on a credential collector to find out what it collects.',
'type': 'string', 'type': 'string',
@ -23,3 +23,4 @@ export const credentialCollectors = {
} }
] ]
} }
export default CREDENTIAL_COLLECTORS

View File

@ -1,4 +1,4 @@
export const customPBAConfigurationSchema = { const CUSTOM_PBA_CONFIGURATION_SCHEMA = {
'title': 'Custom PBA', 'title': 'Custom PBA',
'properties': { 'properties': {
'linux_command': { 'linux_command': {
@ -49,3 +49,4 @@ export const customPBAConfigurationSchema = {
} }
} }
} }
export default CUSTOM_PBA_CONFIGURATION_SCHEMA;

View File

@ -1,26 +0,0 @@
import {exploitationOptionsConfigurationSchema} from './exploitation_options.js';
export const exploitationConfigurationSchema = {
'title': 'Exploiters',
'type': 'object',
'description': 'Choose which exploiters the Monkey will attempt.',
'properties': {
'brute_force': {
'title': 'Brute force exploiters',
'type': 'array',
'uniqueItems': true,
'items': {
'$ref': '#/definitions/brute_force_classes'
}
},
'vulnerability': {
'title': 'Vulnerability Exploiters',
'type': 'array',
'uniqueItems': true,
'items': {
'$ref': '#/definitions/vulnerability_classes'
}
},
'options': exploitationOptionsConfigurationSchema
}
};

View File

@ -1,21 +0,0 @@
import {icmpScanConfigurationSchema} from './icmp_scan.js';
import {scanTargetConfigurationSchema} from './scan_target.js';
import {tcpScanConfigurationSchema} from './tcp_scan.js';
export const networkScanConfigurationSchema = {
'title': 'Network analysis',
'type': 'object',
'properties': {
'fingerprinters': {
'title': 'Fingerprinters',
'type': 'array',
'uniqueItems': true,
'items': {
'$ref': '#/definitions/fingerprinter_classes'
}
},
'icmp': icmpScanConfigurationSchema,
'targets': scanTargetConfigurationSchema,
'tcp': tcpScanConfigurationSchema
}
}

View File

@ -1,4 +1,4 @@
export const exploitationOptionsConfigurationSchema = { const EXPLOITATION_OPTIONS_CONFIGURATION_SCHEMA = {
'title': 'Exploiters Options', 'title': 'Exploiters Options',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
@ -13,3 +13,4 @@ export const exploitationOptionsConfigurationSchema = {
} }
} }
} }
export default EXPLOITATION_OPTIONS_CONFIGURATION_SCHEMA;

View File

@ -1,4 +1,4 @@
export const bruteForceExploiters = { export const BRUTE_FORCE_EXPLOITERS = {
'title': 'Brute force exploiters', 'title': 'Brute force exploiters',
'description': 'Click on exploiter to get more information about it.' 'description': 'Click on exploiter to get more information about it.'
+ '\u26A0' + '\u26A0'
@ -68,7 +68,7 @@ export const bruteForceExploiters = {
] ]
} }
export const vulnerabilityExploiters = { export const VULNERABILITY_EXPLOITERS = {
'title': 'Vulnerability exploiters', 'title': 'Vulnerability exploiters',
'description': 'Click on exploiter to get more information about it.' + 'description': 'Click on exploiter to get more information about it.' +
'\u26A0 Note that using unsafe exploits may cause craches of the exploited ' + '\u26A0 Note that using unsafe exploits may cause craches of the exploited ' +

View File

@ -1,4 +1,4 @@
export const postBreachActions = { const POST_BREACH_ACTIONS = {
'title': 'Post-Breach Actions', 'title': 'Post-Breach Actions',
'description': 'Runs scripts/commands on infected machines. These actions safely simulate what ' + 'description': 'Runs scripts/commands on infected machines. These actions safely simulate what ' +
'an adversary might do after breaching a new machine. Used in ATT&CK and Zero trust reports.', 'an adversary might do after breaching a new machine. Used in ATT&CK and Zero trust reports.',
@ -109,3 +109,4 @@ export const postBreachActions = {
} }
export default POST_BREACH_ACTIONS;

View File

@ -0,0 +1,62 @@
const CREDENTIALS = {
'title': 'Credentials',
'type': 'object',
'properties': {
'exploit_user_list': {
'title': 'Exploit user list',
'type': 'array',
'uniqueItems': true,
'items': {'type': 'string'},
'default': [],
'description': 'List of usernames that will be used by exploiters that need ' +
'credentials, like SSH brute-forcing.'
},
'exploit_password_list': {
'title': 'Exploit password list',
'type': 'array',
'uniqueItems': true,
'items': {'type': 'string'},
'default': [],
'description': 'List of passwords that will be used by exploiters that need ' +
'credentials, like SSH brute-forcing.'
},
'exploit_lm_hash_list': {
'title': 'Exploit LM hash list',
'type': 'array',
'uniqueItems': true,
'items': {'type': 'string'},
'default': [],
'description': 'List of LM hashes to use on exploits using credentials'
},
'exploit_ntlm_hash_list': {
'title': 'Exploit NTLM hash list',
'type': 'array',
'uniqueItems': true,
'items': {'type': 'string'},
'default': [],
'description': 'List of NTLM hashes to use on exploits using credentials'
},
'exploit_ssh_keys': {
'title': 'SSH key pairs list',
'type': 'array',
'uniqueItems': true,
'default': [],
'items': {
'type': 'object',
'properties': {
'public_key': {
'title': 'Public Key',
'type': 'string'
},
'private_key': {
'title': 'Private Key',
'type': 'string'
}
}
},
'description': 'List of SSH key pairs to use, when trying to ssh into servers'
}
}
}
export default CREDENTIALS;

View File

@ -0,0 +1,24 @@
import EXPLOITATION_OPTIONS_CONFIGURATION_SCHEMA from '../exploitationOptions.js';
import {BRUTE_FORCE_EXPLOITERS, VULNERABILITY_EXPLOITERS} from '../exploiterClasses';
const EXPLOITATION_CONFIGURATION_SCHEMA = {
'title': 'Exploiters',
'properties': {
'brute_force': {
'items': BRUTE_FORCE_EXPLOITERS,
'title': 'Brute force exploiters',
'type': 'array',
'uniqueItems': true
},
'vulnerability': {
'items': VULNERABILITY_EXPLOITERS,
'title': 'Vulnerability Exploiters',
'type': 'array',
'uniqueItems': true
}
},
'options': EXPLOITATION_OPTIONS_CONFIGURATION_SCHEMA,
'type': 'object'
};
export default EXPLOITATION_CONFIGURATION_SCHEMA;

View File

@ -1,4 +1,4 @@
export const fingerprinterClasses = { const FINGERPRINTER_CLASSES = {
'title': 'Fingerprinters', 'title': 'Fingerprinters',
'description': 'Fingerprint modules collect info about external services ' + 'description': 'Fingerprint modules collect info about external services ' +
'Infection Monkey scans.', 'Infection Monkey scans.',
@ -50,3 +50,5 @@ export const fingerprinterClasses = {
] ]
} }
export default FINGERPRINTER_CLASSES;

View File

@ -1,12 +1,13 @@
export const icmpScanConfigurationSchema = { const ICMP_SCAN_CONFIGURATION_SCHEMA = {
'title': 'Ping scanner', 'title': 'Ping scanner',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
'timeout': { 'timeout': {
'format': 'float',
'title': 'Ping scan timeout', 'title': 'Ping scan timeout',
'type': 'number', 'type': 'number',
'description': 'Maximum time to wait for ping response' 'description': 'Maximum time to wait for ping response'
} }
} }
} }
export default ICMP_SCAN_CONFIGURATION_SCHEMA;

View File

@ -0,0 +1,22 @@
import ICMP_SCAN_CONFIGURATION_SCHEMA from './icmpScan.js';
import SCAN_TARGET_CONFIGURATION_SCHEMA from './scanTarget.js';
import FINGERPRINTER_CLASSES from './fingerprinterClasses';
import TCP_SCAN_CONFIGURATION_SCHEMA from './tcpScan';
const NETWORK_SCAN_CONFIGURATION_SCHEMA = {
'title': 'Network analysis',
'type': 'object',
'properties': {
'fingerprinters': {
'title': 'Fingerprinters',
'type': 'array',
'uniqueItems': true,
'items': FINGERPRINTER_CLASSES
},
'icmp': ICMP_SCAN_CONFIGURATION_SCHEMA,
'targets': SCAN_TARGET_CONFIGURATION_SCHEMA,
'tcp': TCP_SCAN_CONFIGURATION_SCHEMA
}
}
export default NETWORK_SCAN_CONFIGURATION_SCHEMA;

View File

@ -1,11 +1,13 @@
import {exploitationConfigurationSchema} from './exploitation.js'; import NETWORK_SCAN_CONFIGURATION_SCHEMA from './networkScan.js';
import {networkScanConfigurationSchema} from './network_scan.js'; import CREDENTIALS from './credentials';
import EXPLOITATION_CONFIGURATION_SCHEMA from './exploitation';
export const propagationConfigurationSchema = { const PROPAGATION_CONFIGURATION_SCHEMA = {
'title': 'Propagation', 'title': 'Propagation',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
'exploitation': exploitationConfigurationSchema, 'exploitation': EXPLOITATION_CONFIGURATION_SCHEMA,
'credentials': CREDENTIALS,
'maximum_depth': { 'maximum_depth': {
'title': 'Maximum scan depth', 'title': 'Maximum scan depth',
'type': 'integer', 'type': 'integer',
@ -18,6 +20,7 @@ export const propagationConfigurationSchema = {
'Monkey propagating too far, '+ 'Monkey propagating too far, '+
'if the "Local network scan" is enabled' 'if the "Local network scan" is enabled'
}, },
'network_scan': networkScanConfigurationSchema 'network_scan': NETWORK_SCAN_CONFIGURATION_SCHEMA
} }
} }
export default PROPAGATION_CONFIGURATION_SCHEMA;

View File

@ -1,4 +1,4 @@
export const scanTargetConfigurationSchema = { const SCAN_TARGET_CONFIGURATION_SCHEMA = {
'title': 'Network', 'title': 'Network',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
@ -68,3 +68,4 @@ export const scanTargetConfigurationSchema = {
} }
} }
export default SCAN_TARGET_CONFIGURATION_SCHEMA;

View File

@ -1,4 +1,4 @@
export const tcpScanConfigurationSchema = { const TCP_SCAN_CONFIGURATION_SCHEMA = {
'title': 'TCP scanner', 'title': 'TCP scanner',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
@ -13,9 +13,9 @@ export const tcpScanConfigurationSchema = {
}, },
'timeout': { 'timeout': {
'title': 'TCP scan timeout', 'title': 'TCP scan timeout',
'format': 'float',
'type': 'number', 'type': 'number',
'description': 'Maximum time to wait for TCP response.' 'description': 'Maximum time to wait for TCP response.'
} }
} }
} }
export default TCP_SCAN_CONFIGURATION_SCHEMA;

View File

@ -1,4 +1,4 @@
export const ransomwareSchema = { const RANSOMWARE_SCHEMA = {
'title': 'Payloads', 'title': 'Payloads',
'properties': { 'properties': {
'encryption': { 'encryption': {
@ -63,3 +63,5 @@ export const ransomwareSchema = {
} }
} }
} }
export default RANSOMWARE_SCHEMA;