mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
7e3a596a63
Linux supports many obsolete address families, which are usually available in common distro kernels, but they are less likely to be properly audited and may have security issues This blocks all socket families in the socket (and socketcall where applicable) syscall except - AF_UNIX - Unix domain sockets - AF_INET - IPv4 - AF_INET6 - IPv6 - AF_NETLINK - Netlink sockets for communicating with the ekrnel - AF_PACKET - raw sockets, which are only allowed with CAP_NET_RAW All other socket families are blocked, including Appletalk (native, not over IP), IPX (remember that!), VSOCK and HVSOCK, which should not generally be used in containers, etc. Note that users can of course provide a profile per container or in the daemon config if they have unusual use cases that require these. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
16 lines
631 B
Docker
16 lines
631 B
Docker
FROM buildpack-deps:jessie
|
|
|
|
COPY . /usr/src/
|
|
|
|
WORKDIR /usr/src/
|
|
|
|
RUN gcc -g -Wall -static userns.c -o /usr/bin/userns-test \
|
|
&& gcc -g -Wall -static ns.c -o /usr/bin/ns-test \
|
|
&& gcc -g -Wall -static acct.c -o /usr/bin/acct-test \
|
|
&& gcc -g -Wall -static setuid.c -o /usr/bin/setuid-test \
|
|
&& gcc -g -Wall -static setgid.c -o /usr/bin/setgid-test \
|
|
&& gcc -g -Wall -static socket.c -o /usr/bin/socket-test \
|
|
&& gcc -g -Wall -static raw.c -o /usr/bin/raw-test \
|
|
&& gcc -g -Wall -static appletalk.c -o /usr/bin/appletalk-test
|
|
|
|
RUN [ "$(uname -m)" = "x86_64" ] && gcc -s -m32 -nostdlib exit32.s -o /usr/bin/exit32-test || true
|