SlideShare a Scribd company logo
Docker Security
Secure container deployment on Linux
openSUSE conference, The Hague, 3 May 2015
Michael Boelen
michael.boelen@cisofy.com
Michael Boelen
● Founder of CISOfy
● Security + Open Source
○ Rootkit Hunter (malware scan)
○ Lynis (security scan)
● Analysis → Simplify
2
Docker and Me
● Understanding
● Development
● Using it
3
Results of Research
● Limited resources
● Outdated articles
● Conflicting information
● Security not important?
Proposal: Let's fix (some of) these issues
4
Proposal
Security proposals
● Tooling to simplify Linux security → Lynis
● Articles about Docker security → Blog posts
● Provide input to (GitHub) projects → You
● Presentations → In progress
5
What
● Stabilize the vessel
● Secure containers
6
How
➔ Benefits
➔ Risks
➔ Defenses
➔ Best Practices
7
Photo credits: imagebase.net
Why?
Data!
8
Why Security?
Data!
● Docker + Software = Data Sharing
● Keep it confidential
9
Warning
From this point on,
there might be lies...
10
Docker Benefits
11
Primary Benefits
● Flexibility
● Scalability
● Better testing
12
Segregation
● The art of splitting up things
● The "Holy Grail" of security
● Smaller units = more control
13
Granular Control
● Limit users, access and data
● Easier to understand
● Easier to defend
14
Information Disclosure
● Decreased chance of data leakage
● Less resources accessible
15
Risks
16
Risk: Software Issues
Software security
● Bugs
● Security vulnerabilities
● Regular updates needed
● Backdoors? Auditing?
17
Risk: Knowledge gap
Quickly evolving
● IT auditor
● Your colleagues
● You...?
18
Risk: "Does not contain"
No full isolation (yet)
● Treat containers as a host
● Know strengths and weaknesses
19
Defenses
20
Docker Website
Start at the download
● HTTPS
● Digital signatures
● Images verified after downloading
21
Docker Containers
● Namespaces and cgroups
● Seccomp
● Capabilities
● Frameworks
22
Namespaces
Isolates parts of the OS
● PID namespaces
● Network namespaces
● User namespaces → Not really!
23
Namespaces
More spaces
● IPC namespaces (process communication)
● UTS namespaces (hostname/NIS)
● Mount namespaces
24
Seccomp
● Secure computing mode
● Filters syscalls with BPF
● Isolation, not virtualization
● Used in software like:
○ Chrome, OpenSSH, vsftpd
○ LXD and Mbox
25
Seccomp
Default list of blocked calls
● kexec_load
● open_by_handle_at
● init_module
● finit_module
● delete_module
26
Control Groups (cgroups)
● Restrict resources
● Prioritize
● Accounting
● Control
27
Capabilities
● Root user → split into roles
● Default list of allowed capabilities
● --cap-add / --cap-drop
● Combine (e.g. add all, drop a few)
28
Capabilities
Examples
● CAP_NET_ADMIN - Configure networking
● CAP_SETPCAP - Process capabilities
● CAP_SYS_MODULE - Insert and remove
kernel modules
29
Frameworks
AppArmor / SELinux
● MAC frameworks
● Help with containment
● Learning them now, will pay off later
30
Audit Subsystem
● Developed by Red Hat
● Files / system calls
● Monitors the (system | file) integrity
31
Auditing
Audit (example)
# Time related calls
-a always,exit -S adjtimex -S settimeofday -S stime -k time-change
-a always,exit -S clock_settime -k time-change
# Hostname and domain
-a always,exit -S sethostname -S setdomainname -k system-locale
# Password files
-w /etc/group -p wa -k identity
-w /etc/passwd -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /etc/sudoers -p wa -k identity
32
Best Practices
33
Docker Host Hardening 1/2
● Security = Defense in Depth
● Use AppArmor / SELinux / GRSEC
● Limit
○ users / services / network
34
Docker Host Hardening 2/2
● Update your kernel on a regular basis
● Stay up-to-date with Docker
● Limit Docker permissions
35
Containers
Harden your Containers
● Use AppArmor / SELinux
● Drop capabilities (man capabilities)
● Filter syscalls (seccomp)
● Network filtering (iptables)
36
Read-Only Containers
Least amount of privileges
● Docker 1.5
● --read-only
● Restrict writing to volumes
37
Logging
Don't let containers be a black box
● Docker 1.6
● --log-driver
○ none
○ syslog
○ json-file
38
Limit Resources
Ulimit
● Default too high
● Set new container default
○ Docker 1.6
○ --default-ulimit
● On run: --ulimit
39
Docker Management
"Invisibilize"
● Encrypt connections
● Configure and use TLS, set variables:
○ DOCKER_HOST
○ DOCKER_TLS_VERIFY
40
Docker Management
SSH in containers
● Don't use this..
● Use “docker exec -it mycontainer bash”
41
Read-Only
● Mounts
● Data
● Configuration
● Use --read-only
42
Using Mappings
● Map users to non-privileged
○ /etc/subuid
○ /etc/subgid
43
Trust
Or Don't...
● Verify downloads
● Be careful with images from others
● Measure, monitor, audit
44
Auditing
Tools
● Lynis
● OpenSCAP
45
Docker News
Things go quick with Docker
● Stay informed
● Follow the Docker blog
● Keep an eye on Docker (/LXC/LXD) news
46
Questions?
47
More Docker Security
● Blog: linux-audit.com
● Twitter: @mboelen
48

