Island: Add terminate field to Simulation model

This commit is contained in:
Ilija Lazoroski 2022-09-22 12:00:20 +02:00 committed by Mike Salvatore
parent be30db885b
commit 560d941885
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,8 @@
from __future__ import annotations from __future__ import annotations
from datetime import datetime
from enum import Enum from enum import Enum
from typing import Optional
from common.base_models import InfectionMonkeyBaseModel from common.base_models import InfectionMonkeyBaseModel
@ -13,3 +15,4 @@ class IslandMode(Enum):
class Simulation(InfectionMonkeyBaseModel): class Simulation(InfectionMonkeyBaseModel):
mode: IslandMode = IslandMode.UNSET mode: IslandMode = IslandMode.UNSET
terminate_signal_time: Optional[datetime] = None

View File

@ -11,7 +11,7 @@ from common.credentials import Credentials, LMHash, NTHash
from common.types import SocketAddress from common.types import SocketAddress
from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory
from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue
from monkey_island.cc.models import Report from monkey_island.cc.models import Report, Simulation
from monkey_island.cc.models.networkmap import Arc, NetworkMap from monkey_island.cc.models.networkmap import Arc, NetworkMap
from monkey_island.cc.repository import MongoAgentRepository, MongoMachineRepository from monkey_island.cc.repository import MongoAgentRepository, MongoMachineRepository
from monkey_island.cc.repository.attack.IMitigationsRepository import IMitigationsRepository from monkey_island.cc.repository.attack.IMitigationsRepository import IMitigationsRepository
@ -328,3 +328,5 @@ CC_TUNNEL
# TODO: Remove after #2323 # TODO: Remove after #2323
SocketAddress SocketAddress
Simulation.terminate_signal_time