pkg/libcontainer/nsinit
Jérôme Petazzoni a5364236a7 Mount /proc and /sys read-only, except in privileged containers.
It has been pointed out that some files in /proc and /sys can be used
to break out of containers. However, if those filesystems are mounted
read-only, most of the known exploits are mitigated, since they rely
on writing some file in those filesystems.

This does not replace security modules (like SELinux or AppArmor), it
is just another layer of security. Likewise, it doesn't mean that the
other mitigations (shadowing parts of /proc or /sys with bind mounts)
are useless. Those measures are still useful. As such, the shadowing
of /proc/kcore is still enabled with both LXC and native drivers.

Special care has to be taken with /proc/1/attr, which still needs to
be mounted read-write in order to enable the AppArmor profile. It is
bind-mounted from a private read-write mount of procfs.

All that enforcement is done in dockerinit. The code doing the real
work is in libcontainer. The init function for the LXC driver calls
the function from libcontainer to avoid code duplication.

Docker-DCO-1.1-Signed-off-by: Jérôme Petazzoni <jerome@docker.com> (github: jpetazzo)
2014-05-01 15:26:58 -07:00
..
nsinit Make native driver use Exec func with different CreateCommand 2014-04-30 18:49:24 -07:00
create.go Make native driver use Exec func with different CreateCommand 2014-04-30 18:49:24 -07:00
exec.go Make native driver use Exec func with different CreateCommand 2014-04-30 18:49:24 -07:00
execin.go Fix execin with environment and Enabled support 2014-04-30 18:24:47 -07:00
init.go Mount /proc and /sys read-only, except in privileged containers. 2014-05-01 15:26:58 -07:00
pid.go Integrate new structure into docker's native driver 2014-04-30 18:20:01 -07:00
std_term.go Split term files to make it easier to manage 2014-04-30 17:04:24 -07:00
sync_pipe.go Export syncpipe fields 2014-04-30 17:02:45 -07:00
term.go Split term files to make it easier to manage 2014-04-30 17:04:24 -07:00
tty_term.go Split term files to make it easier to manage 2014-04-30 17:04:24 -07:00
unsupported.go Make native driver use Exec func with different CreateCommand 2014-04-30 18:49:24 -07:00