forked from p15670423/monkey
parent
5558d075be
commit
956621dcf3
|
@ -20,6 +20,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- `/api/clear-simulation-data` endpoint. #2036
|
||||
- `/api/registration-status` endpoint. #2149
|
||||
- authentication to `/api/island/version`. #2109
|
||||
- `/api/events` endpoint. #2155
|
||||
|
||||
### Changed
|
||||
- Reset workflow. Now it's possible to delete data gathered by agents without
|
||||
|
|
|
@ -14,6 +14,7 @@ from monkey_island.cc.resources import (
|
|||
AgentBinaries,
|
||||
AgentConfiguration,
|
||||
ClearSimulationData,
|
||||
Events,
|
||||
IPAddresses,
|
||||
IslandLog,
|
||||
PBAFileDownload,
|
||||
|
@ -179,6 +180,8 @@ def init_restful_endpoints(api: FlaskDIWrapper):
|
|||
api.add_resource(IslandLog)
|
||||
api.add_resource(IPAddresses)
|
||||
|
||||
api.add_resource(Events)
|
||||
|
||||
# API Spec: These two should be the same resource, GET for download and POST for upload
|
||||
api.add_resource(PBAFileDownload)
|
||||
api.add_resource(PBAFileUpload)
|
||||
|
|
|
@ -8,3 +8,4 @@ from .ip_addresses import IPAddresses
|
|||
from .agent_configuration import AgentConfiguration
|
||||
from .pba_file_upload import PBAFileUpload, LINUX_PBA_TYPE, WINDOWS_PBA_TYPE
|
||||
from .pba_file_download import PBAFileDownload
|
||||
from .events import Events
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
import logging
|
||||
from http import HTTPStatus
|
||||
|
||||
from flask import request
|
||||
|
||||
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Events(AbstractResource):
|
||||
urls = ["/api/events"]
|
||||
|
||||
# Agents needs this
|
||||
def post(self):
|
||||
event = request.json
|
||||
|
||||
logger.info(f"Event: {event}")
|
||||
|
||||
return {}, HTTPStatus.NO_CONTENT
|
Loading…
Reference in New Issue