Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added jwt_required decorator to the "local_run" endpoint #981

Merged
merged 1 commit into from
Feb 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions monkey/monkey_island/cc/resources/local_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH
from monkey_island.cc.models import Monkey
from monkey_island.cc.services.utils.network_utils import local_ip_addresses
from monkey_island.cc.resources.auth.auth import jwt_required
from monkey_island.cc.resources.monkey_download import get_monkey_executable
from monkey_island.cc.services.node import NodeService

Expand Down Expand Up @@ -55,6 +56,7 @@ def run_local_monkey():


class LocalRun(flask_restful.Resource):
@jwt_required
def get(self):
NodeService.update_dead_monkeys()
island_monkey = NodeService.get_monkey_island_monkey()
Expand All @@ -65,6 +67,7 @@ def get(self):

return jsonify(is_running=is_monkey_running)

@jwt_required
def post(self):
body = json.loads(request.data)
if body.get('action') == 'run':
Expand Down