From 10375c093e9cea536eb2f4c8b80f056e3e2d9df7 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 28 Nov 2017 14:33:41 +0200 Subject: [PATCH] Sort recommendations by machine --- monkey_island/cc/services/report.py | 6 ++++-- monkey_island/cc/ui/src/components/pages/ReportPage.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/monkey_island/cc/services/report.py b/monkey_island/cc/services/report.py index e7ec00e5e..867feeda6 100644 --- a/monkey_island/cc/services/report.py +++ b/monkey_island/cc/services/report.py @@ -43,7 +43,7 @@ class ReportService: return [ { 'type': 'tunnel', - 'origin': NodeService.get_node_hostname(NodeService.get_node_or_monkey_by_id(tunnel['_id'])), + 'machine': NodeService.get_node_hostname(NodeService.get_node_or_monkey_by_id(tunnel['_id'])), 'dest': NodeService.get_node_hostname(NodeService.get_node_or_monkey_by_id(tunnel['tunnel'])) } for tunnel in mongo.db.monkey.find({'tunnel': {'$exists': True}}, {'tunnel': 1})] @@ -251,7 +251,9 @@ class ReportService: @staticmethod def get_issues(): - return ReportService.get_exploits() + ReportService.get_tunnels() + ReportService.get_cross_segment_issues() + issues = ReportService.get_exploits() + ReportService.get_tunnels() + ReportService.get_cross_segment_issues() + issues.sort(lambda x, y: 1 if x['machine'] > y['machine'] else -1 if x['machine'] < y['machine'] else 0) + return issues @staticmethod def get_report(): diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js index be5c0e9e3..3966311f2 100644 --- a/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -240,7 +240,7 @@ class ReportPageComponent extends React.Component { generateTunnelIssue(issue) { return (
- Machines are not locked down at port level. Network tunnel was set up from {issue.origin} to {issue.dest}. + Machines are not locked down at port level. Network tunnel was set up from {issue.machine} to {issue.dest}.
In order to protect the machine, the following steps should be performed: