From 5b3e526d499960f35f8a88dff06e0ad635d48056 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Wed, 13 Sep 2017 18:01:41 +0300 Subject: [PATCH] Show tunnel info and remove config from queried node --- monkey_island/cc/services/node.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/monkey_island/cc/services/node.py b/monkey_island/cc/services/node.py index 1b16571c2..ed626eb5c 100644 --- a/monkey_island/cc/services/node.py +++ b/monkey_island/cc/services/node.py @@ -13,7 +13,7 @@ class NodeService: @staticmethod def get_displayed_node_by_id(node_id): - if ObjectId(node_id) == ObjectId("000000000000000000000000"): + if ObjectId(node_id) == NodeService.get_monkey_island_pseudo_id(): return NodeService.get_monkey_island_node() edges = EdgeService.get_displayed_edges_by_to(node_id) @@ -31,8 +31,7 @@ class NodeService: # node is infected new_node = NodeService.monkey_to_net_node(monkey) for key in monkey: - # TODO: do something with tunnel - if key not in ["_id", "modifytime", "parent", "tunnel", "dead"]: + if key not in ["_id", "modifytime", "parent", "dead", "config"]: new_node[key] = monkey[key] else: @@ -53,8 +52,6 @@ class NodeService: if len(edges) > 0: new_node["services"] = edges[-1]["services"] - # TODO: add exploited by - return new_node @staticmethod @@ -216,11 +213,15 @@ class NodeService: return monkey return None + @staticmethod + def get_monkey_island_pseudo_id(): + return ObjectId("000000000000000000000000") + @staticmethod def get_monkey_island_pseudo_net_node(): return\ { - "id": ObjectId("000000000000000000000000"), + "id": NodeService.get_monkey_island_pseudo_id(), "label": "MonkeyIsland", "group": "islandClean", }