Docker:�security disasters
Stefan Walluhn
about me
Official base images tagged as latest often include known vulnerabilities, most notably the official node image which has almost 700 known vulnerabilities. Over 30% of survey participants do not review Kubernetes manifests for insecure configurations, and requirements for security-related resource controls in Kubernetes are not widely implemented.
https://snyk.io/series/open-source-security/
Docker
Nochmal ganz von vorn:
warum haben wir Container?
“A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.”�
System tools & libraries
Docker
ein Beispiel
FROM debian:stable-slim
CMD echo “hello world”
Docker
Prozess
+
dessen Laufzeitumgebung
Security Scanner has detected 75 vulnerabilities!
(1 critical; 5 high)
Docker
Ihr seid für die Software UND
für deren Laufzeitumgebung verantwortlich!
Docker
Base Image Security
Stand: 05.03.2024
Runtime
Docker
node:latest
node:latest
FROM buildpack-deps:bookworm
node:latest
RUN curl "https://nodejs.org/[...]/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \� && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local
node:latest
RUN curl "https://yarnpkg.com/[...]/yarn-v$YARN_VERSION.tar.gz" \� && mkdir -p /opt \� && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \� && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn
node:latest
CMD [ “node” ]
Docker
node:latest
Application
Docker
owncloud/server:latest
owncloud/server:latest
FROM owncloud/base:20.04-amd64�FROM owncloud/php:20.04-amd64�FROM owncloud/ubuntu:amd64�FROM ubuntu:20.04
FULL DISCLOSURE / UPDATE:
Analyse von 04/2022
Stand 05.03.2024
owncloud/php:20.04-amd64
RUN apt-get update -y && apt-get install -y apache2 libapache2-mod-php
RUN pecl install smbclient-stable
RUN curl -sS https://getcomposer.org/installer | php
owncloud/server:20.04-amd64
ADD owncloud.tar.bz2 /var/www
owncloud Startup-Scripte
gomplate???
owncloud/ubuntu:amd64
ADD https://github.com/[...]/wait-for-linux-amd64 /usr/bin/wait-for�ADD https://github.com/[...]/gosu-amd64 /usr/bin/su-exec�ADD https://github.com/[...]/gomplate_linux-amd64 /usr/bin/gomplate�
Docker
owncloud/server:latest
Zur Einordnung
Application-Stacks
Sentry
official self hosted
“Our recommendation is to download the latest release of the self-hosted repository, [...] and then will tell you to run ‘docker-compose up -d’ to start Sentry.”
Oft auch in der Geschmacksrichtung “Nimm das Helm-Chart hier” verfügbar.
Sentry
official self hosted
Version 24.2.0; Stand 05.03.2024
Sentry-eigenes Docker-Image
K8s
K8s
…ist auch nur ein Haufen Container
coredns
FROM distroless/static-debian11:nonroot
COPY coredns /coredns
USER nonroot:nonroot
EXPOSE 53 53/udp
ENTRYPOINT ["/coredns"]
K8s
coredns
K8s
kube-proxy
Docker
und jetzt die schlechte Nachricht
Was tun?
Docker
was tun?
Docker
Ausblicke
Ende
Danke fürs Zuhören!
www.aboutsource.net
we are hiring!
www.devopsdisasters.net
call for disasters!
Feedback + Rückfragen
input@devopsdisasters.net