Island: remove remaining references to "creds" property of monkey

This commit is contained in:
vakarisz 2022-02-25 17:13:19 +02:00
parent cf56fcbef2
commit 02d81771a9
2 changed files with 0 additions and 12 deletions

View File

@ -69,7 +69,6 @@ class Monkey(flask_restful.Resource):
def post(self, **kw):
with agent_killing_mutex:
monkey_json = json.loads(request.data)
monkey_json["creds"] = []
monkey_json["dead"] = False
if "keepalive" in monkey_json:
monkey_json["keepalive"] = dateutil.parser.parse(monkey_json["keepalive"])
@ -163,8 +162,6 @@ class Monkey(flask_restful.Resource):
EdgeService.update_all_dst_nodes(
old_dst_node_id=node_id, new_dst_node_id=new_monkey_id
)
for creds in existing_node["creds"]:
NodeService.add_credentials_to_monkey(new_monkey_id, creds)
mongo.db.node.remove({"_id": node_id})
return {"id": new_monkey_id}

View File

@ -202,7 +202,6 @@ class NodeService:
"ip_addresses": [ip_address],
"domain_name": domain_name,
"exploited": False,
"creds": [],
"os": {"type": "unknown", "version": "unknown"},
}
)
@ -318,14 +317,6 @@ class NodeService:
def is_monkey_finished_running():
return NodeService.is_any_monkey_exists() and not NodeService.is_any_monkey_alive()
@staticmethod
def add_credentials_to_monkey(monkey_id, creds):
mongo.db.monkey.update({"_id": monkey_id}, {"$push": {"creds": creds}})
@staticmethod
def add_credentials_to_node(node_id, creds):
mongo.db.node.update({"_id": node_id}, {"$push": {"creds": creds}})
@staticmethod
def get_node_or_monkey_by_ip(ip_address):
node = NodeService.get_node_by_ip(ip_address)