SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Docker Security
Specific reasons why Docker sucks
Disclaimer: I’m using Docker
wrong
Let this presentation be a discussion of Docker,
it’s threat model, and security concerns and not
a recommendation of how you should use
docker. All examples of using docker in this
presentation are exactly opposite of how you
should be using docker. If you’re interested in
microservices on your internal network, testing
out applications, or developing applications for a
San Francisco startup, docker may be a perfect
solution. If you just want to run a website,
containers do have a substantial benefit.
1970-80’s: Mainframes
The
Application
1980-90’s: Thick Apps
App
App App
App App
App
App
1990-00’s: Segregation
App
App
App App
App
App
App
2000’s: Virtualization (Same)
App
App
App
App
2000-2010’s: The Cloud
Your
app
Your
app
Some
one
else’s
app
Today: Containers
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Not
Your
app
Not
Your
app
Not
Your
app
Not
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Your
app
Containers today vs yesterday
Today
• Disposable
• “I don’t care if I’m
hacked, I’ll just
rebuild” – Jason
• Low profile
• Unikernels take up
MB’s not GB’s
• Scalable
Yesterday
• Very important
• DON’T TOUCH THAT
SERVER OMG
DOWNTIME
• High resources:
• “Fuck it, just install
QT”
• Not scalable
Example
Bsidesroc.com
wordpress
Antitree.com
wordpress
Joethecoolestguyontheinternet.com
Jwilder/nginx-proxy
Antitree.com
MySQL
Bsidesroc.com
MySQL
Static
HTML
Jrcs/lets-encrypt-nginx-proxy-companion
443/TCP
443/TCP
443/TCP
443/TCP
briancranston 9030/TCP
Containers vs VMs
• Containers ~= chroot (on meth)
• Think virtual environment
• They have much lower overhead than VMs
(micro/unikernels)
• Fast but they are not hardware backed
virtualization
• Namespaced process separation not true isolation
• They really have nothing to do with VMs
• Why are we even comparing them to VMs? This
slide is stupid
Container Security
• Containers have been around for decades but
not for security
• Docker made containers popular and sexy
• Oh wait, security? Fuck it, move to production
• But why are they insecure?
Background: Namespaces
• Creates a logical separation of resources
• Namespaces are the core of containers
• Types of namespaces:
• Network: isolated network stack
• Mount: namespaced mount points
• UID/PID: namespace isolation of process and user
ID’s (root inside does not mean root outside)
• Cgroups: controls for shared resources
Background: Capabilities
• A capability is a *nix action a user can perform
• Goal is to restrict “capabilities”
• Privileged process = all the capabilities!
• Unprivileged process = check individual user
capabilities
• Example Capabilities:
• CAP_CHOWN
• CAP_SETUID
• CAP_NET_RAW
• CAP_SYS_RAWIO
Background: AppArmor
• Linux Security Module
• Second line of defense for containers
• Restrict various actions based on a policy
• Example: Mounting
• Block access to /dev/pts so a container can’t read a
host’s terminal
deny mount fstype=devpts
• Example: Utility access
• Block access to /proc/sys/kernel/modprobe so that
attackers can’t replace it with arbitrary code
deny /proc/sys/kerne[^l]*{,/**} wklx,
Background: Seccomp
• Restricts system calls based on a policy
• Block things like
• Kernel manipulation (init_module, finit_module,
delete_module)
• Executing mount options
• Setting the system time
• Reboot
• Blacklist based
• Same technology that Subgraph bases their
container protections on
The Root Threat
A privileged container – one that is running with
root privs -- is your biggest threat to the host
computer
• Think of all the attack vectors your container
could have access to
• Mounted volumes
• Logging resources, scheduled tasks
• Kernel drivers
• Shared devices
1. RW Volume Abuse
• Containers allow you to mount a host volume
inside of a container
docker run -it -v /usr/local/bin:/bin apache
• When root is always root – if the container is
exploited, they will have root access to the
above host system.
• Defense:
• Don’t be an idiot
• Make sure that your images are all unprivileged
• This is why it’s so important to run unprivileged
containers
2. Docker socket control
• Some containers will mount the Docker socket
so it can control other containers
docker run -it –v 
/var/run/docker.sock:/var/run/docker.sock bash
apt-get install docker
• The container docker can control the host
docker now
• From there we can run a docker container in
the host and priv esc to root
• Defense:
• Never mount the docker sock into the container
3. Device sharing
• Docker supports directly passing a device into
a container
• USB devices, bladeRF, whatever
docker run –it –-device=/dev/sda bash
• That container has full access to do whatever it
wants to the device.
• Reformat, inject commands, modify binaries,
etc
• Defense:
• Don’t mount shared devices directly
• Never run privileged containers
4. Shared Networking Exploits
• Containers have a shared bridge interface named
docker0 with an individually namespaced network
stack
• The bridge interface docker0 will forward any
packets back up to eth0
• By default all containers include the NET_RAW
capability
• Result: A container can ARP poison entire network
segments and other containers
• Defense:
• Manually drop the NET_RAW capability
• Setup iptables rules to prevent these types of attacks
• Use third party tools to manage networking
Honorable Mentions
• 5. Kernel exploitation
• 6. LXC 0-day
• 7. Owning a service on the Docker Hub
• 8. Docker service runs as HTTP by default
• 9. Docker service does not verify TLS
certificates by default
• 10. Sensitive environment variable leakage
Recently Patched Examples
• Privileged: SYS_RAWIO abuse (LXC only)
exploits unnecessary capabilities to get direct
access to PCI devices
• Privileged: Ptrace(2) lets a container bypass
seccomp-bpf policies because of a TOCTTOU
issue
• Unprivileged: PID namespace info-leak of
/proc/sched_debug contains namespace-
unaware info to find other containers running
How to secure docker
• Never run privileged containers!
• AppArmor and Seccomp-bpf profiles
• Defaults are good enough
• Custom policies for your container would be even
better
• GRSEC/PAX: Last line of defense in the case
of a kernel exploit
“However, for those that
depend on VMs for
security, Docker is not an
alternative, but a
complement”
@ewindisch – Cloud pioneer
Much security such wow
Bsidesroc.com
wordpress
Antitree.com
wordpress
Joethecoolestguyontheinternet.com
Jwilder/nginx-proxy
Antitree.com
MySQL
Bsidesroc.com
MySQL
Static
HTML
Jrcs/lets-encrypt-nginx-proxy-companion
443/TCP
443/TCP
443/TCP
443/TCP
briancranston 9030/TCP
$3.29/mo
$3.29/mo
$3.29/mo
$3.29/mo
$3.29/mo
Y U CONTAINER?
Bsidesroc.com
wordpress
Antitree.com
wordpress
Joethecoolestguyontheinternet.com
Jwilder/nginx-proxy
Antitree.com
MySQL
Bsidesroc.com
MySQL
Static
HTML
Jrcs/lets-encrypt-nginx-proxy-companion
443/TCP
443/TCP
443/TCP
443/TCP
briancranston 9030/TCP
$3.29/mo
$3.29/mo
$3.29/mo
$3.29/mo
$3.29/mo
“Fuck Docker” - Jason
Secure, but not by default

Weitere ähnliche Inhalte

Was ist angesagt?

Modern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layerModern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layerShakacon
 
Dock ir incident response in a containerized, immutable, continually deploy...
Dock ir   incident response in a containerized, immutable, continually deploy...Dock ir   incident response in a containerized, immutable, continually deploy...
Dock ir incident response in a containerized, immutable, continually deploy...Shakacon
 
Outlook and Exchange for the bad guys
Outlook and Exchange for the bad guysOutlook and Exchange for the bad guys
Outlook and Exchange for the bad guysNick Landers
 
Sticky Keys to the Kingdom
Sticky Keys to the KingdomSticky Keys to the Kingdom
Sticky Keys to the KingdomDennis Maldonado
 
Getting started with open stack
Getting started with open stackGetting started with open stack
Getting started with open stackDan Radez
 
HTTPプロクシライブラリproxy2の設計と実装
HTTPプロクシライブラリproxy2の設計と実装HTTPプロクシライブラリproxy2の設計と実装
HTTPプロクシライブラリproxy2の設計と実装inaz2
 
OpenShift & SELinux with Dan Walsh @rhatdan
OpenShift & SELinux with Dan Walsh @rhatdanOpenShift & SELinux with Dan Walsh @rhatdan
OpenShift & SELinux with Dan Walsh @rhatdanOpenShift Origin
 
BH Arsenal '14 TurboTalk: The Veil-framework
BH Arsenal '14 TurboTalk: The Veil-frameworkBH Arsenal '14 TurboTalk: The Veil-framework
BH Arsenal '14 TurboTalk: The Veil-frameworkVeilFramework
 
Penetration Testing Resource Guide
Penetration Testing Resource Guide Penetration Testing Resource Guide
Penetration Testing Resource Guide Bishop Fox
 
Netscreen Policy Based Routing
Netscreen Policy Based RoutingNetscreen Policy Based Routing
Netscreen Policy Based RoutingBart Jansens
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices ArchitectureIdan Fridman
 
Building an Empire with PowerShell
Building an Empire with PowerShellBuilding an Empire with PowerShell
Building an Empire with PowerShellWill Schroeder
 
Securing Network Access with Open Source solutions
Securing Network Access with Open Source solutionsSecuring Network Access with Open Source solutions
Securing Network Access with Open Source solutionsNick Owen
 
An Introduction to Twisted
An Introduction to TwistedAn Introduction to Twisted
An Introduction to Twistedsdsern
 
Neutron behind the scenes
Neutron   behind the scenesNeutron   behind the scenes
Neutron behind the scenesinbroker
 
y3dips hacking priv8 network
y3dips hacking priv8 networky3dips hacking priv8 network
y3dips hacking priv8 networkidsecconf
 
Veil-PowerView - NovaHackers
Veil-PowerView - NovaHackersVeil-PowerView - NovaHackers
Veil-PowerView - NovaHackersVeilFramework
 
How to write a Neutron Plugin - if you really need to
How to write a Neutron Plugin - if you really need toHow to write a Neutron Plugin - if you really need to
How to write a Neutron Plugin - if you really need tosalv_orlando
 

Was ist angesagt? (20)

Modern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layerModern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layer
 
Dock ir incident response in a containerized, immutable, continually deploy...
Dock ir   incident response in a containerized, immutable, continually deploy...Dock ir   incident response in a containerized, immutable, continually deploy...
Dock ir incident response in a containerized, immutable, continually deploy...
 
Outlook and Exchange for the bad guys
Outlook and Exchange for the bad guysOutlook and Exchange for the bad guys
Outlook and Exchange for the bad guys
 
Sticky Keys to the Kingdom
Sticky Keys to the KingdomSticky Keys to the Kingdom
Sticky Keys to the Kingdom
 
Getting started with open stack
Getting started with open stackGetting started with open stack
Getting started with open stack
 
HTTPプロクシライブラリproxy2の設計と実装
HTTPプロクシライブラリproxy2の設計と実装HTTPプロクシライブラリproxy2の設計と実装
HTTPプロクシライブラリproxy2の設計と実装
 
OpenShift & SELinux with Dan Walsh @rhatdan
OpenShift & SELinux with Dan Walsh @rhatdanOpenShift & SELinux with Dan Walsh @rhatdan
OpenShift & SELinux with Dan Walsh @rhatdan
 
BH Arsenal '14 TurboTalk: The Veil-framework
BH Arsenal '14 TurboTalk: The Veil-frameworkBH Arsenal '14 TurboTalk: The Veil-framework
BH Arsenal '14 TurboTalk: The Veil-framework
 
Penetration Testing Resource Guide
Penetration Testing Resource Guide Penetration Testing Resource Guide
Penetration Testing Resource Guide
 
Netscreen Policy Based Routing
Netscreen Policy Based RoutingNetscreen Policy Based Routing
Netscreen Policy Based Routing
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
Backtrack os 5
Backtrack os 5Backtrack os 5
Backtrack os 5
 
Building an Empire with PowerShell
Building an Empire with PowerShellBuilding an Empire with PowerShell
Building an Empire with PowerShell
 
Securing Network Access with Open Source solutions
Securing Network Access with Open Source solutionsSecuring Network Access with Open Source solutions
Securing Network Access with Open Source solutions
 
The Veil-Framework
The Veil-FrameworkThe Veil-Framework
The Veil-Framework
 
An Introduction to Twisted
An Introduction to TwistedAn Introduction to Twisted
An Introduction to Twisted
 
Neutron behind the scenes
Neutron   behind the scenesNeutron   behind the scenes
Neutron behind the scenes
 
y3dips hacking priv8 network
y3dips hacking priv8 networky3dips hacking priv8 network
y3dips hacking priv8 network
 
Veil-PowerView - NovaHackers
Veil-PowerView - NovaHackersVeil-PowerView - NovaHackers
Veil-PowerView - NovaHackers
 
How to write a Neutron Plugin - if you really need to
How to write a Neutron Plugin - if you really need toHow to write a Neutron Plugin - if you really need to
How to write a Neutron Plugin - if you really need to
 

Andere mochten auch

Just Mouse Jack Init
Just Mouse Jack InitJust Mouse Jack Init
Just Mouse Jack Initantitree
 
Salander v bond 2600
Salander v bond 2600Salander v bond 2600
Salander v bond 2600antitree
 
State of wifi_2016
State of wifi_2016State of wifi_2016
State of wifi_2016antitree
 
A brief history of teledildonics
A brief history of teledildonicsA brief history of teledildonics
A brief history of teledildonicsDb Cooper
 
Rtlsdr presentation by alex 1/3/2014
Rtlsdr presentation by alex 1/3/2014Rtlsdr presentation by alex 1/3/2014
Rtlsdr presentation by alex 1/3/2014Db Cooper
 
Meek and domain fronting public
Meek and domain fronting publicMeek and domain fronting public
Meek and domain fronting publicantitree
 
How [not] to throw a b sides
How [not] to throw a b sidesHow [not] to throw a b sides
How [not] to throw a b sidesantitree
 
28c3 in 15
28c3 in 1528c3 in 15
28c3 in 15antitree
 
Image based automation
Image based automationImage based automation
Image based automationantitree
 
Android Hacking
Android HackingAndroid Hacking
Android Hackingantitree
 

Andere mochten auch (11)

Just Mouse Jack Init
Just Mouse Jack InitJust Mouse Jack Init
Just Mouse Jack Init
 
Salander v bond 2600
Salander v bond 2600Salander v bond 2600
Salander v bond 2600
 
State of wifi_2016
State of wifi_2016State of wifi_2016
State of wifi_2016
 
A brief history of teledildonics
A brief history of teledildonicsA brief history of teledildonics
A brief history of teledildonics
 
Rtlsdr presentation by alex 1/3/2014
Rtlsdr presentation by alex 1/3/2014Rtlsdr presentation by alex 1/3/2014
Rtlsdr presentation by alex 1/3/2014
 
Meek and domain fronting public
Meek and domain fronting publicMeek and domain fronting public
Meek and domain fronting public
 
How [not] to throw a b sides
How [not] to throw a b sidesHow [not] to throw a b sides
How [not] to throw a b sides
 
0x20 hack
0x20 hack0x20 hack
0x20 hack
 
28c3 in 15
28c3 in 1528c3 in 15
28c3 in 15
 
Image based automation
Image based automationImage based automation
Image based automation
 
Android Hacking
Android HackingAndroid Hacking
Android Hacking
 

Ähnlich wie Docker Security

5 Ways to Secure Your Containers for Docker and Beyond
5 Ways to Secure Your Containers for Docker and Beyond5 Ways to Secure Your Containers for Docker and Beyond
5 Ways to Secure Your Containers for Docker and BeyondBlack Duck by Synopsys
 
컨테이너 기술 소개 - Warden, Garden, Docker
컨테이너 기술 소개 - Warden, Garden, Docker컨테이너 기술 소개 - Warden, Garden, Docker
컨테이너 기술 소개 - Warden, Garden, Dockerseungdon Choi
 
Container Security
Container SecurityContainer Security
Container SecuritySalman Baset
 
Docker introduction
Docker introductionDocker introduction
Docker introductionJo Ee Liew
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudSalman Baset
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityPhil Estes
 
Containers and security
Containers and securityContainers and security
Containers and securitysriram_rajan
 
Understanding container security
Understanding container securityUnderstanding container security
Understanding container securityJohn Kinsella
 
Lightweight Virtualization Docker in Practice
Lightweight Virtualization Docker in PracticeLightweight Virtualization Docker in Practice
Lightweight Virtualization Docker in PracticeDocker, Inc.
 
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Sysdig
 
Securing Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupSecuring Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupKumar Ashwin
 
Securing Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupSecuring Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupKumar Ashwin
 
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...NETWAYS
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifeidotCloud
 
Central Iowa Linux Users Group: November Meeting -- Container showdown
Central Iowa Linux Users Group: November Meeting -- Container showdownCentral Iowa Linux Users Group: November Meeting -- Container showdown
Central Iowa Linux Users Group: November Meeting -- Container showdownAndrew Denner
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013dotCloud
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container SecuritySuraj Khetani
 

Ähnlich wie Docker Security (20)

5 Ways to Secure Your Containers for Docker and Beyond
5 Ways to Secure Your Containers for Docker and Beyond5 Ways to Secure Your Containers for Docker and Beyond
5 Ways to Secure Your Containers for Docker and Beyond
 
컨테이너 기술 소개 - Warden, Garden, Docker
컨테이너 기술 소개 - Warden, Garden, Docker컨테이너 기술 소개 - Warden, Garden, Docker
컨테이너 기술 소개 - Warden, Garden, Docker
 
Container Security
Container SecurityContainer Security
Container Security
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production Cloud
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
 
Containers and security
Containers and securityContainers and security
Containers and security
 
Understanding container security
Understanding container securityUnderstanding container security
Understanding container security
 
Docker
DockerDocker
Docker
 
Containers 101
Containers 101Containers 101
Containers 101
 
Lightweight Virtualization Docker in Practice
Lightweight Virtualization Docker in PracticeLightweight Virtualization Docker in Practice
Lightweight Virtualization Docker in Practice
 
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Securing Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupSecuring Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad Meetup
 
Securing Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupSecuring Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad Meetup
 
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifei
 
Central Iowa Linux Users Group: November Meeting -- Container showdown
Central Iowa Linux Users Group: November Meeting -- Container showdownCentral Iowa Linux Users Group: November Meeting -- Container showdown
Central Iowa Linux Users Group: November Meeting -- Container showdown
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container Security
 

Mehr von antitree

Hardening ssh configurations
Hardening ssh configurationsHardening ssh configurations
Hardening ssh configurationsantitree
 
Salander v bond b sides detroit final v3
Salander v bond b sides detroit final v3Salander v bond b sides detroit final v3
Salander v bond b sides detroit final v3antitree
 
Pentesting embedded
Pentesting embeddedPentesting embedded
Pentesting embeddedantitree
 
Corporate Intelligence: Bridging the security and intelligence community
Corporate Intelligence: Bridging the security and intelligence communityCorporate Intelligence: Bridging the security and intelligence community
Corporate Intelligence: Bridging the security and intelligence communityantitree
 
Lock picking barcamp
Lock picking barcampLock picking barcamp
Lock picking barcampantitree
 
Lock picking 2600
Lock picking 2600Lock picking 2600
Lock picking 2600antitree
 
Anti tree firesheep
Anti tree firesheepAnti tree firesheep
Anti tree firesheepantitree
 
Hackerspaces
HackerspacesHackerspaces
Hackerspacesantitree
 
Intro to IPv6 by Ben Woodruff
Intro to IPv6 by Ben WoodruffIntro to IPv6 by Ben Woodruff
Intro to IPv6 by Ben Woodruffantitree
 
Anonymity Systems: Tor
Anonymity Systems: TorAnonymity Systems: Tor
Anonymity Systems: Torantitree
 
Dll hijacking
Dll hijackingDll hijacking
Dll hijackingantitree
 

Mehr von antitree (12)

Hardening ssh configurations
Hardening ssh configurationsHardening ssh configurations
Hardening ssh configurations
 
Salander v bond b sides detroit final v3
Salander v bond b sides detroit final v3Salander v bond b sides detroit final v3
Salander v bond b sides detroit final v3
 
Pentesting embedded
Pentesting embeddedPentesting embedded
Pentesting embedded
 
Tor
TorTor
Tor
 
Corporate Intelligence: Bridging the security and intelligence community
Corporate Intelligence: Bridging the security and intelligence communityCorporate Intelligence: Bridging the security and intelligence community
Corporate Intelligence: Bridging the security and intelligence community
 
Lock picking barcamp
Lock picking barcampLock picking barcamp
Lock picking barcamp
 
Lock picking 2600
Lock picking 2600Lock picking 2600
Lock picking 2600
 
Anti tree firesheep
Anti tree firesheepAnti tree firesheep
Anti tree firesheep
 
Hackerspaces
HackerspacesHackerspaces
Hackerspaces
 
Intro to IPv6 by Ben Woodruff
Intro to IPv6 by Ben WoodruffIntro to IPv6 by Ben Woodruff
Intro to IPv6 by Ben Woodruff
 
Anonymity Systems: Tor
Anonymity Systems: TorAnonymity Systems: Tor
Anonymity Systems: Tor
 
Dll hijacking
Dll hijackingDll hijacking
Dll hijacking
 

Kürzlich hochgeladen

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Kürzlich hochgeladen (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

Docker Security

  • 2. Disclaimer: I’m using Docker wrong Let this presentation be a discussion of Docker, it’s threat model, and security concerns and not a recommendation of how you should use docker. All examples of using docker in this presentation are exactly opposite of how you should be using docker. If you’re interested in microservices on your internal network, testing out applications, or developing applications for a San Francisco startup, docker may be a perfect solution. If you just want to run a website, containers do have a substantial benefit.
  • 4. 1980-90’s: Thick Apps App App App App App App App
  • 9. Containers today vs yesterday Today • Disposable • “I don’t care if I’m hacked, I’ll just rebuild” – Jason • Low profile • Unikernels take up MB’s not GB’s • Scalable Yesterday • Very important • DON’T TOUCH THAT SERVER OMG DOWNTIME • High resources: • “Fuck it, just install QT” • Not scalable
  • 11. Containers vs VMs • Containers ~= chroot (on meth) • Think virtual environment • They have much lower overhead than VMs (micro/unikernels) • Fast but they are not hardware backed virtualization • Namespaced process separation not true isolation • They really have nothing to do with VMs • Why are we even comparing them to VMs? This slide is stupid
  • 12. Container Security • Containers have been around for decades but not for security • Docker made containers popular and sexy • Oh wait, security? Fuck it, move to production • But why are they insecure?
  • 13. Background: Namespaces • Creates a logical separation of resources • Namespaces are the core of containers • Types of namespaces: • Network: isolated network stack • Mount: namespaced mount points • UID/PID: namespace isolation of process and user ID’s (root inside does not mean root outside) • Cgroups: controls for shared resources
  • 14. Background: Capabilities • A capability is a *nix action a user can perform • Goal is to restrict “capabilities” • Privileged process = all the capabilities! • Unprivileged process = check individual user capabilities • Example Capabilities: • CAP_CHOWN • CAP_SETUID • CAP_NET_RAW • CAP_SYS_RAWIO
  • 15. Background: AppArmor • Linux Security Module • Second line of defense for containers • Restrict various actions based on a policy • Example: Mounting • Block access to /dev/pts so a container can’t read a host’s terminal deny mount fstype=devpts • Example: Utility access • Block access to /proc/sys/kernel/modprobe so that attackers can’t replace it with arbitrary code deny /proc/sys/kerne[^l]*{,/**} wklx,
  • 16. Background: Seccomp • Restricts system calls based on a policy • Block things like • Kernel manipulation (init_module, finit_module, delete_module) • Executing mount options • Setting the system time • Reboot • Blacklist based • Same technology that Subgraph bases their container protections on
  • 17. The Root Threat A privileged container – one that is running with root privs -- is your biggest threat to the host computer • Think of all the attack vectors your container could have access to • Mounted volumes • Logging resources, scheduled tasks • Kernel drivers • Shared devices
  • 18. 1. RW Volume Abuse • Containers allow you to mount a host volume inside of a container docker run -it -v /usr/local/bin:/bin apache • When root is always root – if the container is exploited, they will have root access to the above host system. • Defense: • Don’t be an idiot • Make sure that your images are all unprivileged • This is why it’s so important to run unprivileged containers
  • 19. 2. Docker socket control • Some containers will mount the Docker socket so it can control other containers docker run -it –v /var/run/docker.sock:/var/run/docker.sock bash apt-get install docker • The container docker can control the host docker now • From there we can run a docker container in the host and priv esc to root • Defense: • Never mount the docker sock into the container
  • 20. 3. Device sharing • Docker supports directly passing a device into a container • USB devices, bladeRF, whatever docker run –it –-device=/dev/sda bash • That container has full access to do whatever it wants to the device. • Reformat, inject commands, modify binaries, etc • Defense: • Don’t mount shared devices directly • Never run privileged containers
  • 21. 4. Shared Networking Exploits • Containers have a shared bridge interface named docker0 with an individually namespaced network stack • The bridge interface docker0 will forward any packets back up to eth0 • By default all containers include the NET_RAW capability • Result: A container can ARP poison entire network segments and other containers • Defense: • Manually drop the NET_RAW capability • Setup iptables rules to prevent these types of attacks • Use third party tools to manage networking
  • 22. Honorable Mentions • 5. Kernel exploitation • 6. LXC 0-day • 7. Owning a service on the Docker Hub • 8. Docker service runs as HTTP by default • 9. Docker service does not verify TLS certificates by default • 10. Sensitive environment variable leakage
  • 23. Recently Patched Examples • Privileged: SYS_RAWIO abuse (LXC only) exploits unnecessary capabilities to get direct access to PCI devices • Privileged: Ptrace(2) lets a container bypass seccomp-bpf policies because of a TOCTTOU issue • Unprivileged: PID namespace info-leak of /proc/sched_debug contains namespace- unaware info to find other containers running
  • 24. How to secure docker • Never run privileged containers! • AppArmor and Seccomp-bpf profiles • Defaults are good enough • Custom policies for your container would be even better • GRSEC/PAX: Last line of defense in the case of a kernel exploit
  • 25. “However, for those that depend on VMs for security, Docker is not an alternative, but a complement” @ewindisch – Cloud pioneer
  • 26. Much security such wow Bsidesroc.com wordpress Antitree.com wordpress Joethecoolestguyontheinternet.com Jwilder/nginx-proxy Antitree.com MySQL Bsidesroc.com MySQL Static HTML Jrcs/lets-encrypt-nginx-proxy-companion 443/TCP 443/TCP 443/TCP 443/TCP briancranston 9030/TCP $3.29/mo $3.29/mo $3.29/mo $3.29/mo $3.29/mo
  • 28. “Fuck Docker” - Jason Secure, but not by default