lab_config
lab_config
Description
The data structure lab_config allows to control scenario execution, lab dynamic content and lab post-processing such as dataset generation. When configuring log collection, this data structure relies on other nested data structures: LogCollectorInstance, LogCollectorInstanceLocation and LogCollectorInstanceOutput.
lab_config data structure
pydantic model cr_scenario_model.lab_config_model.LabConfig
field compromission_overload: Optional[cr_scenario_ ... omissionConfigOverload] = None
field config_name: str = 'default'
field content_name: Optional[str] = None
field content_type: Optional[cr_scenario_model.lab_config_model.ContentType] = None
field create_dataset: Optional[bool] = False
field egress: LabEgress = LabEgress(): what the lab may reach beyond its company networks: the internet (restricted,proxied,routed) and, directly, the attacker side (the lab's fake internet,SwitchInternet) on itsfake_internet_ports, TCP ports such as a reverse shell's (HTTP ports refused: HTTP goes through the internet proxy). See Evaluating AI agents in a bench lab
field extra_machines: List[ExtraMachine] = []: machines added to the lab's topology, see Adding your own machines to a lab
field fake_internet_sites: bool = False: adds the fake internet's websites to the lab's topology (a PeerTube, a SearXNG, a HumHub and WordPress blogs, onSwitchInternet), which the life engine's web activities visit withuser_activity_background. Refused for BAS content. See the life engine
field hold_attack: bool = False: once the lab is set up, wait before the scenario's foothold and scripted attack until released (mantis lab <id> attack start), e.g. to deploy a defensive agent first. The hold counts inmax_duration. Refused withrun_attack: falseand for BAS content. See Evaluating AI agents in a bench lab
field forensic_artifacts: Optional[bool] = False
field log_collectors: List[cr_scenario_mode ... l.LogCollectorInstance] = []
field max_duration: int = 3300
field net_capture: Optional[bool] = False
field random_waiting_minutes: Tuple[int[int], int[int]] = (0, 0)
field run_attack: bool = True:falsebuilds the scenario's company, its vulnerable provisioning included, without its scripted attack nor the auto-compromission foothold, to evaluate your own agent against it (refused for BAS content). See Evaluating AI agents in a bench lab
field scenario_profile: Optional[str] = None
field scenario_execution_mode: cr_scenario_model.lab_config_model.ScenarioExecutionMode = ScenarioExecutionMode.automatic
field seed: Optional[str] = None: the seed the life engine draws the lab's background activity from, as a string ("7"); the engine's default (42) when unset, see the life engine
field step_waiting_list: List[str] = []
field user_activity_background: Optional[bool] = False
log_collector_instance data structure
pydantic model cr_scenario_model.lab_config_model.LogCollectorInstance
field collector_name: str [Required]
field collector_type: cr_scenario_model.log_collector_model.LogCollectorType [Required]
field cpe_os_constraints: List[str] = []
field instance_name: str [Required]
field location: List[cr_scenario_mode ... lectorInstanceLocation] [Required]
field output: List[cr_scenario_mode ... ollectorInstanceOutput] = []
field user_config: Dict = {}
field user_config_expert_mode: Dict = {}
log_collector_instance_location data structure
pydantic model cr_scenario_model.lab_config_model.LogCollectorInstanceLocation
field location_type: cr_scenario_model.log_collector_model.LogCollectorLocation [Required]
field value: str [Required]
log_collector_instance_output data structure
pydantic model cr_scenario_model.lab_config_model.LogCollectorInstanceOutput
field collector_name: str [Required]
field collector_type: cr_scenario_model.log_collector_model.LogCollectorType [Required]
field instance_name: str [Required]
Examples
The following extract illustratres a lab_config data structure used to configure the log collection chain Winlogbeat that emits logs towards a logstash log aggregator. Logs are then stored in a Elasticsearch database, and are then accessible through an analyst machine connecting to a Kibana instance.
$ cat config_collect.yaml
---
config_name: "config_collect_winlogbeat"
log_collectors:
- instance_name: winlogbeat
collector_name: winlogbeat
collector_type: agent
location:
- location_type: system_type
value: windows
output:
- instance_name: logstash
collector_name: logstash
collector_type: aggregator
- instance_name: logstash
collector_name: logstash
collector_type: aggregator
location:
- location_type: new_node
value: logstash
output:
- instance_name: elasticsearch
collector_name: elasticsearch
collector_type: aggregator
- instance_name: elasticsearch
collector_name: elasticsearch
collector_type: aggregator
location:
- location_type: new_node
value: elasticsearch
- instance_name: kibana
collector_name: kibana
collector_type: visualization
location:
- location_type: new_node
value: kibana
- instance_name: analyst_machine
collector_name: analyst_machine
collector_type: visualization
location:
- location_type: new_node
value: analyst_machine
user_config:
nb_machines: 1
