From b713cce893cfbd220d1460ae6d3ba2b71a7e21d3 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 4 Oct 2022 15:41:07 -0400 Subject: [PATCH] Island: Remove /api/test/monkey endpoint --- CHANGELOG.md | 1 + monkey/monkey_island/cc/app.py | 2 -- .../blackbox/monkey_blackbox_endpoint.py | 16 ---------------- 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 monkey/monkey_island/cc/resources/blackbox/monkey_blackbox_endpoint.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b4eac50c..af69caa97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,6 +115,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/). - "/api/island-configuration" endpoint. #2003 - "-t/--tunnel" from agent command line arguments. #2216 - "/api/monkey-control/neets-to-stop". #2261 +- "GET /api/test/monkey" 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 18af5f2a6..f842d8ffc 100644 --- a/monkey/monkey_island/cc/app.py +++ b/monkey/monkey_island/cc/app.py @@ -32,7 +32,6 @@ 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.monkey_blackbox_endpoint import MonkeyBlackboxEndpoint from monkey_island.cc.resources.blackbox.telemetry_blackbox_endpoint import ( TelemetryBlackboxEndpoint, ) @@ -207,7 +206,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(MonkeyBlackboxEndpoint) api.add_resource(LogBlackboxEndpoint) api.add_resource(TelemetryBlackboxEndpoint) diff --git a/monkey/monkey_island/cc/resources/blackbox/monkey_blackbox_endpoint.py b/monkey/monkey_island/cc/resources/blackbox/monkey_blackbox_endpoint.py deleted file mode 100644 index 4a140f265..000000000 --- a/monkey/monkey_island/cc/resources/blackbox/monkey_blackbox_endpoint.py +++ /dev/null @@ -1,16 +0,0 @@ -from bson import json_util -from flask import request - -from monkey_island.cc.database import mongo -from monkey_island.cc.resources.AbstractResource import AbstractResource -from monkey_island.cc.resources.request_authentication import jwt_required - - -class MonkeyBlackboxEndpoint(AbstractResource): - # API Spec: Rename to noun, BlackboxTestsMonkeys or something - urls = ["/api/test/monkey"] - - @jwt_required - def get(self, **kw): - find_query = json_util.loads(request.args.get("find_query")) - return {"results": list(mongo.db.monkey.find(find_query))}