Skip to content

Container

Docker

  • Reduced linux capabilities
  • Security Options (docker info -> security options)
    • AppArmor profile enabled by default (Ubuntu) (/etc/apparmor.d/docker) if you have AppArmor running
    • SELinux easily enabled (CentOS) by --selinux-enabled
    • Seccomp profile enabled by default.
  • Docker -> ContainterD / (cri-o only in k8s)
  • DO not expose Docker TCP socket, without securing using certificates. It's possible to use SSH (ssh://user@host)
    • DOCKER_HOST=ssh://user@host docker version
  • Build with one base image, copy it to next base image after the initial work is done (within single Dockerfile): https://github.com/BretFisher/petclinic/blob/master/pet-clinic-app/Dockerfile

Tools

General Commands

  • Mount host file system into a container and run: docker run --rm -ti -v /:/hostOs <image> sh
  • Auto remove container when exit: docker run --rm
  • List all images: docker images --all
  • Version info: docker version
  • Connect with remote: docker context

Enumeration

Check presence of docker:

/.dockerenv

Tools

binctr

CVE-2019-5736

New References