SlideShare a Scribd company logo
Docker and
Container Security
@gianarb
Hello!
I am Gianluca Arbezzano
Site Reliability Engineer at InfluxDB
oss maintainer and Docker Captain
You can find me:
@gianarb on Twitter and GitHub
Play Safe - a free ebook about Container Security.
What?
I wrote an ebook ~55 pages
about Docker and Container
Security. It comes from my
daily experience deploying and
making containers secure.
CoreOS Clair, Apparmor,
SwarmKit, Notary, Cilium and a
lot more...
Get it http://scaledocker.com
Leave your email and you will receive the ebook.
Make it
easy to do
the secure
things
Otherwise your colleagues
will be the perfect
vulnerability.
Least Privileged
It’s valid for Orchestration and
anything else.
1.
Runtime
Apparmor, Seccomp, SELinux
2.
Static
Image Scan, CoreOS Clair
3.
Update
Injection new code in the system.
There is always more.
Port :80 / :443
Anything else..
Services, libraries,
Kernel, Operations,
continuous delivery
and so on..
VPN is not that complicated anymore.
https://community.openvpn.net/openvpn/wiki/BridgingAndRouting
SELinux
1. Everything inside a system has labels
2. By default everything is denied
3. You can write policy to allow only what you
need.
AppArmor
#include <tunables/global>
profile sample-one
flags=(attach_disconnected,mediate_deleted)
{
#include <abstractions/base>
network,
capability,
file,
umount,
deny /etc/** w,
}
AppArmor
docker run 
--security-opt=”apparmor:sample-one” 
--rm -it alpine /bin/sh
deny /etc/** w
touch /tmp/hello.txt
touch /etc/bad.txt
touch: /etc/ciao: Permission denied
“
AppArmor profile pull requests is
the bane of my existence
Cit. Jess Frazelle
https://github.com/jessfraz/bane
It’s easy if you run one process for
every container!
And if you know
what you are running.
Cilium - github.com/cilium/cilium
Cilium - github.com/cilium/cilium
docker network create 
--ipv6 
--subnet ::1/112 
--ipam-driver cilium 
--driver cilium cilium
Cilium - github.com/cilium/cilium
docker run -d --name server --net cilium 
--label io.cilium.service.server 
alpine sleep 30000
docker run -d --name client --net cilium 
--label io.cilium.service.client 
alpine sleep 30000
Cilium - github.com/cilium/cilium
docker run -d --name server --net cilium 
--label io.cilium.service.server 
alpine sleep 30000
docker run -d --name client --net cilium 
--label io.cilium.service.client 
alpine sleep 30000
Cilium - github.com/cilium/cilium
$ cilium endpoint list
docker exec -it client ping server
sudo cilium monitor
Cilium - github.com/cilium/cilium
cilium policy allowed -s cilium:io.cilium.service.client 
-d cilium:io.cilium.service.server
Resolving policy for context &{Trace:1
Logging:0xc42177b590
From:[cilium:io.cilium.service.client]
To:[cilium:io.cilium.service.server]}
Root rules decision: undecided
No matching children in io.cilium
Root children decision: undecided
Final tree decision: deny
Cilium - github.com/cilium/cilium
"name": "service",
"children": {
"client": { "name": "client"},
"server": {
"name": "server",
"rules": [{
"allow": [{
"action": "accept",
"label": {
"key": "host",
"source": "reserved"
}
}, {
"action": "accept",
"label": {
"key": "../client",
"source": "cilium"
}
BPF - github.com/cilium/cilium
BPF is a highly flexible and efficient virtual
machine-like construct in the Linux kernel allowing to
execute bytecode at various hook points in a safe
manner. It is used in a number of Linux kernel
subsystems, most prominently networking, tracing and
security
http://cilium.readthedocs.io/en/latest/bpf/
Images.
There are a lot of
good practices
and mistake
to make.
Security Tips to run Docker in Production
FROM debian
Oh this seems too much...
FROM scratch
Yes. I will make debugging with my
magic wand.
FROM centos
Yum let’s go for lunch! I am hungry
This decision
requires strong
opinions...
Let’s keep in mind about some
concerns
1.
Size
Unused files, libraries, packages
makes your image bigger.
2.
Security
Unrequired code and files are a
good way to get free
vulnerabilities!
3.
Debugging
At some point you will be happy to
run `ping google.com`.
LinuxKit can help
But maintaining your distro is not
very common yet.
Docker Scan
COREOS Clair
1. In regular intervals, Clair ingests vulnerability
metadata from a configured set of sources and
stores it in the database.
2. Clients use the Clair API to index their container
images; this parses a list of installed source
packages and stores them in the database.
3. Clients use the Clair API to query the database;
correlating data is done in real time, rather than a
cached result that needs re-scanning.
4. When updates to vulnerability metadata occur, a
webhook containing the affected images can be
configured to page or block deployments.
Security Tips to run Docker in Production
The update can be
a problem
sometime...
Docker content
trust.
The world behind the pull.
GPG, TLS, SHA
What I need more?
SHA1 - First collision
https://security.googleblog.com/2017/02/
announcing-first-sha1-collision.html
GPG limitation
● Is it coming from the place
where I hope?
● Between the sender and the
receiver what happen?
● Are the signatures too old?
TUF - The update
framework
https://theupdateframework.github.io
The framework is inspired by
Thandy the Tor’s secure updating
system
Main principles:
◎ Responsibility Separation to decrease the
scope of a specific role.
◎ Survivable key compromise and scoped
keys.
◎ Multi-Signature thresholding
It doesn’t manage
your packages
It only manage identity and signatures in
a separate location.
Roles:
● Root
● Targets
● Shanpshot
● Timestamp
● Delegation
Notary
https://github.com/docker/notary
Security Tips to run Docker in Production
dockerd -H fd:// -H tcp://10.7.5.22 --label kind=private
Security Tips to run Docker in Production
echo ’{"username":"root", "password": "root"}’ >
~/secret-test.json
docker secret create myapp -f ~/secret-test.json
docker service create 
--name backend 
--secret myapp 
--image gianarb/micro:1.2.0
Secret available at /run/secret/myapp
Distributed Secret
docker network --opt encrypted 
--driver overlay tick-net
Network Encryption
$ docker swarm init 
--advertise-addr 10.0.0.1 
--datapath-addr 192.168.0.1
Separate interface for
control and data traffic
Immutability
$ docker diff ciccio
C /var
A /var/www
A /var/www/index.html
A /var/www/spy.html
Analysis post running
Containers are not
magic.
Bad code stays
bad.
Write good code
Thanks!
Any questions?
@gianarb

More Related Content

What's hot (20)

PDF
MongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
MongoDB
 
PPTX
Nginx Deep Dive Kubernetes Ingress
Knoldus Inc.
 
PDF
DCSF19 Kubernetes Security with OPA
Docker, Inc.
 
PDF
Kubernetes meetup geneva june 2021
SebastienSEYMARC
 
PDF
Kubernetes security
Thomas Fricke
 
PDF
Kubescape single pane of glass
LibbySchulze1
 
PDF
NGINX 101: Web Traffic Encryption with SSL/TLS and NGINX
NGINX, Inc.
 
PPTX
Interconnecting containers at scale #Dockercon
sarahnovotny
 
PPTX
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
NGINX, Inc.
 
PDF
Cisco Live 2017: Container networking deep dive with Docker Enterprise Editio...
Sanjeev Rampal
 
PDF
NGINX ADC: Basics and Best Practices – EMEA
NGINX, Inc.
 
PPTX
The Challenges of Becoming Cloud Native
Ben Hall
 
PDF
DCSF19 Deploying Istio as an Ingress Controller
Docker, Inc.
 
PPTX
NGINX: Basics and Best Practices
NGINX, Inc.
 
PDF
Kubernetes for Beginners
DigitalOcean
 
PDF
Go for Operations
QAware GmbH
 
PDF
Kubernetes - security you need to know about it
Haydn Johnson
 
PDF
Whats new in brigade 2
LibbySchulze
 
PDF
Container Runtime Security with Falco, by Néstor Salceda
Cloud Native Day Tel Aviv
 
PDF
Cisco Cloud Networking Workshop
Cisco Canada
 
MongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
MongoDB
 
Nginx Deep Dive Kubernetes Ingress
Knoldus Inc.
 
DCSF19 Kubernetes Security with OPA
Docker, Inc.
 
Kubernetes meetup geneva june 2021
SebastienSEYMARC
 
Kubernetes security
Thomas Fricke
 
Kubescape single pane of glass
LibbySchulze1
 
NGINX 101: Web Traffic Encryption with SSL/TLS and NGINX
NGINX, Inc.
 
Interconnecting containers at scale #Dockercon
sarahnovotny
 
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
NGINX, Inc.
 
Cisco Live 2017: Container networking deep dive with Docker Enterprise Editio...
Sanjeev Rampal
 
NGINX ADC: Basics and Best Practices – EMEA
NGINX, Inc.
 
The Challenges of Becoming Cloud Native
Ben Hall
 
DCSF19 Deploying Istio as an Ingress Controller
Docker, Inc.
 
NGINX: Basics and Best Practices
NGINX, Inc.
 
Kubernetes for Beginners
DigitalOcean
 
Go for Operations
QAware GmbH
 
Kubernetes - security you need to know about it
Haydn Johnson
 
Whats new in brigade 2
LibbySchulze
 
Container Runtime Security with Falco, by Néstor Salceda
Cloud Native Day Tel Aviv
 
Cisco Cloud Networking Workshop
Cisco Canada
 

Similar to Security Tips to run Docker in Production (20)

PDF
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Jérôme Petazzoni
 
PDF
Testing Docker Images Security
Jose Manuel Ortega Candel
 
PPTX
Docker Security and Orchestration for DevSecOps wins
Sharath Kumar
 
PDF
How Secure Is Your Container? ContainerCon Berlin 2016
Phil Estes
 
PDF
Security Patterns for Microservice Architectures - London Java Community 2020
Matt Raible
 
PDF
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
PDF
Securité des container
Rachid Zarouali
 
PDF
Testing Docker Images Security -All day dev ops 2017
Jose Manuel Ortega Candel
 
PDF
5GCroCo_DockerSecurityBasics_Training.pdf
MaghsoudAbbasPour1
 
PPTX
Docker Security workshop slides
Docker, Inc.
 
PDF
Docker London: Container Security
Phil Estes
 
PDF
Security Patterns for Microservice Architectures - Oktane20
Matt Raible
 
PDF
Docker Security - Secure Container Deployment on Linux
Michael Boelen
 
PDF
Breaking and fixing_your_dockerized_environments_owasp_appsec_usa2016
Manideep Konakandla
 
PPTX
Docker Security Overview
Sreenivas Makam
 
PDF
Applied Security for Containers, OW2con'18, June 7-8, 2018, Paris
OW2
 
PDF
Cilium - BPF & XDP for containers
Docker, Inc.
 
PDF
Docker Security: Are Your Containers Tightly Secured to the Ship?
Michael Boelen
 
PDF
Security Patterns for Microservice Architectures - SpringOne 2020
Matt Raible
 
PDF
Security Patterns for Microservice Architectures
VMware Tanzu
 
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Jérôme Petazzoni
 
Testing Docker Images Security
Jose Manuel Ortega Candel
 
Docker Security and Orchestration for DevSecOps wins
Sharath Kumar
 
How Secure Is Your Container? ContainerCon Berlin 2016
Phil Estes
 
Security Patterns for Microservice Architectures - London Java Community 2020
Matt Raible
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
Securité des container
Rachid Zarouali
 
Testing Docker Images Security -All day dev ops 2017
Jose Manuel Ortega Candel
 
5GCroCo_DockerSecurityBasics_Training.pdf
MaghsoudAbbasPour1
 
Docker Security workshop slides
Docker, Inc.
 
Docker London: Container Security
Phil Estes
 
Security Patterns for Microservice Architectures - Oktane20
Matt Raible
 
Docker Security - Secure Container Deployment on Linux
Michael Boelen
 
Breaking and fixing_your_dockerized_environments_owasp_appsec_usa2016
Manideep Konakandla
 
Docker Security Overview
Sreenivas Makam
 
Applied Security for Containers, OW2con'18, June 7-8, 2018, Paris
OW2
 
Cilium - BPF & XDP for containers
Docker, Inc.
 
Docker Security: Are Your Containers Tightly Secured to the Ship?
Michael Boelen
 
Security Patterns for Microservice Architectures - SpringOne 2020
Matt Raible
 
Security Patterns for Microservice Architectures
VMware Tanzu
 
Ad

More from Gianluca Arbezzano (19)

PDF
Kubernetes debug like a pro
Gianluca Arbezzano
 
PDF
OSDC 2018 - Distributed monitoring
Gianluca Arbezzano
 
PPTX
Value of your metrics: goodbye monitoring, welcome observability
Gianluca Arbezzano
 
PDF
InfluxCloudi craft container orchestrator
Gianluca Arbezzano
 
PDF
Orbiter and how to extend Docker Swarm
Gianluca Arbezzano
 
PDF
Overview and Opentracing in theory by Gianluca Arbezzano
Gianluca Arbezzano
 
PDF
Monitoring Pull vs Push, InfluxDB and Prometheus
Gianluca Arbezzano
 
PDF
Open Tracing, to order and understand your mess. - ApiConf 2017
Gianluca Arbezzano
 
PDF
Jenkins in the real world - DevOpsCon 2017
Gianluca Arbezzano
 
PDF
Monitor your application and sleep
Gianluca Arbezzano
 
PDF
Tick Stack - Listen your infrastructure and please sleep
Gianluca Arbezzano
 
PDF
Docker Novosibirsk Meetup #3 - Docker in Production
Gianluca Arbezzano
 
PDF
DockerDublin Meetup - News about Docker 1.13
Gianluca Arbezzano
 
PDF
Docker 1.12 and SwarmKit
Gianluca Arbezzano
 
PDF
Time Series Database and Tick Stack
Gianluca Arbezzano
 
PPTX
Queue System and Zend\Queue implementation
Gianluca Arbezzano
 
PPTX
ZfDayIt 2014 - There is a module for everything
Gianluca Arbezzano
 
PPTX
Vagrant - PugMI
Gianluca Arbezzano
 
ODP
Silex, iniziamo
Gianluca Arbezzano
 
Kubernetes debug like a pro
Gianluca Arbezzano
 
OSDC 2018 - Distributed monitoring
Gianluca Arbezzano
 
Value of your metrics: goodbye monitoring, welcome observability
Gianluca Arbezzano
 
InfluxCloudi craft container orchestrator
Gianluca Arbezzano
 
Orbiter and how to extend Docker Swarm
Gianluca Arbezzano
 
Overview and Opentracing in theory by Gianluca Arbezzano
Gianluca Arbezzano
 
Monitoring Pull vs Push, InfluxDB and Prometheus
Gianluca Arbezzano
 
Open Tracing, to order and understand your mess. - ApiConf 2017
Gianluca Arbezzano
 
Jenkins in the real world - DevOpsCon 2017
Gianluca Arbezzano
 
Monitor your application and sleep
Gianluca Arbezzano
 
Tick Stack - Listen your infrastructure and please sleep
Gianluca Arbezzano
 
Docker Novosibirsk Meetup #3 - Docker in Production
Gianluca Arbezzano
 
DockerDublin Meetup - News about Docker 1.13
Gianluca Arbezzano
 
Docker 1.12 and SwarmKit
Gianluca Arbezzano
 
Time Series Database and Tick Stack
Gianluca Arbezzano
 
Queue System and Zend\Queue implementation
Gianluca Arbezzano
 
ZfDayIt 2014 - There is a module for everything
Gianluca Arbezzano
 
Vagrant - PugMI
Gianluca Arbezzano
 
Silex, iniziamo
Gianluca Arbezzano
 
Ad

Recently uploaded (20)

PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PPTX
UI5Con 2025 - Get to Know Your UI5 Tooling
Wouter Lemaire
 
PDF
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PPTX
Machine Learning Benefits Across Industries
SynapseIndia
 
PPTX
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
PDF
GITLAB-CICD_For_Professionals_KodeKloud.pdf
deepaktyagi0048
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
HydITEx corporation Booklet 2025 English
Георгий Феодориди
 
PDF
2025-07-15 EMEA Volledig Inzicht Dutch Webinar
ThousandEyes
 
PDF
Bitcoin+ Escalando sin concesiones - Parte 1
Fernando Paredes García
 
PDF
Rethinking Security Operations - Modern SOC.pdf
Haris Chughtai
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Upgrading to z_OS V2R4 Part 01 of 02.pdf
Flavio787771
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
UI5Con 2025 - Get to Know Your UI5 Tooling
Wouter Lemaire
 
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Machine Learning Benefits Across Industries
SynapseIndia
 
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
GITLAB-CICD_For_Professionals_KodeKloud.pdf
deepaktyagi0048
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
HydITEx corporation Booklet 2025 English
Георгий Феодориди
 
2025-07-15 EMEA Volledig Inzicht Dutch Webinar
ThousandEyes
 
Bitcoin+ Escalando sin concesiones - Parte 1
Fernando Paredes García
 
Rethinking Security Operations - Modern SOC.pdf
Haris Chughtai
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Upgrading to z_OS V2R4 Part 01 of 02.pdf
Flavio787771
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 

Security Tips to run Docker in Production