Merge pull request #1322 from guardicore/1241/ransomware-quickstart-hide-run-scoutsuite

Ransomware quickstart - Hide scoutsuite run options in ransomware mode
This commit is contained in:
Mike Salvatore 2021-07-14 14:29:41 -04:00 committed by GitHub
commit fb7a615766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View File

@ -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',
<StandardLayoutComponent component={RunMonkeyPage}
islandMode={this.state.islandMode}
onStatusChange={this.updateStatus}
completedSteps={this.state.completedSteps}/>)}
{this.renderRoute('/infection/map',

View File

@ -17,7 +17,7 @@ class RunMonkeyPageComponent extends AuthComponent {
Go ahead and run the monkey!
<i> (Or <Link to="/configure">configure the monkey</Link> to fine tune its behavior)</i>
</p>
<RunOptions />
<RunOptions islandMode={this.props.islandMode}/>
</Col>
);
}

View File

@ -56,7 +56,11 @@ function RunOptions(props) {
return InlineSelection(defaultContents, newProps);
}
function defaultContents() {
function shouldShowScoutsuite(islandMode){
return islandMode !== 'ransomware';
}
function defaultContents(props) {
return (
<>
<RunOnIslandButton title={'From Island'}
@ -69,14 +73,15 @@ function RunOptions(props) {
setComponent(LocalManualRunOptions,
{ips: ips, setComponent: setComponent})
}}/>
<AWSRunButton setComponent={setComponent}/>
<NextSelectionButton title={'Cloud security scan'}
{shouldShowScoutsuite(props.islandMode) && <AWSRunButton setComponent={setComponent}/> }
{shouldShowScoutsuite(props.islandMode) && <NextSelectionButton title={'Cloud security scan'}
description={'Explains how to enable cloud security scan.'}
icon={faCloud}
onButtonClick={() => {
setComponent(CloudOptions,
{ips: ips, setComponent: setComponent})
}}/>
}
</>
);
}