3 ms·
The systemd-nspawn man page has an example that might help: Example 6. Run a container with SELinux sandbox security contexts # chcon system_u:object_r:sv
by andor 11y ago
The systemd-nspawn man page has an example that might help:
Example 6. Run a container with SELinux sandbox security contexts
# chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R \
/srv/container
# systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 \
-Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 -D /srv/container \
/bin/sh
In addition to -Z and -L, there's also --drop-capability.
Apart from privilege escalation bugs, any shared resource can theoretically be used to escape containers. For example, access to main memory via a device with DMA, access to the same /proc as the host, access to a shared filesystem (replace a binary that the host executes), etc.