Island: Remove /api/test/monkey endpoint

This commit is contained in:
Mike Salvatore 2022-10-04 15:41:07 -04:00
parent 2bea619786
commit b713cce893
3 changed files with 1 additions and 18 deletions

View File

@ -115,6 +115,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
- "/api/island-configuration" endpoint. #2003 - "/api/island-configuration" endpoint. #2003
- "-t/--tunnel" from agent command line arguments. #2216 - "-t/--tunnel" from agent command line arguments. #2216
- "/api/monkey-control/neets-to-stop". #2261 - "/api/monkey-control/neets-to-stop". #2261
- "GET /api/test/monkey" endpoint. #2269
### Fixed ### Fixed
- A bug in network map page that caused delay of telemetry log loading. #1545 - A bug in network map page that caused delay of telemetry log loading. #1545

View File

@ -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.attack.attack_report import AttackReport
from monkey_island.cc.resources.auth import Authenticate, Register, RegistrationStatus, init_jwt 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.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 ( from monkey_island.cc.resources.blackbox.telemetry_blackbox_endpoint import (
TelemetryBlackboxEndpoint, TelemetryBlackboxEndpoint,
) )
@ -207,7 +206,6 @@ def init_restful_endpoints(api: FlaskDIWrapper):
# API Spec: Fix all the following endpoints, see comments in the resource classes # 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 # 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. # necessary data. This would make these endpoints obsolete.
api.add_resource(MonkeyBlackboxEndpoint)
api.add_resource(LogBlackboxEndpoint) api.add_resource(LogBlackboxEndpoint)
api.add_resource(TelemetryBlackboxEndpoint) api.add_resource(TelemetryBlackboxEndpoint)

View File

@ -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))}