1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00
libvirt/po
Daniel P. Berrange e4e69e899e Apply security label when entering LXC namespaces
Add a new virDomainLxcEnterSecurityLabel() function as a
counterpart to virDomainLxcEnterNamespaces(), which can
change the current calling process to have a new security
context. This call runs client side, not in libvirtd
so we can't use the security driver infrastructure.

When entering a namespace, the process spawned from virsh
will default to running with the security label of virsh.
The actual desired behaviour is to run with the security
label of the container most of the time. So this changes
virsh lxc-enter-namespace command to invoke the
virDomainLxcEnterSecurityLabel method.

The current behaviour is:

LABEL                             PID TTY          TIME CMD
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 29 ? 00:00:00 dhclient
staff_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 47 ? 00:00:00 ps

Note the ps command is running as unconfined_t,  After this patch,

The new behaviour is this:

virsh -c lxc:/// lxc-enter-namespace dan -- /bin/ps -eZ
LABEL                             PID TTY          TIME CMD
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 32 ? 00:00:00 dhclient
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 38 ? 00:00:00 ps

The '--noseclabel' flag can be used to skip security labelling.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-03-13 15:16:37 +00:00
..
af.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
am.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ar.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
as.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
be.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
bg.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
bn_IN.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
bn.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
bs.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ca.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
cs.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
cy.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
da.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
de.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
el.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
en_GB.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
es.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
et.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
eu_ES.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
fa.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
fi.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
fr.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
gl.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
gu.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
he.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
hi.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
hr.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
hu.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
hy.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
id.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
is.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
it.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ja.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ka.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
kn.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ko.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ku.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
libvirt.pot Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
lo.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
lt.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
lv.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
mk.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ml.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
mr.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ms.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
my.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
nb.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
nl.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
nn.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
nso.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
or.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
pa.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
pl.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
POTFILES.in Apply security label when entering LXC namespaces 2013-03-13 15:16:37 +00:00
pt_BR.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
pt.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ro.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ru.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
si.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
sk.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
sl.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
sq.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
sr.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
sr@latin.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
sv.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ta.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
te.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
th.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
tr.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
uk.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
ur.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
vi_VN.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
vi.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
zh_CN.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
zh_TW.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00
zu.po Release of libvirt 1.0.3 2013-03-05 12:00:53 +08:00