More Related Content

What's hot (20)

PDF
Docker Security - Continuous Container Security
Dieter Reuter
 
PDF
Docker and kernel security
smart_bit
 
PDF
Container Security
Salman Baset
 
PDF
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
Docker, Inc.
 
PDF
5 Ways to Secure Your Containers for Docker and Beyond
Black Duck by Synopsys
 
PDF
Docker London: Container Security
Phil Estes
 
PDF
Docker Security and Content Trust
ehazlett
 
PDF
All Things Open 2017: How to Treat a Network as a Container
Rosemary Wang
 
PDF
Troubleshooting Tips from a Docker Support Engineer
Jeff Anderson
 
PDF
Justin Cormack - The 10 Container Security Tricks That Will Help You Sleep At...
Codemotion
 
PPTX
Docker & Daily DevOps
Satria Ady Pradana
 
PDF
Container Security
Jie Liau
 
PDF
Secure Substrate: Least Privilege Container Deployment
Docker, Inc.
 
PDF
Container Security Deep Dive & Kubernetes
Aqua Security
 
ODP
OpenShift & SELinux with Dan Walsh @rhatdan
OpenShift Origin
 
PPTX
Docker Container Security - A Network View
NeuVector
 
PDF
Ryan Koop's Docker Chicago Meetup Demo March 12 2014
Cohesive Networks
 
PDF
Securing Applications and Pipelines on a Container Platform
All Things Open
 
PDF
Integrating Linux Systems with Active Directory Using Open Source Tools
All Things Open
 
PPT
Container security
Anthony Chow
 
Docker Security - Continuous Container Security
Dieter Reuter
 
Docker and kernel security
smart_bit
 
Container Security
Salman Baset
 
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
Docker, Inc.
 
5 Ways to Secure Your Containers for Docker and Beyond
Black Duck by Synopsys
 
Docker London: Container Security
Phil Estes
 
Docker Security and Content Trust
ehazlett
 
All Things Open 2017: How to Treat a Network as a Container
Rosemary Wang
 
Troubleshooting Tips from a Docker Support Engineer
Jeff Anderson
 
Justin Cormack - The 10 Container Security Tricks That Will Help You Sleep At...
Codemotion
 
Docker & Daily DevOps
Satria Ady Pradana
 
Container Security
Jie Liau
 
Secure Substrate: Least Privilege Container Deployment
Docker, Inc.
 
Container Security Deep Dive & Kubernetes
Aqua Security
 
OpenShift & SELinux with Dan Walsh @rhatdan
OpenShift Origin
 
Docker Container Security - A Network View
NeuVector
 
Ryan Koop's Docker Chicago Meetup Demo March 12 2014
Cohesive Networks
 
Securing Applications and Pipelines on a Container Platform
All Things Open
 
Integrating Linux Systems with Active Directory Using Open Source Tools
All Things Open
 
Container security
Anthony Chow
 

Similar to Docker Security - Secure Container Deployment on Linux (20)

PDF
Docker Security: Are Your Containers Tightly Secured to the Ship?
Michael Boelen
 
PDF
How Secure Is Your Container? ContainerCon Berlin 2016
Phil Estes
 
PDF
Testing Docker Images Security
Jose Manuel Ortega Candel
 
PDF
Testing Docker Security Linuxlab 2017
Jose Manuel Ortega Candel
 
