forked from p34709852/monkey
ui improvements post review
This commit is contained in:
commit
eece8dd06d
|
@ -32,7 +32,7 @@ class Telemetry(flask_restful.Resource):
|
||||||
if timestamp:
|
if timestamp:
|
||||||
find_filter['timestamp'] = {'$gt': dateutil.parser.parse(timestamp)}
|
find_filter['timestamp'] = {'$gt': dateutil.parser.parse(timestamp)}
|
||||||
|
|
||||||
result['objects'] = [x for x in mongo.db.telemetry.find(find_filter)]
|
result['objects'] = self.telemetry_to_displayed_telemetry(mongo.db.telemetry.find(find_filter))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def post(self):
|
def post(self):
|
||||||
|
@ -60,6 +60,23 @@ class Telemetry(flask_restful.Resource):
|
||||||
|
|
||||||
return mongo.db.telemetry.find_one_or_404({"_id": telem_id})
|
return mongo.db.telemetry.find_one_or_404({"_id": telem_id})
|
||||||
|
|
||||||
|
def telemetry_to_displayed_telemetry(self, telemetry):
|
||||||
|
monkey_guid_dict = {}
|
||||||
|
monkeys = mongo.db.monkey.find({})
|
||||||
|
for monkey in monkeys:
|
||||||
|
monkey_guid_dict[monkey["guid"]] = NodeService.get_monkey_label(monkey)
|
||||||
|
|
||||||
|
objects = []
|
||||||
|
for x in telemetry:
|
||||||
|
telem_monkey_guid = x.pop("monkey_guid")
|
||||||
|
monkey_label = monkey_guid_dict.get(telem_monkey_guid)
|
||||||
|
if monkey_label is None:
|
||||||
|
monkey_label = telem_monkey_guid
|
||||||
|
x["monkey"] = monkey_label
|
||||||
|
objects.append(x)
|
||||||
|
|
||||||
|
return objects
|
||||||
|
|
||||||
def get_edge_by_scan_or_exploit_telemetry(self, telemetry_json):
|
def get_edge_by_scan_or_exploit_telemetry(self, telemetry_json):
|
||||||
dst_ip = telemetry_json['data']['machine']['ip_addr']
|
dst_ip = telemetry_json['data']['machine']['ip_addr']
|
||||||
src_monkey = NodeService.get_monkey_by_guid(telemetry_json['monkey_guid'])
|
src_monkey = NodeService.get_monkey_by_guid(telemetry_json['monkey_guid'])
|
||||||
|
|
|
@ -338,12 +338,6 @@ SCHEMA = {
|
||||||
"title": "C&C",
|
"title": "C&C",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"general": {
|
|
||||||
"title": "General",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"servers": {
|
"servers": {
|
||||||
"title": "Servers",
|
"title": "Servers",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
@ -8,9 +8,15 @@ const renderTime = (val) => val.split('.')[0];
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: 'Time', prop: 'timestamp', render: renderTime},
|
{ title: 'Time', prop: 'timestamp', render: renderTime},
|
||||||
|
<<<<<<< HEAD
|
||||||
{ title: 'Monkey ID', prop: 'monkey_guid' },
|
{ title: 'Monkey ID', prop: 'monkey_guid' },
|
||||||
{ title: 'Type', prop: 'telem_type' },
|
{ title: 'Type', prop: 'telem_type' },
|
||||||
{ title: 'More Info', prop: 'data', render: renderJson, width: '40%' }
|
{ title: 'More Info', prop: 'data', render: renderJson, width: '40%' }
|
||||||
|
=======
|
||||||
|
{ title: 'Monkey', prop: 'monkey' },
|
||||||
|
{ title: 'Type', prop: 'telem_type' },
|
||||||
|
{ title: 'Details', prop: 'data', render: renderJson, width: '40%' }
|
||||||
|
>>>>>>> e37a0a98630fdd673166aa7d149031db577946cd
|
||||||
];
|
];
|
||||||
|
|
||||||
class FullLogsPageComponent extends React.Component {
|
class FullLogsPageComponent extends React.Component {
|
||||||
|
@ -30,7 +36,7 @@ class FullLogsPageComponent extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Col xs={12}>
|
<Col xs={12}>
|
||||||
<h1 className="page-title">Full Logs</h1>
|
<h1 className="page-title">Monkey Telemetry</h1>
|
||||||
<div className="data-table-container">
|
<div className="data-table-container">
|
||||||
<DataTable
|
<DataTable
|
||||||
keys="name"
|
keys="name"
|
||||||
|
|
Loading…
Reference in New Issue