From c3fde1898c0124c57841b15bcbc3799a27bf32b5 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Mon, 21 Sep 2020 11:05:20 +0300 Subject: [PATCH] Added ScoutSuite scan setup guide to run monkey page. --- .../pages/RunMonkeyPage/RunOptions.js | 11 +++- .../scoutsuite-setup/AWSSetup.js | 56 +++++++++++++++++++ .../scoutsuite-setup/CloudOptions.js | 31 ++++++++++ .../inline-selection/InlineSelection.js | 3 +- .../ui-components/inline-selection/utils.js | 16 ++++++ .../components/scoutsuite/AWSSetup.scss | 17 ++++++ 6 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/scoutsuite-setup/AWSSetup.js create mode 100644 monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/scoutsuite-setup/CloudOptions.js create mode 100644 monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/utils.js create mode 100644 monkey/monkey_island/cc/ui/src/styles/components/scoutsuite/AWSSetup.scss diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js index a9fe1f8cf..fa724d6f6 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js @@ -5,8 +5,10 @@ import AuthComponent from '../../AuthComponent'; import {faLaptopCode} from '@fortawesome/free-solid-svg-icons/faLaptopCode'; import InlineSelection from '../../ui-components/inline-selection/InlineSelection'; import {cloneDeep} from 'lodash'; -import {faExpandArrowsAlt} from '@fortawesome/free-solid-svg-icons'; +import {faCloud, faExpandArrowsAlt} from '@fortawesome/free-solid-svg-icons'; import RunOnIslandButton from './RunOnIslandButton'; +import AWSSetup from './scoutsuite-setup/AWSSetup'; +import CloudOptions from './scoutsuite-setup/CloudOptions'; function RunOptions(props) { @@ -61,6 +63,13 @@ function RunOptions(props) { setComponent(LocalManualRunOptions, {ips: ips, setComponent: setComponent}) }}/> + { + setComponent(CloudOptions, + {ips: ips, setComponent: setComponent}) + }}/> ); } diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/scoutsuite-setup/AWSSetup.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/scoutsuite-setup/AWSSetup.js new file mode 100644 index 000000000..6c184aabd --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/scoutsuite-setup/AWSSetup.js @@ -0,0 +1,56 @@ +import {Button} from 'react-bootstrap'; +import React from 'react'; +import InlineSelection from '../../../ui-components/inline-selection/InlineSelection'; +import CloudOptions from './CloudOptions'; +import {COLUMN_SIZES} from '../../../ui-components/inline-selection/utils'; +import '../../../../styles/components/scoutsuite/AWSSetup.scss'; + +export default function AWSSetup(props) { + return InlineSelection(getContents, { + ...props, + collumnSize: COLUMN_SIZES.LARGE, + onBackButtonClick: () => { + props.setComponent(CloudOptions, props) + } + }) +} + + +const getContents = (props) => { + return ( +
+

ScoutSuite configuration for AWS

+

To assess your AWS infrastructure security do the following:

+
    +
  1. + 1. Configure AWS CLI on Monkey Island Server (if you already have a configured CLI you can skip this step). +
      +
    1. + 1. Download and + install it on Monkey Island server (machine running this page). +
    2. +
    3. + 2. Run aws configure. It's important to configure credentials, which + allows ScoutSuite to get information about your cloud configuration. The most trivial way to do so is to + provide . +
    4. +
    +
  2. +
  3. + 2. If you change the configuration, make sure not to disable AWS system info collector. +
  4. +
  5. + 3. Go back and run Monkey on the Island server. +
  6. +
  7. + 4. Assess results in Zero Trust report. +
  8. +
+
+ ); +} diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/scoutsuite-setup/CloudOptions.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/scoutsuite-setup/CloudOptions.js new file mode 100644 index 000000000..1605a0eaa --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/scoutsuite-setup/CloudOptions.js @@ -0,0 +1,31 @@ +import React from 'react'; +import InlineSelection from '../../../ui-components/inline-selection/InlineSelection'; +import NextSelectionButton from '../../../ui-components/inline-selection/NextSelectionButton'; +import {faCloud} from '@fortawesome/free-solid-svg-icons'; +import AWSSetup from './AWSSetup'; + + +const CloudOptions = (props) => { + return InlineSelection(getContents, { + ...props, + onBackButtonClick: () => { + props.setComponent() + } + }) +} + +const getContents = (props) => { + return ( + <> + { + props.setComponent(AWSSetup, + {setComponent: props.setComponent}) + }}/> + + ) +} + +export default CloudOptions; diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/InlineSelection.js b/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/InlineSelection.js index a699b7d7f..51bf341bd 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/InlineSelection.js +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/InlineSelection.js @@ -2,13 +2,14 @@ import React from 'react'; import PropTypes from 'prop-types'; import BackButton from './BackButton'; import {Col, Row, Container} from 'react-bootstrap'; +import {getColumnSize} from './utils'; export default function InlineSelection(WrappedComponent, props) { return ( - + {renderBackButton(props)} diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/utils.js b/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/utils.js new file mode 100644 index 000000000..16974f193 --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/inline-selection/utils.js @@ -0,0 +1,16 @@ +export const COLUMN_SIZES = { + LARGE: 'large', + STANDARD: 'standard', + SMALL: 'small' +} + + +export function getColumnSize (size) { + if(size === undefined || size === COLUMN_SIZES.STANDARD){ + return {lg: 9, md: 10, sm: 12} + } else if(size === COLUMN_SIZES.LARGE) { + return {lg: 12, md: 12, sm: 12} + } else if(size === COLUMN_SIZES.SMALL) { + return {lg: 7, md: 7, sm: 7} + } +} diff --git a/monkey/monkey_island/cc/ui/src/styles/components/scoutsuite/AWSSetup.scss b/monkey/monkey_island/cc/ui/src/styles/components/scoutsuite/AWSSetup.scss new file mode 100644 index 000000000..c1546ac81 --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/styles/components/scoutsuite/AWSSetup.scss @@ -0,0 +1,17 @@ +.aws-scoutsuite-configuration a{ + display: inline-block; + padding: 0 0 3px 0; +} + +.aws-scoutsuite-configuration ol{ + padding-left: 15px; + margin-bottom: 30px; +} + +.aws-scoutsuite-configuration ol.nested-ol{ + margin-bottom: 0; +} + +.aws-scoutsuite-configuration li{ + margin-bottom: 5px; +}