PPTX
Docker Security
antitree
 
PDF
OSDC 2016 - Inspecting Security of Docker formatted Container Images to find ...
NETWAYS
 
PDF
Is Docker Secure?
Manideep Konakandla
 
PDF
Testing Docker Images Security -All day dev ops 2017
Jose Manuel Ortega Candel
 
ODP
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
Docker, Inc.
 
PDF
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Phil Estes
 
PDF
Unraveling Docker Security: Lessons From a Production Cloud
Salman Baset
 
PPTX
Docker Container Security
Suraj Khetani
 
PDF
Docker security: Rolling out Trust in your container
Ronak Kogta
 
PDF
How secure is your Docker Container pipeline?
Manideep Konakandla
 
PPTX
Exploring Docker Security
Patrick Kleindienst
 
PDF
Docker, Linux Containers, and Security: Does It Add Up?
Jérôme Petazzoni
 
PDF
Breaking and fixing_your_dockerized_environments_owasp_appsec_usa2016
Manideep Konakandla
 
PDF
Testing Docker Images Security -NcN edition
Jose Manuel Ortega Candel
 
PDF
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
PDF
5GCroCo_DockerSecurityBasics_Training.pdf
MaghsoudAbbasPour1
 
Docker Security: Are Your Containers Tightly Secured to the Ship?
Michael Boelen
 
How Secure Is Your Container? ContainerCon Berlin 2016
Phil Estes
 
Testing Docker Images Security
Jose Manuel Ortega Candel
 
Testing Docker Security Linuxlab 2017
Jose Manuel Ortega Candel
 
Docker Security
antitree
 
OSDC 2016 - Inspecting Security of Docker formatted Container Images to find ...
NETWAYS
 
Is Docker Secure?
Manideep Konakandla
 
Testing Docker Images Security -All day dev ops 2017
Jose Manuel Ortega Candel
 
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
Docker, Inc.
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Phil Estes
 
Unraveling Docker Security: Lessons From a Production Cloud
Salman Baset
 
Docker Container Security
Suraj Khetani
 
Docker security: Rolling out Trust in your container
Ronak Kogta
 
How secure is your Docker Container pipeline?
Manideep Konakandla
 
Exploring Docker Security
Patrick Kleindienst
 
Docker, Linux Containers, and Security: Does It Add Up?
Jérôme Petazzoni
 
Breaking and fixing_your_dockerized_environments_owasp_appsec_usa2016
Manideep Konakandla
 
Testing Docker Images Security -NcN edition
Jose Manuel Ortega Candel
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
5GCroCo_DockerSecurityBasics_Training.pdf
MaghsoudAbbasPour1
 
Ad

More from Michael Boelen (11)

PDF
Lets make better scripts
Michael Boelen
 
PDF
Getting Traction for (your) Open Source Projects
Michael Boelen
 
PDF
Linux Security Scanning with Lynis
Michael Boelen
 
PDF
Dealing with Linux Malware
Michael Boelen
 
PDF
Linux Hardening
Michael Boelen
 
PDF
Handling of compromised Linux systems
Michael Boelen
 
PDF
Linux Security, from Concept to Tooling
Michael Boelen
 
PDF
Linux Security for Developers
Michael Boelen
 
PDF
Commercieel gaan met je open source project
Michael Boelen
 
PDF
How Many Linux Security Layers Are Enough?
Michael Boelen
 
PDF
Lynis - Hardening and auditing for Linux, Mac and Unix - NLUUG May 2014
Michael Boelen
 
Lets make better scripts
Michael Boelen
 
Getting Traction for (your) Open Source Projects
Michael Boelen
 
Linux Security Scanning with Lynis
Michael Boelen
 
Dealing with Linux Malware
Michael Boelen
 
Linux Hardening
Michael Boelen
 
Handling of compromised Linux systems
Michael Boelen
 
Linux Security, from Concept to Tooling
Michael Boelen
 
Linux Security for Developers
Michael Boelen
 
Commercieel gaan met je open source project
Michael Boelen
 
How Many Linux Security Layers Are Enough?
Michael Boelen
 
Lynis - Hardening and auditing for Linux, Mac and Unix - NLUUG May 2014
Michael Boelen
 
Ad

Recently uploaded (20)

PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Digital Circuits, important subject in CS
contactparinay1
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 

Docker Security - Secure Container Deployment on Linux