Slide 1

Slide 1 text

Docker Security Mark Wolfe DevOps @ Versent

Slide 2

Slide 2 text

Welcome • Who is this guy? • @wolfeidau on twitter and Github • Who is Versent? • Yes we are hiring

Slide 3

Slide 3 text

Situation Analysis • We are using Docker to build and deploy Web Applications • Pull images from Docker Hub • Clone and code software from Github • Install dependencies • Run

Slide 4

Slide 4 text

So what is the Problem?

Slide 5

Slide 5 text

Docker Host • Keep your hosts up to date • Please schedule automatic security updates • Docker daemon runs as root • Keep it up to date • Avoid --privileged if possible this is also run as root • Avoid docker run -v /:/sysroot or the like

Slide 6

Slide 6 text

Docker Security Check docker run -it --net host --pid host \ --cap-add audit_control -v /var/lib:/var/lib \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /usr/lib/systemd:/usr/lib/systemd \ -v /etc:/etc --label docker_bench_security \ docker/docker-bench-security https://github.com/docker/docker-bench-security

Slide 7

Slide 7 text

Docker File • Set a User • Install signed packages where possible, use apt-get or yum if possible! • Check GPG signatures of downloaded archives • Beware curl http://somewhere.com | bash • Docker Inc has some great examples of good practices, copy with gusto.

Slide 8

Slide 8 text

• Image contains an operating system • Typically contains a few packages • Do these packages have security issues? • Shellshock • Openssl issues Images

Slide 9

Slide 9 text

Images Provenance • Who even made this image? • Are they trustworthy? • How old are your images? • docker inspect can help

Slide 10

Slide 10 text

Images Cont. • Only use a small selection of trusted images • Build a base image with all your standard packages • Scan these images • Rebuild them regularly

Slide 11

Slide 11 text

Continuous Integration

Slide 12

Slide 12 text

Docker Registry CI Agent ELB Web Servers (Docker) Public Subnet

Slide 13

Slide 13 text

Continous Integration • Build and Test our Code • Produce Docker images • Named based on service • These have a tag aka BuildNo • Short Git hash of Code • Use Buildkite

Slide 14

Slide 14 text

Docker Registry CI Agent ELB Web Servers (Docker) Public Subnet PUSH PULL IMAGE IMAGE

Slide 15

Slide 15 text

Continuous Win • CI Server controls Images • Closed System • Audit trail of what went into Docker • Web servers never talk to *Hub • When the hubs are down your app will still autoscale…

Slide 16

Slide 16 text

Let go of bad practices

Slide 17

Slide 17 text

Read this Book https://www.openshift.com/promotions/docker-security.html

Slide 18

Slide 18 text

Questions • Thanks for listening • @wolfeidau on twitter • github.com/wolfeidau • [email protected]

Slide 19

Slide 19 text

References • https://docs.docker.com/engine/security/security/ • https://zwischenzugs.wordpress.com/2016/07/08/ a-checklist-for-docker-in-the-enterprise/ • https://github.com/docker/docker-bench-security

Slide 20

Slide 20 text

Images • "Medium" by Thomas Hawk • "Snowying" by fiddleoak • "Snowstorm" by Beaulawrence