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..5fe6444d7 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 @@ -11,6 +11,7 @@ import AWSRunButton from './RunOnAWS/AWSRunButton'; import CloudOptions from './scoutsuite-setup/CloudOptions'; const CONFIG_URL = '/api/configuration/island'; +const MODE_URL = '/api/island-mode' function RunOptions(props) { @@ -56,6 +57,23 @@ function RunOptions(props) { return InlineSelection(defaultContents, newProps); } + function getIslandMode() { + let mode = ''; + authComponent.authFetch(MODE_URL) + .then(res => res.json()) + .then(res => { + mode = res.mode + } + ); + + if (mode === 'ransomware') { + return false; + } + else { + return true; + } + } + function defaultContents() { return ( <> @@ -69,14 +87,15 @@ function RunOptions(props) { setComponent(LocalManualRunOptions, {ips: ips, setComponent: setComponent}) }}/> - - } + {getIslandMode() && { setComponent(CloudOptions, {ips: ips, setComponent: setComponent}) }}/> + } ); }