open-nomad/drivers
Danielle Lancashire 4fbcc668d0
volumes: Add support for mount propagation
This commit introduces support for configuring mount propagation when
mounting volumes with the `volume_mount` stanza on Linux targets.

Similar to Kubernetes, we expose 3 options for configuring mount
propagation:

- private, which is equivalent to `rprivate` on Linux, which does not allow the
           container to see any new nested mounts after the chroot was created.

- host-to-task, which is equivalent to `rslave` on Linux, which allows new mounts
                that have been created _outside of the container_ to be visible
                inside the container after the chroot is created.

- bidirectional, which is equivalent to `rshared` on Linux, which allows both
                 the container to see new mounts created on the host, but
                 importantly _allows the container to create mounts that are
                 visible in other containers an don the host_

private and host-to-task are safe, but bidirectional mounts can be
dangerous, as if the code inside a container creates a mount, and does
not clean it up before tearing down the container, it can cause bad
things to happen inside the kernel.

To add a layer of safety here, we require that the user has ReadWrite
permissions on the volume before allowing bidirectional mounts, as a
defense in depth / validation case, although creating mounts should also require
a priviliged execution environment inside the container.
2019-10-14 14:09:58 +02:00
..
docker volumes: Add support for mount propagation 2019-10-14 14:09:58 +02:00
exec driver: set correct network isolation caps for exec and java dr… (#6368) 2019-09-25 11:48:14 -04:00
java driver/java: pass task network isolation to executor 2019-09-27 08:26:54 -04:00
mock ar: initial driver based network management 2019-07-31 01:03:17 -04:00
qemu fix qemu and update docker with tests 2019-09-04 11:27:51 -04:00
rawexec tests: enable raw_exec driver 2019-08-29 20:26:50 -04:00
rkt plugins/driver: make DriverNetworkManager interface optional 2019-07-31 01:03:19 -04:00
shared volumes: Add support for mount propagation 2019-10-14 14:09:58 +02:00