24
Docker File System Isolation By Darrin Schmitz David Huff Destiny Velasquez 1 LA-UR-15-25911

Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Docker File System Isolation

By Darrin Schmitz

David Huff Destiny Velasquez

1 LA-UR-15-25911

Page 2: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Specifications

•  HP ProLiant DL380p Gen8 servers

•  Head node has 32 cores and 32 GB RAM

•  10 child nodes have 24 cores and 24 GB RAM

•  Operating system: CentOS 6.6

•  Containers: Docker version 1.6

2 LA-UR-15-25911

Page 3: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Abstract Overview

● Our goal

● Technical difficulties

● Overall, we believe Docker is a good security option, even though there are some security risks involved

3 LA-UR-15-25911

Page 4: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

What is a Container? ● Between a virtual

machine and a chroot

● Native hardware utilization

● Able to run different operating systems

4 LA-UR-15-25911

Page 5: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Why use Docker? 1.  Pre-configures its network bridges

2.  Available documentation

3.  Portable and recoverable images

5 LA-UR-15-25911

Page 6: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Docker Normal Setup ● Docker bridge directly connected to node

●  IP forwarding use

● The IP ranges for the containers are 172.17.0.0/20

● Daemon configures iptables

6 LA-UR-15-25911

Page 7: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Docker Normal Setup Diagram

7 LA-UR-15-25911

Page 8: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Problems With Default Setup

● Same IP addresses are assigned to different containers on different nodes

●  Iptables and bridges are not cleaned up by Docker

8 LA-UR-15-25911

Page 9: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Steps to Create a Docker Network With OpenMPI

1.  Install Docker

2.  Set up the bridge manually

3.  Set up SSH-keys

4.  Set up OpenMPI

9

5. Set up the Docker daemon to give out unique IP-addresses

https://www.linkedin.com/pulse/docker-containers-kubernetes-smart-ecosystem-solution-yasser-emam

LA-UR-15-25911

Page 10: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Bridge

10 LA-UR-15-25911

Page 11: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

SSH-Keys & OpenMPI & Mounting

● Generate the SSH-keys and place the public key into the authorized-keys file

● Set up the /etc/openmpi/default-openmpi -hostnames file, and set the path to the OpenMPI libraries

● Mounting is as simple as using Dockers –v flag

11 LA-UR-15-25911

Page 12: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Docker Daemon ● The Docker Daemon sets up the bridge

● The IP range for the containers is set up by the daemon

● There is a flag to assign a custom bridge to the daemon

12 LA-UR-15-25911

Page 13: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Docker Hub

13 http://jenkins-ci.org/content/official-jenkins-lts-docker-image

LA-UR-15-25911

Page 14: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Problems With Docker ● Docker’s bridge needs to connect to the

switch directly

● Services do not start at the start of the terminal

● Environment variables are not permanent

●  IP-addresses cannot be statically set

●  /etc/hosts file is constantly being overwritten

14 LA-UR-15-25911

Page 15: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Benchmarks

Write dd if=/dev/urandom of=/Yellow/File bs=1024 count=1024000 dd if=/dev/urandom of=/home/File bs=1024 count=1024000

Read dd if=/Yellow/File of=/dev/null bs=1024 dd if=/home/File of=/dev/null bs=1024

15 LA-UR-15-25911

Page 16: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Benchmark Results

16

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

1.00

1.05

Dir on Host Dir mounted in Cont File in /home using NFS

Mounted file in /home using NFS

Relative Read Performance

LA-UR-15-25911

Page 17: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Benchmark Results

17

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

1.00

1.05

Dir on Host Dir mounted in Cont File in /home using NFS

Mounted file in /home using NFS

Relative Write Performance

LA-UR-15-25911

Page 18: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

CVE’s ●  Insecure opening of file-descriptor 1 leading to

privilege escalation (CVE-2015-3627)

● Symlink traversal on container respawn allows local privilege escalation (CVE-2015-3629)

● Read/write proc paths allow host modification & information disclosure (CVE-2015-3630)

18 LA-UR-15-25911

Page 19: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Security Risks ● The current version of Docker fixes these

security holes

● As of the 14th of July, 1.7.1 is compatible with CentOS 6.6

● The isolation provided by Docker is not as robust as the segregation established by hypervisors for virtual machines

19 LA-UR-15-25911

Page 20: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Security Recommendations ● Use containers only on unclassified data/file

systems

● Containers run with a whitelisted root

● Access control via SSH Keys

● Set up a password between data locations

● Don’t give root to the user

● Set up user account in the container

20 LA-UR-15-25911

Page 21: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Future Research ● Write a launch script that

works with SLURM/Moab to automatically provision the container environment.

●  Investigate bind mounts using Lustre and Panasas.

21

●  Investigate using containers in an SELinux environment.

https://docs.docker.com/ LA-UR-15-25911

Page 22: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

Conclusion

22

● We met the goal of our project by proving Docker is a lightweight security option

● Although there are some security holes to be concerned about, we’ve provided some security recommendations for Docker

● Docker would be a useful option for separating Yellow and Turquoise data

LA-UR-15-25911

Page 23: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

References 1. https://sites.google.com/a/

probe.newmexicoconsortium.org/cscnsi-2015-vermilion/

2. https://www.docker.com/

3. https://hub.docker.com/

4. https://nvd.nist.gov/

23 LA-UR-15-25911

Page 24: Docker File System Isolation · 2019. 11. 7. · The current version of Docker fixes these security holes As of the 14th of July, 1.7.1 is compatible with CentOS 6.6 The isolation

24

Questions?

LA-UR-15-25911