forked from p34709852/monkey
Added client error as error and formatted error message in site as alert-warning
This commit is contained in:
parent
e4e2948941
commit
a38b5cf360
|
@ -1,6 +1,6 @@
|
|||
import json
|
||||
|
||||
from botocore.exceptions import NoCredentialsError
|
||||
from botocore.exceptions import NoCredentialsError, ClientError
|
||||
from flask import request, jsonify, make_response
|
||||
import flask_restful
|
||||
|
||||
|
@ -32,6 +32,10 @@ class RemoteRun(flask_restful.Resource):
|
|||
# Probably, role hasn't been defined.
|
||||
resp['error'] = e.message
|
||||
return jsonify(resp)
|
||||
except ClientError as e:
|
||||
# Probably, role doesn't allow SSM.
|
||||
resp['error'] = e.message
|
||||
return jsonify(resp)
|
||||
return jsonify(resp)
|
||||
|
||||
return {}
|
||||
|
|
|
@ -473,10 +473,10 @@ class RunMonkeyPageComponent extends AuthComponent {
|
|||
{
|
||||
this.state.isErrorWhileCollectingAwsMachines ?
|
||||
<div style={{'marginTop': '1em'}}>
|
||||
<p>
|
||||
Error while collecting AWS machine data. Error message: {this.state.awsMachineCollectionErrorMsg}
|
||||
|
||||
Are you sure you've set the correct role? Not sure what this is? Not seeing your AWS EC2 instances? <a href="https://github.com/guardicore/monkey/wiki/Monkey-Island:-Running-the-monkey-on-AWS-EC2-instances">Read the documentation</a>!
|
||||
<p class="alert alert-warning">
|
||||
Error while collecting AWS machine data. Error message: <code>{this.state.awsMachineCollectionErrorMsg}</code><br/>
|
||||
Are you sure you've set the correct role on your Island AWS machine?<br/>
|
||||
Not sure what this is? <a href="https://github.com/guardicore/monkey/wiki/Monkey-Island:-Running-the-monkey-on-AWS-EC2-instances">Read the documentation</a>!
|
||||
</p>
|
||||
</div>
|
||||
:
|
||||
|
|
Loading…
Reference in New Issue