Adding your own machines to a lab
Introduction
A lab can get machines of your own on top of its topology, to install tools you want to run inside the simulated network, such as the AI agents of M&NTIS-Bench. Each machine joins the network you choose and runs the image you choose from the basebox catalog. The machines are created with the lab: they are counted in its resources, and they are running when it is ready.
Declaring the machines
Up to 10 machines are listed under extra_machines in the lab configuration file. Each one has:
name: its name, which a Linux machine also takes as host name: letters, digits and inner hyphens, 63 characters at most. It must not be the name of another machine of the lab, whatever its case;switch: the switch of the lab's topology it joins, for exampleSwitchMonitoring(SOC zone, next to the SIEM),SwitchUsers(company network),SwitchDMZorSwitchInternet(the attacker side, the lab's fake internet).SwitchGatewayandSwitchExt, outside the lab's firewall, are refused;basebox_id(optional): a basebox of the catalog. Ubuntu 24.04 (AMOSSYS/linux/ubuntu_24.04_client_en) when none is given.
extra_machines:
- name: soc-agent
switch: SwitchMonitoring
- name: kali1
switch: SwitchUsers
basebox_id: AMOSSYS/linux/kali_2026.2_xfce_frThen create the lab with that file, for example:
mantis topology run <TOPOLOGY> -lc lab_config.yamlA bench lab also takes them on its command line, as the machines of the agents under evaluation: mantis bench run --scenario <SCENARIO> -sp <PROFILE> --agent-machine soc-agent@SwitchMonitoring --agent-machine kali1@SwitchUsers:AMOSSYS/linux/kali_2026.2_xfce_fr (see M&NTIS-Bench).
A machine gets a fixed address: the highest free one of its switch's network below .250. Its CPU and memory are those of its basebox. A wrong declaration (unknown basebox or switch, a name already used) is refused when the lab is created, before any resource is reserved.
Using the machines
The machines are in the lab's web console, with the administrator account of their basebox.
Install and drive your tools from the command line, on a running lab, with
mantis lab <LAB_ID> machine <NAME> ...(Linux machines; the name is the onemantis lab <LAB_ID> nodesshows):exec <COMMAND>: runs a shell command as root (--user <USER>for another user), prints its output and exits with its exit code. It is stopped after--timeoutseconds (600 by default);--jsonreturnsrc,stdoutandstderr;push <LOCAL_PATH> <DEST>: copies a file, or a directory tree into the directory<DEST>, keeping executables executable. Files belong to root unless--owner <USER>[:<GROUP>]is given;--modesets the mode of a single file;secret <SECRET_NAME>: stores a secret, read from--from-file <PATH>,--from-env <VARIABLE>or the standard input, in/etc/mantis/secrets/<SECRET_NAME>, readable by root only. The value never appears on a command line nor in the output.
For example, to deploy an agent and start it as a service:
mantis lab <LAB_ID> machine soc-agent push ./my-agent /opt/my-agent mantis lab <LAB_ID> machine soc-agent secret openai_api_key --from-env OPENAI_API_KEY mantis lab <LAB_ID> machine soc-agent exec "pip install -r /opt/my-agent/requirements.txt" mantis lab <LAB_ID> machine soc-agent exec "systemd-run --unit my-agent /bin/sh -c 'OPENAI_API_KEY=\$(cat /etc/mantis/secrets/openai_api_key) exec /opt/my-agent/run.sh'" mantis lab <LAB_ID> machine soc-agent exec journalctl -u my-agent -n 50A command started in the background must leave the command's output (
systemd-run, ornohup ... >/var/log/my-agent.log 2>&1 &), otherwiseexecwaits for it. These commands go through the platform's provisioning; for a complex installation, write a playbook: see Customizing lab nodes with Ansible.Like every machine of the lab, they reach the outside through the lab proxy (
http_proxyandhttps_proxyare set). In an egress-restricted lab, they only reach the destinations it allows.The lab's integrations install none of their agents on them: a tool under evaluation does not run under the defence it is evaluated against.

