forked from p15670423/monkey
Island: Add debug logging to Agents resource
This commit is contained in:
parent
9c32dee739
commit
ab399e4f34
|
@ -1,4 +1,5 @@
|
|||
import json
|
||||
import logging
|
||||
from http import HTTPStatus
|
||||
|
||||
from flask import make_response, request
|
||||
|
@ -6,6 +7,8 @@ from flask import make_response, request
|
|||
from common import AgentRegistrationData
|
||||
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Agents(AbstractResource):
|
||||
urls = ["/api/agents"]
|
||||
|
@ -13,7 +16,10 @@ class Agents(AbstractResource):
|
|||
def post(self):
|
||||
try:
|
||||
# Just parse for now
|
||||
AgentRegistrationData(**request.json)
|
||||
agent_registration_data = AgentRegistrationData(**request.json)
|
||||
|
||||
logger.debug(f"Agent registered: {agent_registration_data}")
|
||||
|
||||
return make_response({}, HTTPStatus.NO_CONTENT)
|
||||
except (TypeError, ValueError, json.JSONDecodeError) as err:
|
||||
return make_response(
|
||||
|
|
Loading…
Reference in New Issue