diff --git a/monkey/monkey_island/cc/server_config.json b/monkey/monkey_island/cc/server_config.json index dc06aac82..a1f339740 100644 --- a/monkey/monkey_island/cc/server_config.json +++ b/monkey/monkey_island/cc/server_config.json @@ -1,4 +1,6 @@ { - "server_config": "standard", - "deployment": "develop" + "server_config": "password", + "deployment": "develop", + "user": "vakaris", + "password_hash": "9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7b710110c0a678288166e7fbe796883a4f2e9b3ca9f484f521d0ce464345cc1aec96779149c14" } \ No newline at end of file diff --git a/monkey/monkey_island/cc/ui/package-lock.json b/monkey/monkey_island/cc/ui/package-lock.json index b317e47fa..1a66ea551 100644 --- a/monkey/monkey_island/cc/ui/package-lock.json +++ b/monkey/monkey_island/cc/ui/package-lock.json @@ -1352,6 +1352,11 @@ "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.36.tgz", "integrity": "sha512-7TUK/k2/QGpEAv/BCwSHlYu3NXZhQ9ZwBYpzr9tjlPIL2C5BeGhH3DmVavRx3ZNyELX5TLC91JTz/cen6AAtIQ==" }, + "@types/json-schema": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", + "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==" + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -7578,11 +7583,26 @@ "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", "integrity": "sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o=" }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, + "lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" + }, "lodash.restparam": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" }, + "lodash.topath": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.topath/-/lodash.topath-4.5.2.tgz", + "integrity": "sha1-NhY1Hzu6YZlKCTGYlmC9AyVP0Ak=" + }, "lodash.union": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", @@ -10561,6 +10581,25 @@ "shortid": "2.2.15" } }, + "react-jsonschema-form-bs4": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/react-jsonschema-form-bs4/-/react-jsonschema-form-bs4-1.7.1.tgz", + "integrity": "sha512-0SYhkHi9AByWsnE7lVokesFEpcb52QCCeHrhgvFO7lJ9IX6CBTr0ewjj7uERWY5OdWoCLA+tPcqO6RhA0R9TWQ==", + "requires": { + "@babel/runtime-corejs2": "7.9.6", + "@types/json-schema": "7.0.5", + "@types/react": "16.9.35", + "ajv": "6.12.2", + "core-js": "2.6.11", + "lodash.get": "4.4.2", + "lodash.pick": "4.4.0", + "lodash.topath": "4.5.2", + "prop-types": "15.7.2", + "react-is": "16.13.1", + "react-lifecycles-compat": "3.0.4", + "shortid": "2.2.15" + } + }, "react-lifecycles-compat": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", diff --git a/monkey/monkey_island/cc/ui/package.json b/monkey/monkey_island/cc/ui/package.json index 6e68e6762..3858a46c8 100644 --- a/monkey/monkey_island/cc/ui/package.json +++ b/monkey/monkey_island/cc/ui/package.json @@ -93,6 +93,7 @@ "react-hot-loader": "^4.12.20", "react-json-tree": "^0.11.2", "react-jsonschema-form": "^1.8.0", + "react-jsonschema-form-bs4": "^1.7.1", "react-particles-js": "^3.2.1", "react-redux": "^5.1.2", "react-router-dom": "^4.3.1", diff --git a/monkey/monkey_island/cc/ui/src/components/Main.js b/monkey/monkey_island/cc/ui/src/components/Main.js index 7efe20179..43971c6c9 100644 --- a/monkey/monkey_island/cc/ui/src/components/Main.js +++ b/monkey/monkey_island/cc/ui/src/components/Main.js @@ -127,53 +127,51 @@ class AppComponent extends AuthComponent { return ( - - - ()}/> - ()}/> - {this.renderRoute('/', - , - true)} - {this.renderRoute('/configure', - )} - {this.renderRoute('/run-monkey', - )} - {this.renderRoute('/infection/map', - )} - {this.renderRoute('/infection/telemetry', - )} - {this.renderRoute('/start-over', - )} - {this.redirectTo('/report', '/report/security')} - {this.renderRoute('/report/security', - )} - {this.renderRoute('/report/attack', - )} - {this.renderRoute('/report/zeroTrust', - )} - {this.renderRoute('/license', - )} - - - + + ()}/> + ()}/> + {this.renderRoute('/', + , + true)} + {this.renderRoute('/configure', + )} + {this.renderRoute('/run-monkey', + )} + {this.renderRoute('/infection/map', + )} + {this.renderRoute('/infection/telemetry', + )} + {this.renderRoute('/start-over', + )} + {this.redirectTo('/report', '/report/security')} + {this.renderRoute('/report/security', + )} + {this.renderRoute('/report/attack', + )} + {this.renderRoute('/report/zeroTrust', + )} + {this.renderRoute('/license', + )} + + ); diff --git a/monkey/monkey_island/cc/ui/src/components/SideNavComponent.js b/monkey/monkey_island/cc/ui/src/components/SideNavComponent.js index d4365ac9e..4fcc0f04c 100644 --- a/monkey/monkey_island/cc/ui/src/components/SideNavComponent.js +++ b/monkey/monkey_island/cc/ui/src/components/SideNavComponent.js @@ -14,7 +14,7 @@ class SideNavComponent extends React.Component { render() { return ( - + <>
logo Infection Monkey @@ -26,7 +26,7 @@ class SideNavComponent extends React.Component { 1. Run Monkey Island Server {this.props.completedSteps.run_server ? - + : ''} @@ -35,7 +35,7 @@ class SideNavComponent extends React.Component { 2. Run Monkey {this.props.completedSteps.run_monkey ? - + : ''} @@ -44,7 +44,7 @@ class SideNavComponent extends React.Component { 3. Infection Map {this.props.completedSteps.infection_done ? - + : ''} @@ -58,7 +58,7 @@ class SideNavComponent extends React.Component { 4. Security Reports {this.props.completedSteps.report_done ? - + : ''} @@ -87,7 +87,7 @@ class SideNavComponent extends React.Component { License
- ) + ) } } diff --git a/monkey/monkey_island/cc/ui/src/components/attack/techniques/MitigationsComponent.js b/monkey/monkey_island/cc/ui/src/components/attack/techniques/MitigationsComponent.js index 3e950be56..86d32c0e7 100644 --- a/monkey/monkey_island/cc/ui/src/components/attack/techniques/MitigationsComponent.js +++ b/monkey/monkey_island/cc/ui/src/components/attack/techniques/MitigationsComponent.js @@ -1,7 +1,6 @@ import React from 'react'; import ReactTable from 'react-table'; import marked from 'marked'; -import '../../../styles/report/AttackReport.scss'; class MitigationsComponent extends React.Component { diff --git a/monkey/monkey_island/cc/ui/src/components/layouts/StandardLayoutComponent.js b/monkey/monkey_island/cc/ui/src/components/layouts/StandardLayoutComponent.js index 832341842..1819f67bb 100644 --- a/monkey/monkey_island/cc/ui/src/components/layouts/StandardLayoutComponent.js +++ b/monkey/monkey_island/cc/ui/src/components/layouts/StandardLayoutComponent.js @@ -1,13 +1,15 @@ import React from 'react' import {Route} from 'react-router-dom' import SideNavComponent from '../SideNavComponent' -import {Col} from 'react-bootstrap'; +import {Col, Row} from 'react-bootstrap'; export const StandardLayoutComponent = ({component: Component, ...rest}) => ( ( - - + + + + - - )}/> + + )}/> ) diff --git a/monkey/monkey_island/cc/ui/src/components/map/preview-pane/PreviewPane.js b/monkey/monkey_island/cc/ui/src/components/map/preview-pane/PreviewPane.js index 4f37b5fd6..dcb64f4d8 100644 --- a/monkey/monkey_island/cc/ui/src/components/map/preview-pane/PreviewPane.js +++ b/monkey/monkey_island/cc/ui/src/components/map/preview-pane/PreviewPane.js @@ -1,6 +1,7 @@ import React from 'react'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faHandPointLeft } from '@fortawesome/free-solid-svg-icons/faHandPointLeft' +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome' +import {faHandPointLeft} from '@fortawesome/free-solid-svg-icons/faHandPointLeft' +import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons/faQuestionCircle' import Toggle from 'react-toggle'; import {OverlayTrigger, Tooltip} from 'react-bootstrap'; import download from 'downloadjs' @@ -10,8 +11,10 @@ class PreviewPaneComponent extends AuthComponent { generateToolTip(text) { return ( - {text}}> - + {text}} + delay={{ show: 250, hide: 400 }}> + ); } diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index 87fd1ace6..ddea94df8 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -1,11 +1,15 @@ import React from 'react'; -import Form from 'react-jsonschema-form'; -import {Col, Modal, Nav, NavItem} from 'react-bootstrap'; +import Form from 'react-jsonschema-form-bs4'; +import {Col, Modal, Nav, Button} from 'react-bootstrap'; import FileSaver from 'file-saver'; import AuthComponent from '../AuthComponent'; import {FilePond} from 'react-filepond'; import 'filepond/dist/filepond.min.css'; import ConfigMatrixComponent from '../attack/ConfigMatrixComponent'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faInfoCircle} from "@fortawesome/free-solid-svg-icons/faInfoCircle"; +import {faCheck} from "@fortawesome/free-solid-svg-icons/faCheck"; +import {faExclamationCircle} from "@fortawesome/free-solid-svg-icons/faExclamationCircle"; const ATTACK_URL = '/api/attack'; const CONFIG_URL = '/api/configuration/island'; @@ -169,8 +173,8 @@ class ConfigurePageComponent extends AuthComponent { this.setInitialConfig(res.configuration); this.props.onStatusChange(); }).catch(error => { - console.log('Bad configuration: ' + error.toString()); - this.setState({lastAction: 'invalid_configuration'}); + console.log('Bad configuration: ' + error.toString()); + this.setState({lastAction: 'invalid_configuration'}); }); }; @@ -225,14 +229,15 @@ class ConfigurePageComponent extends AuthComponent { You have unsubmitted changes. Submit them before proceeding.

- +
) @@ -452,7 +457,8 @@ class ConfigurePageComponent extends AuthComponent { uiSchema={this.uiSchemas[this.state.selectedSection]} formData={this.state.configuration[this.state.selectedSection]} onChange={this.onChange} - noValidate={true}> + noValidate={true} + className={'config-form'}> ) @@ -461,7 +467,7 @@ class ConfigurePageComponent extends AuthComponent { renderBasicNetworkWarning = () => { if (this.state.selectedSection === 'basic_network') { return (
- + The Monkey scans its subnet if "Local network scan" is ticked. Additionally the monkey scans machines according to its range class.
) @@ -471,10 +477,15 @@ class ConfigurePageComponent extends AuthComponent { }; renderNav = () => { - return () }; @@ -491,7 +502,9 @@ class ConfigurePageComponent extends AuthComponent { content = this.renderConfigContent(displayedSchema) } return ( - + {this.renderAttackAlertModal()}

Monkey Configuration

{this.renderNav()} @@ -509,7 +522,8 @@ class ConfigurePageComponent extends AuthComponent { className="btn btn-info btn-lg" style={{margin: '5px'}}> Import Config - + @@ -517,31 +531,31 @@ class ConfigurePageComponent extends AuthComponent {
{this.state.lastAction === 'reset' ?
- + Configuration reset successfully.
: ''} {this.state.lastAction === 'saved' ?
- + Configuration saved successfully.
: ''} {this.state.lastAction === 'import_failure' ?
- + Failed importing configuration. Invalid config file.
: ''} {this.state.lastAction === 'invalid_configuration' ?
- + An invalid configuration file was imported or submitted.
: ''} {this.state.lastAction === 'import_success' ?
- + Configuration imported successfully.
: ''} diff --git a/monkey/monkey_island/cc/ui/src/components/pages/LicensePage.js b/monkey/monkey_island/cc/ui/src/components/pages/LicensePage.js index 4d9766418..3fc29649b 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/LicensePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/LicensePage.js @@ -1,6 +1,8 @@ import React from 'react'; import {Col} from 'react-bootstrap'; -import rainge from 'rainge' +import rainge from 'rainge'; +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; +import {faCopyright} from "@fortawesome/free-regular-svg-icons"; class LicensePageComponent extends React.Component { constructor(props) { @@ -15,11 +17,13 @@ class LicensePageComponent extends React.Component { render() { return ( - +

License

- Copyright {rainge(2015)} Guardicore Ltd. + Copyright {rainge(2015)} Guardicore Ltd.
Licensed under GPLv3.

diff --git a/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js b/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js index dc2406802..c37f5d92a 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js @@ -55,9 +55,11 @@ class LoginPageComponent extends React.Component { render() { return ( - +

Login

-
+
Login diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js index 909659e87..3c2bbf09b 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -1,8 +1,6 @@ -import '../../styles/report/ReportPage.scss'; - import React from 'react'; import {Route} from 'react-router-dom'; -import {Col, Nav, NavItem} from 'react-bootstrap'; +import {Col, Nav} from 'react-bootstrap'; import AuthComponent from '../AuthComponent'; import MustRunMonkeyWarning from '../report-components/common/MustRunMonkeyWarning'; import AttackReport from '../report-components/AttackReport' @@ -30,10 +28,10 @@ class ReportPageComponent extends AuthComponent { }; } - static selectReport(reports){ + static selectReport(reports) { let url = window.location.href; - for (let report_name in reports){ - if (reports.hasOwnProperty(report_name) && url.endsWith(reports[report_name])){ + for (let report_name in reports) { + if (reports.hasOwnProperty(report_name) && url.endsWith(reports[report_name])) { return reports[report_name]; } } @@ -109,24 +107,32 @@ class ReportPageComponent extends AuthComponent { renderNav = () => { return ( ( - )}/>) + )}/>) }; renderNavButton = (section) => { return ( - {}}> + + { + }}> {section.title} - )}; + + ) + }; getReportContent() { - switch(this.state.selectedSection){ + switch (this.state.selectedSection) { case 'security': return (); case 'attack': @@ -145,7 +151,9 @@ class ReportPageComponent extends AuthComponent { content = ; } return ( - +

4. Security Reports

{this.renderNav()} diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index a741148fb..366d9860a 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js @@ -1,19 +1,21 @@ import React from 'react'; import {css} from '@emotion/core'; -import {Button, Col, Well, Nav, NavItem, Collapse} from 'react-bootstrap'; +import {Button, Col, Card, Nav, Collapse} from 'react-bootstrap'; import CopyToClipboard from 'react-copy-to-clipboard'; import GridLoader from 'react-spinners/GridLoader'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faClipboard } from '@fortawesome/free-solid-svg-icons/faClipboard'; -import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck'; -import { faSync } from '@fortawesome/free-solid-svg-icons/faSync'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faClipboard} from '@fortawesome/free-solid-svg-icons/faClipboard'; +import {faCheck} from '@fortawesome/free-solid-svg-icons/faCheck'; +import {faSync} from '@fortawesome/free-solid-svg-icons/faSync'; import {Link} from 'react-router-dom'; import AuthComponent from '../AuthComponent'; import AwsRunTable from '../run-monkey/AwsRunTable'; import '../../styles/MonkeyRunPage.scss'; +import {faInfoCircle} from "@fortawesome/free-solid-svg-icons/faInfoCircle"; +import {faExclamationTriangle} from "@fortawesome/free-solid-svg-icons/faExclamationTriangle"; const loading_css_override = css` display: block; @@ -149,7 +151,7 @@ class RunMonkeyPageComponent extends AuthComponent { cmdText = RunMonkeyPageComponent.generateWindowsCmd(this.state.selectedIp, is32Bit); } return ( - +
-
+ ) } @@ -253,7 +255,7 @@ class RunMonkeyPageComponent extends AuthComponent {

- + Not sure what this is? Not seeing your AWS EC2 instances? Read the documentation! @@ -261,9 +263,9 @@ class RunMonkeyPageComponent extends AuthComponent {

{ this.state.ips.length > 1 ? - :
} @@ -273,13 +275,14 @@ class RunMonkeyPageComponent extends AuthComponent { ref={r => (this.awsTable = r)} />
- + {this.state.awsClicked ? + : null} +
) @@ -287,20 +290,23 @@ class RunMonkeyPageComponent extends AuthComponent { render() { return ( - +

2. Run the Monkey

Go ahead and run the monkey! (Or configure the monkey to fine tune its behavior)

-

- + { // TODO: implement button functionality /* @@ -317,11 +323,14 @@ class RunMonkeyPageComponent extends AuthComponent {

OR

-

- +

@@ -329,17 +338,34 @@ class RunMonkeyPageComponent extends AuthComponent { Choose the operating system where you want to run the monkey {this.state.ips.length > 1 ? ', and the interface to communicate with.' : '.'}

-