diff --git a/CHANGELOG.md b/CHANGELOG.md index af69caa97..66a2d865e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,6 +116,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/). - "-t/--tunnel" from agent command line arguments. #2216 - "/api/monkey-control/neets-to-stop". #2261 - "GET /api/test/monkey" endpoint. #2269 +- "GET /api/test/log" endpoint. #2269 ### Fixed - A bug in network map page that caused delay of telemetry log loading. #1545 diff --git a/monkey/monkey_island/cc/app.py b/monkey/monkey_island/cc/app.py index f842d8ffc..63ee6a72b 100644 --- a/monkey/monkey_island/cc/app.py +++ b/monkey/monkey_island/cc/app.py @@ -31,7 +31,6 @@ from monkey_island.cc.resources import ( from monkey_island.cc.resources.AbstractResource import AbstractResource from monkey_island.cc.resources.attack.attack_report import AttackReport from monkey_island.cc.resources.auth import Authenticate, Register, RegistrationStatus, init_jwt -from monkey_island.cc.resources.blackbox.log_blackbox_endpoint import LogBlackboxEndpoint from monkey_island.cc.resources.blackbox.telemetry_blackbox_endpoint import ( TelemetryBlackboxEndpoint, ) @@ -206,7 +205,6 @@ def init_restful_endpoints(api: FlaskDIWrapper): # API Spec: Fix all the following endpoints, see comments in the resource classes # Note: Preferably, the API will provide a rich feature set and allow access to all of the # necessary data. This would make these endpoints obsolete. - api.add_resource(LogBlackboxEndpoint) api.add_resource(TelemetryBlackboxEndpoint) diff --git a/monkey/monkey_island/cc/resources/blackbox/log_blackbox_endpoint.py b/monkey/monkey_island/cc/resources/blackbox/log_blackbox_endpoint.py deleted file mode 100644 index 643b7f592..000000000 --- a/monkey/monkey_island/cc/resources/blackbox/log_blackbox_endpoint.py +++ /dev/null @@ -1,20 +0,0 @@ -from bson import json_util -from flask import request - -from monkey_island.cc.database import database, mongo -from monkey_island.cc.resources.AbstractResource import AbstractResource -from monkey_island.cc.resources.request_authentication import jwt_required - - -class LogBlackboxEndpoint(AbstractResource): - # API Spec: Rename to noun, BlackboxTestsLogs or something - urls = ["/api/test/log"] - - @jwt_required - def get(self): - find_query = json_util.loads(request.args.get("find_query")) - log = mongo.db.log.find_one(find_query) - if not log: - return {"results": None} - log_file = database.gridfs.get(log["file_id"]) - return {"results": log_file.read().decode()}