chiark / gitweb /
Add SELinux support to systemd-nspawn
authorDan Walsh <dwalsh@redhat.com>
Thu, 30 Jan 2014 21:28:02 +0000 (16:28 -0500)
committerDavid Strauss <david@davidstrauss.net>
Tue, 4 Feb 2014 21:33:15 +0000 (13:33 -0800)
commita8828ed93878b4b4866d40ebfb660e54995ff72e
tree069b43684335a229432b2fa1f7666d8e62e3e715
parent483798e0770c65968bbe2b668ece293b2419f2ec
Add SELinux support to systemd-nspawn

This patch adds to new options:

-Z PROCESS_LABEL

This specifies the process label to run on processes run within the container.

-L FILE_LABEL

The file label to assign to memory file systems created within the container.

For example if you wanted to wrap an container with SELinux sandbox labels, you could execute a command line the following

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
man/systemd-nspawn.xml
src/nspawn/nspawn.c