diff --git a/monkey/monkey_island/cc/ui/src/components/Main.js b/monkey/monkey_island/cc/ui/src/components/Main.js index dc1e063ff..c068b9caf 100644 --- a/monkey/monkey_island/cc/ui/src/components/Main.js +++ b/monkey/monkey_island/cc/ui/src/components/Main.js @@ -27,6 +27,7 @@ import {StandardLayoutComponent} from './layouts/StandardLayoutComponent'; import LoadingScreen from './ui-components/LoadingScreen'; const reportZeroTrustRoute = '/report/zeroTrust'; +const islandModeRoute = '/api/island-mode' class AppComponent extends AuthComponent { updateStatus = () => { @@ -113,15 +114,26 @@ class AppComponent extends AuthComponent { infection_done: false, report_done: false, isLoggedIn: undefined, - needsRegistration: undefined + needsRegistration: undefined, + islandMode: undefined }, noAuthLoginAttempted: undefined }; } + updateIslandMode() { + this.authFetch(islandModeRoute) + .then(res => res.json()) + .then(res => { + this.setState({islandMode: res.mode}) + } + ); + } + componentDidMount() { this.updateStatus(); this.interval = setInterval(this.updateStatus, 10000); + this.updateIslandMode() } componentWillUnmount() { @@ -147,6 +159,7 @@ class AppComponent extends AuthComponent { completedSteps={this.state.completedSteps}/>)} {this.renderRoute('/run-monkey', )} {this.renderRoute('/infection/map', diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunMonkeyPage.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunMonkeyPage.js index 2a27c5be3..b87c118f9 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunMonkeyPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunMonkeyPage.js @@ -17,7 +17,7 @@ class RunMonkeyPageComponent extends AuthComponent { Go ahead and run the monkey! (Or configure the monkey to fine tune its behavior)

- + ); } 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 db8ca17f6..1cc2aed7b 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 @@ -56,7 +56,11 @@ function RunOptions(props) { return InlineSelection(defaultContents, newProps); } - function defaultContents() { + function shouldShowScoutsuite(islandMode){ + return islandMode !== 'ransomware'; + } + + function defaultContents(props) { return ( <> - - } + {shouldShowScoutsuite(props.islandMode) && { setComponent(CloudOptions, {ips: ips, setComponent: setComponent}) }}/> + } ); }