mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 03:44:32 +00:00
ubuntu containers: use a seccomp filter by default (v2)
Blacklist module loading, kexec, and open_by_handle_at (the cause of the not-docker-specific dockerinit mounts namespace escape). This should be applied to all arches, but iiuc stgraber will be doing some reworking of the commonizations which will simplify that, so I'm not doing it here. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
cd75548b25
commit
214a98ef56
@ -21,4 +21,5 @@ templatesconfig_DATA = \
|
|||||||
ubuntu-cloud.userns.conf \
|
ubuntu-cloud.userns.conf \
|
||||||
ubuntu.common.conf \
|
ubuntu.common.conf \
|
||||||
ubuntu.lucid.conf \
|
ubuntu.lucid.conf \
|
||||||
ubuntu.userns.conf
|
ubuntu.userns.conf \
|
||||||
|
ubuntu.priv.seccomp
|
||||||
|
@ -68,3 +68,7 @@ lxc.cgroup.devices.allow = c 10:232 rwm
|
|||||||
## To use loop devices, copy the following line to the container's
|
## To use loop devices, copy the following line to the container's
|
||||||
## configuration file (uncommented).
|
## configuration file (uncommented).
|
||||||
#lxc.cgroup.devices.allow = b 7:* rwm
|
#lxc.cgroup.devices.allow = b 7:* rwm
|
||||||
|
|
||||||
|
# Blacklist some syscalls which are not safe in privileged
|
||||||
|
# containers
|
||||||
|
lxc.seccomp = @LXCTEMPLATECONFIG@/ubuntu.priv.seccomp
|
||||||
|
8
config/templates/ubuntu.priv.seccomp
Normal file
8
config/templates/ubuntu.priv.seccomp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
2
|
||||||
|
blacklist
|
||||||
|
[all]
|
||||||
|
kexec_load errno 1
|
||||||
|
open_by_handle_at errno 1
|
||||||
|
init_module errno 1
|
||||||
|
finit_module errno 1
|
||||||
|
delete_module errno 1
|
@ -17,3 +17,7 @@ lxc.mount.entry = /dev/zero dev/zero none bind,create=file 0 0
|
|||||||
# Extra fstab entries as mountall can't mount those by itself
|
# Extra fstab entries as mountall can't mount those by itself
|
||||||
lxc.mount.entry = /sys/firmware/efi/efivars sys/firmware/efi/efivars none bind,optional 0 0
|
lxc.mount.entry = /sys/firmware/efi/efivars sys/firmware/efi/efivars none bind,optional 0 0
|
||||||
lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none bind,optional 0 0
|
lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none bind,optional 0 0
|
||||||
|
|
||||||
|
# Default seccomp policy is not needed for unprivileged containers, and
|
||||||
|
# non-root users cannot use seccmp without NNP anyway.
|
||||||
|
lxc.seccomp =
|
||||||
|
Loading…
Reference in New Issue
Block a user