forked from p15670423/monkey
Island: Add AgentID type alias
This commit is contained in:
parent
453f45e403
commit
f79d2fd8a6
|
@ -12,4 +12,4 @@ from .user_credentials import UserCredentials
|
|||
from .machine import Machine, MachineID
|
||||
from .communication_type import CommunicationType
|
||||
from .node import Node
|
||||
from .agent import Agent
|
||||
from .agent import Agent, AgentID
|
||||
|
|
|
@ -3,17 +3,20 @@ from typing import Optional
|
|||
from uuid import UUID
|
||||
|
||||
from pydantic import Field
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from common.base_models import MutableInfectionMonkeyBaseModel
|
||||
|
||||
from . import MachineID
|
||||
|
||||
AgentID: TypeAlias = UUID
|
||||
|
||||
|
||||
class Agent(MutableInfectionMonkeyBaseModel):
|
||||
id: UUID = Field(..., allow_mutation=False)
|
||||
id: AgentID = Field(..., allow_mutation=False)
|
||||
machine_id: MachineID = Field(..., allow_mutation=False)
|
||||
start_time: datetime = Field(..., allow_mutation=False)
|
||||
stop_time: Optional[datetime]
|
||||
parent_id: UUID = Field(..., allow_mutation=False)
|
||||
parent_id: AgentID = Field(..., allow_mutation=False)
|
||||
cc_server: str = Field(default="")
|
||||
log_contents: str = Field(default="")
|
||||
|
|
Loading…
Reference in New Issue