Down By The Docker

NotSoSecure Webinar on Docker Vulnerability
1 / 14
Slide 1 of Down By The Docker
Slide 2 of Down By The Docker
Slide 3 of Down By The Docker
Slide 4 of Down By The Docker
Slide 5 of Down By The Docker
Slide 6 of Down By The Docker
Slide 7 of Down By The Docker
Slide 8 of Down By The Docker
Slide 9 of Down By The Docker
Slide 10 of Down By The Docker
Slide 11 of Down By The Docker
Slide 12 of Down By The Docker
Slide 13 of Down By The Docker
Slide 14 of Down By The Docker

Abstract

A security-focused overview of Docker from a penetration tester’s perspective, demonstrating critical misconfigurations that lead to host compromise and outlining hardening best practices.

AI Generated Summary

AI Generated Content Disclaimer

Note: This summary is AI-generated and may contain inaccuracies, errors, or omissions. If you spot any issues, please contact the site owner for corrections. Errors or omissions are unintended.

This deck is “Down by the Docker”, a security-focused overview of Docker from a penetration tester’s perspective, delivered as a NotSoSecure webinar in 2017. The presenter slide lists the speaker as Regional Director at NotSoSecure Global Services Limited with 9 years of corporate experience, co-author of OWASP Testing Guide version 4, and project lead for Code Vigilant and Android Tamer. The deck covers why Docker appeals to development teams, how container environments differ during assessments, three misconfigurations that lead to host compromise, secure configuration practices, and tools for configuration review and vulnerability scanning.

Summary

The deck opens on why Docker earns its popularity: it gets rid of the “It works on my System” syndrome, makes environment and test bed setup quick and easy, is loved by startups and PoC development teams, and is loved by Google and similar companies for scalability and deployment ease. The security slide delivers the core message: Docker is as secure as you configure it, meaning security is not automatic.

The next section explains what differs for pentesters. From the outside a containerized application looks the same as any other. Inside, /proc/1/cgroup will show docker references and PID 1 is not init or launchd. Operational differences follow: bash, Python and Perl are not usually available in minimal containers, containers are disposable so no persistence is ensured, containers can have different resources shared, a container crash means a new spawn anywhere, and Docker runs an internal network on 172.17.0.0/16, with links to Docker’s networking documentation and a demo video on Vimeo.

The heart of the deck is three Docker goof-ups. First, running container processes as root: by default host UID equals container UID, so root in a container is root on the base box, and if any part of the host filesystem is shared there is a direct path to write privileged files and get root, demonstrated with docker run -itv /:/host alpine /bin/sh. Second, exposing the docker socket or TCP port: the Docker socket is access to the docker daemon, Docker can listen on port 2375 without authentication or 2376 with TLS, exposure commonly happens in dashboard or reporting application containers, and any misconfiguration or unintended exposure means host compromise. Third, an unpatched host or guest: Docker shares the kernel with the host so kernel bugs result in host compromise, while unpatched guests result in guest compromise, again with a video demo.

The remediation slide states that security comes by secure configuration at all levels: scrutinize the “docker” group, keep the Docker socket and daemon available only to root and docker group users, run container processes via limited users, keep both Docker host and guest up-to-date, and scan Docker configuration files. The configuration review section lists tooling: Docker Security Scanning via DockerHub, Clair from CoreOS, Red Hat’s Atomic Scan, Anchore, Dockerscan, Dockscan, and Nessus’s Docker auditing. The deck closes by announcing that NotSoSecure created a vulnerable Docker VM suffering from many of the vulnerabilities discussed, downloadable from notsosecure.com/vulnerable-docker-vm/ for hands-on practice, before the questions slide.

Key Themes

  • Docker Overview and Appeal: Docker eliminates the “it works on my system” problem, makes quick test environments, and is adopted by startups for PoC work and by companies like Google for scalability and deployment ease.
  • Security Is Configuration: Docker is “as secure as you configure it”; security relies on secure configuration at all levels rather than on the container model itself.
  • How Docker Differs for Penetration Testers: Externally identical to normal hosts, but /proc/1/cgroup shows docker references and PID 1 is not init or launchd; bash, Python and Perl are often missing, containers are disposable with no persistence, crashes spawn replacements anywhere, and the internal network is 172.17.0.0/16.
  • Goof-Up #1, Container Processes as Root: Host UID maps directly to container UID, so root in the container is root on the base box, and any shared host filesystem gives a direct write path to privileged files.
  • Goof-Up #2, Exposed Socket or TCP Port: The Docker socket grants access to the daemon, and ports 2375 (noauth) and 2376 (tls) are commonly exposed in dashboard or reporting containers; any unintended exposure equals host compromise.
  • Goof-Up #3, Unpatched Host or Guest: Docker shares the kernel with the host, so kernel bugs compromise the host from within any container, while unpatched guest images compromise the guest.
  • Secure Configuration Best Practices: Scrutinize docker group membership, restrict socket and daemon access to root and docker group users, run processes as limited users, keep host and guest updated, and scan configuration files.
  • Configuration Review and Scanning Tools: Docker Security Scanning via DockerHub, Clair, Atomic Scan, Anchore, Dockerscan, Dockscan and Nessus cover misconfiguration and vulnerability detection.
  • Vulnerable Docker VM: NotSoSecure released a deliberately vulnerable VM incorporating the session’s misconfigurations for hands-on practice.

Notable Points

  1. Container detection during tests: check /proc/1/cgroup for docker references and confirm PID 1 is not init or launchd.
  2. Root inside a container equals root on the host; with a shared filesystem, docker run -itv /:/host alpine /bin/sh is a direct host compromise path.
  3. The Docker socket (/var/run/docker.sock) provides direct access to the Docker daemon; Docker can also listen on port 2375 without authentication or 2376 with TLS.
  4. Socket and TCP exposure typically occurs in dashboard or reporting application containers; any misconfiguration or unintended exposure equals host compromise.
  5. Docker’s shared kernel architecture means a single kernel vulnerability compromises the host and all containers on it.
  6. Best practice list: restrict docker group membership as carefully as root, limit socket and daemon access to root and docker group users, run container processes via limited (non-root) users, patch host and guest, scan configuration files.
  7. Scanning and review tools demonstrated: Docker Security Scanning (DockerHub), Clair (github.com/coreos/clair), Red Hat’s Atomic Scan, Anchore, Dockerscan (github.com/cr0hn/dockerscan), Dockscan (github.com/kost/dockscan), and Nessus Docker auditing.
  8. Docker uses an internal network, typically 172.17.0.0/16.
  9. Minimal containers often lack bash, Python and Perl; containers are disposable so persistence is not guaranteed, and a crashed container spawns anew possibly on a different host.
  10. Two demo videos are referenced: https://vimeo.com/219495998 (networking/differences) and https://vimeo.com/218622598 (unpatched host/guest).
  11. The NotSoSecure vulnerable Docker VM is available at notsosecure.com/vulnerable-docker-vm/ for practicing identification and exploitation of these misconfigurations.

Notable Quotes

“Allows to get rid of โ€œIt works on my Systemโ€ syndrome”

“Secure: as secure as you configure it.”

“From outside it will all be the same”

“Root in container == root on base box.”

“Docker socket == access to docker daemon”

“Kernel bugs will result in host compromise”

Videos

Vulnerable Docker VM Walkthrough 1

Vulnerable Docker VM Walkthrough 2

Vulnerable Docker VM Walkthrough 3

Vimeo Recording 1

Vimeo Recording 2

Resources

Embed This Presentation

See Also