+
+ );
+ }
+}
+
+export default LoginPageComponent;
diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js
index ba5a655b1..4a54aeb8c 100644
--- a/monkey_island/cc/ui/src/components/pages/MapPage.js
+++ b/monkey_island/cc/ui/src/components/pages/MapPage.js
@@ -6,8 +6,9 @@ import PreviewPane from 'components/map/preview-pane/PreviewPane';
import {ReactiveGraph} from 'components/reactive-graph/ReactiveGraph';
import {ModalContainer, ModalDialog} from 'react-modal-dialog';
import {options, edgeGroupToColor} from 'components/map/MapOptions';
+import AuthComponent from '../AuthComponent';
-class MapPageComponent extends React.Component {
+class MapPageComponent extends AuthComponent {
constructor(props) {
super(props);
this.state = {
@@ -40,7 +41,7 @@ class MapPageComponent extends React.Component {
};
updateMapFromServer = () => {
- fetch('/api/netmap')
+ this.authFetch('/api/netmap')
.then(res => res.json())
.then(res => {
res.edges.forEach(edge => {
@@ -52,7 +53,7 @@ class MapPageComponent extends React.Component {
};
updateTelemetryFromServer = () => {
- fetch('/api/telemetry-feed?timestamp='+this.state.telemetryLastTimestamp)
+ this.authFetch('/api/telemetry-feed?timestamp='+this.state.telemetryLastTimestamp)
.then(res => res.json())
.then(res => {
let newTelem = this.state.telemetry.concat(res['telemetries']);
@@ -68,7 +69,7 @@ class MapPageComponent extends React.Component {
selectionChanged(event) {
if (event.nodes.length === 1) {
- fetch('/api/netmap/node?id=' + event.nodes[0])
+ this.authFetch('/api/netmap/node?id=' + event.nodes[0])
.then(res => res.json())
.then(res => this.setState({selected: res, selectedType: 'node'}));
}
@@ -80,7 +81,7 @@ class MapPageComponent extends React.Component {
if (displayedEdge['group'] === 'island') {
this.setState({selected: displayedEdge, selectedType: 'island_edge'});
} else {
- fetch('/api/netmap/edge?id=' + event.edges[0])
+ this.authFetch('/api/netmap/edge?id=' + event.edges[0])
.then(res => res.json())
.then(res => this.setState({selected: res.edge, selectedType: 'edge'}));
}
@@ -91,7 +92,7 @@ class MapPageComponent extends React.Component {
}
killAllMonkeys = () => {
- fetch('/api?action=killall')
+ this.authFetch('/api?action=killall')
.then(res => res.json())
.then(res => this.setState({killPressed: (res.status === 'OK')}));
};
diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js
index 440000596..56c2c3881 100644
--- a/monkey_island/cc/ui/src/components/pages/ReportPage.js
+++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js
@@ -7,11 +7,12 @@ import {edgeGroupToColor, options} from 'components/map/MapOptions';
import StolenPasswords from 'components/report-components/StolenPasswords';
import CollapsibleWellComponent from 'components/report-components/CollapsibleWell';
import {Line} from 'rc-progress';
+import AuthComponent from '../AuthComponent';
let guardicoreLogoImage = require('../../images/guardicore-logo.png');
let monkeyLogoImage = require('../../images/monkey-icon.svg');
-class ReportPageComponent extends React.Component {
+class ReportPageComponent extends AuthComponent {
Issue =
{
@@ -76,7 +77,7 @@ class ReportPageComponent extends React.Component {
}
updateMonkeysRunning = () => {
- return fetch('/api')
+ return this.authFetch('/api')
.then(res => res.json())
.then(res => {
// This check is used to prevent unnecessary re-rendering
@@ -89,7 +90,7 @@ class ReportPageComponent extends React.Component {
};
updateMapFromServer = () => {
- fetch('/api/netmap')
+ this.authFetch('/api/netmap')
.then(res => res.json())
.then(res => {
res.edges.forEach(edge => {
@@ -102,7 +103,7 @@ class ReportPageComponent extends React.Component {
getReportFromServer(res) {
if (res['completed_steps']['run_monkey']) {
- fetch('/api/report')
+ this.authFetch('/api/report')
.then(res => res.json())
.then(res => {
this.setState({
@@ -610,7 +611,7 @@ class ReportPageComponent extends React.Component {
The network can probably be segmented. A monkey instance on {issue.machine} in the
networks {this.generateInfoBadges(issue.networks)}
- could directly access the Monkey Island C&C server in the
+ could directly access the Monkey Island server in the
networks {this.generateInfoBadges(issue.server_networks)}.
diff --git a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js
index 5574a73ba..4543a5c34 100644
--- a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js
+++ b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js
@@ -3,8 +3,9 @@ import {Button, Col, Well, Nav, NavItem, Collapse} from 'react-bootstrap';
import CopyToClipboard from 'react-copy-to-clipboard';
import {Icon} from 'react-fa';
import {Link} from 'react-router-dom';
+import AuthComponent from '../AuthComponent';
-class RunMonkeyPageComponent extends React.Component {
+class RunMonkeyPageComponent extends AuthComponent {
constructor(props) {
super(props);
@@ -19,14 +20,14 @@ class RunMonkeyPageComponent extends React.Component {
}
componentDidMount() {
- fetch('/api')
+ this.authFetch('/api')
.then(res => res.json())
.then(res => this.setState({
ips: res['ip_addresses'],
selectedIp: res['ip_addresses'][0]
}));
- fetch('/api/local-monkey')
+ this.authFetch('/api/local-monkey')
.then(res => res.json())
.then(res =>{
if (res['is_running']) {
@@ -36,7 +37,7 @@ class RunMonkeyPageComponent extends React.Component {
}
});
- fetch('/api/client-monkey')
+ this.authFetch('/api/client-monkey')
.then(res => res.json())
.then(res => {
if (res['is_running']) {
@@ -60,7 +61,7 @@ class RunMonkeyPageComponent extends React.Component {
}
runLocalMonkey = () => {
- fetch('/api/local-monkey',
+ this.authFetch('/api/local-monkey',
{
method: 'POST',
headers: {'Content-Type': 'application/json'},
@@ -146,7 +147,7 @@ class RunMonkeyPageComponent extends React.Component {
className="btn btn-default btn-lg center-block"
disabled={this.state.runningOnIslandState !== 'not_running'}
>
- Run on C&C Server
+ Run on Monkey Island Server
{ this.renderIconByState(this.state.runningOnIslandState) }
{
diff --git a/monkey_island/cc/ui/src/components/pages/RunServerPage.js b/monkey_island/cc/ui/src/components/pages/RunServerPage.js
index 5143f24fc..1ad890845 100644
--- a/monkey_island/cc/ui/src/components/pages/RunServerPage.js
+++ b/monkey_island/cc/ui/src/components/pages/RunServerPage.js
@@ -10,17 +10,19 @@ class RunServerPageComponent extends React.Component {
render() {
return (
-
1. Monkey Island C&C Server
+
1. Monkey Island Server
-
Congrats! You have successfully set up the Monkey Island server. 👏 👏
+
Congrats! You have successfully set up the Monkey Island
+ server. 👏 👏
The Infection Monkey is an open source security tool for testing a data center's resiliency to perimeter
breaches and internal server infections.
The Monkey uses various methods to propagate across a data
- center and reports to this Command and Control (C&C) server.
+ center and reports to this Monkey Island Command and Control server.