Add warning to unsafe config values

This commit is contained in:
Itay Mizeretz 2017-10-04 16:01:01 +03:00
parent 6197f4253e
commit ff4c68f94c
2 changed files with 10 additions and 5 deletions

View File

@ -6,6 +6,8 @@ from cc.utils import local_ip_addresses
__author__ = "itay.mizeretz" __author__ = "itay.mizeretz"
WARNING_SIGN = u" \u26A0"
SCHEMA = { SCHEMA = {
"title": "Monkey", "title": "Monkey",
"type": "object", "type": "object",
@ -189,7 +191,7 @@ SCHEMA = {
"description": "Determines whether monkey should scan its subnets additionally" "description": "Determines whether monkey should scan its subnets additionally"
}, },
"depth": { "depth": {
"title": "Depth", "title": "Depth" + WARNING_SIGN,
"type": "integer", "type": "integer",
"default": 2, "default": 2,
"description": "Amount of hops allowed for the monkey to spread" "description": "Amount of hops allowed for the monkey to spread"
@ -294,7 +296,7 @@ SCHEMA = {
"description": "Determines after how many discovered machines should the monkey stop scanning" "description": "Determines after how many discovered machines should the monkey stop scanning"
}, },
"victims_max_exploit": { "victims_max_exploit": {
"title": "Max victims to exploit", "title": "Max victims to exploit" + WARNING_SIGN,
"type": "integer", "type": "integer",
"default": 7, "default": 7,
"description": "Determines after how many infected machines should the monkey stop infecting" "description": "Determines after how many infected machines should the monkey stop infecting"
@ -371,7 +373,7 @@ SCHEMA = {
"description": "Determines which classes to use for fingerprinting" "description": "Determines which classes to use for fingerprinting"
}, },
"exploiter_classes": { "exploiter_classes": {
"title": "Exploiter classes", "title": "Exploiter classes" + WARNING_SIGN,
"type": "array", "type": "array",
"uniqueItems": True, "uniqueItems": True,
"items": { "items": {

View File

@ -109,7 +109,6 @@ class ConfigurePageComponent extends React.Component {
return ( return (
<Col xs={8}> <Col xs={8}>
<h1 className="page-title">Monkey Configuration</h1> <h1 className="page-title">Monkey Configuration</h1>
<Nav bsStyle="tabs" justified <Nav bsStyle="tabs" justified
activeKey={this.state.selectedSection} onSelect={this.setSelectedSection} activeKey={this.state.selectedSection} onSelect={this.setSelectedSection}
style={{'marginBottom': '2em'}}> style={{'marginBottom': '2em'}}>
@ -126,7 +125,11 @@ class ConfigurePageComponent extends React.Component {
<div> <div>
<div className="alert alert-info"> <div className="alert alert-info">
<i className="glyphicon glyphicon-info-sign" style={{'marginRight': '5px'}}/> <i className="glyphicon glyphicon-info-sign" style={{'marginRight': '5px'}}/>
This configuration will only apply to new infections. Changing the configuration will only apply to new infections.
</div>
<div className="alert alert-warning">
<i className="glyphicon glyphicon-warning-sign" style={{'marginRight': '5px'}}/>
Changing config values with the &#9888; mark may result in the monkey propagating too far or using dangerous exploits.
</div> </div>
<div className="text-center"> <div className="text-center">
<button type="submit" className="btn btn-success btn-lg" style={{margin: '5px'}}> <button type="submit" className="btn btn-success btn-lg" style={{margin: '5px'}}>