forked from p15670423/monkey
Island: Pass agent configuration to telemetry processing function in Telemetry resource
This commit is contained in:
parent
093e6fa3a6
commit
c70627c74b
|
@ -63,7 +63,8 @@ class Telemetry(AbstractResource):
|
||||||
monkey = NodeService.get_monkey_by_guid(telemetry_json["monkey_guid"])
|
monkey = NodeService.get_monkey_by_guid(telemetry_json["monkey_guid"])
|
||||||
NodeService.update_monkey_modify_time(monkey["_id"])
|
NodeService.update_monkey_modify_time(monkey["_id"])
|
||||||
|
|
||||||
process_telemetry(telemetry_json)
|
agent_configuration = self._agent_configuration_repository.get_configuration()
|
||||||
|
process_telemetry(telemetry_json, agent_configuration)
|
||||||
|
|
||||||
# API Spec: RESTful way is to return an identifier of the updated/newly created resource
|
# API Spec: RESTful way is to return an identifier of the updated/newly created resource
|
||||||
return {}, 201
|
return {}, 201
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from common.common_consts.telem_categories import TelemCategoryEnum
|
from common.common_consts.telem_categories import TelemCategoryEnum
|
||||||
|
from common.configuration import AgentConfiguration
|
||||||
from monkey_island.cc.models.telemetries import save_telemetry
|
from monkey_island.cc.models.telemetries import save_telemetry
|
||||||
from monkey_island.cc.services.telemetry.processing.aws_info import process_aws_telemetry
|
from monkey_island.cc.services.telemetry.processing.aws_info import process_aws_telemetry
|
||||||
from monkey_island.cc.services.telemetry.processing.exploit import process_exploit_telemetry
|
from monkey_island.cc.services.telemetry.processing.exploit import process_exploit_telemetry
|
||||||
|
@ -29,7 +30,7 @@ TELEMETRY_CATEGORY_TO_PROCESSING_FUNC = {
|
||||||
UNSAVED_TELEMETRIES = [TelemCategoryEnum.CREDENTIALS]
|
UNSAVED_TELEMETRIES = [TelemCategoryEnum.CREDENTIALS]
|
||||||
|
|
||||||
|
|
||||||
def process_telemetry(telemetry_json):
|
def process_telemetry(telemetry_json, agent_configuration: AgentConfiguration):
|
||||||
try:
|
try:
|
||||||
telem_category = telemetry_json.get("telem_category")
|
telem_category = telemetry_json.get("telem_category")
|
||||||
if telem_category in TELEMETRY_CATEGORY_TO_PROCESSING_FUNC:
|
if telem_category in TELEMETRY_CATEGORY_TO_PROCESSING_FUNC:
|
||||||
|
|
Loading…
Reference in New Issue