SlideShare une entreprise Scribd logo
1  sur  52
operating docker securely
Jen  Andre
about me
@fun_cuddles  /  jenpire.com  /  organizer  @BostonGoLang  
co-­‐founder  @threatstack,    formely  Mandiant  /  Symantec  
**  I  HAVE  NO  AFFILIATION  WITH  THE  SMART  PEOPLE  AT  DOCKER  **
REALITY  CHECK
*  I  stole  this  shamelessly  from  @petecheslock
houston,  we  have  concerns
managing misinformation
VS
http://iamondemand.com/blog/5-key-benefits-of-docker-ci-version-control-portability-isolation-and-security/
http://www.securityweek.com/disrupting-disruptor-security-docker-containers
-­‐  your  security  engineer
“Docker needs to
fix all of these
problems.”
“It’s probably
fine.”
-­‐ -­‐your  hipster  devops    
-­‐ gal  or  guy
is docker secure?
this is the wrong question.
How  can  we  enable  organizaOons  (security  
+  dev  +  ops)  operate  Docker  safely?
1. Understand  your  threat  model  
2. Understand  Docker’s  limitaOons  
3. Understand  the  tools  available  to  us    
4. Evolve  the  Docker  security  ecosystem  :)
1.  How  do  I  trust  the  code?  
2.  How  do  I  know  if  I’ve  configured  my  Docker  host  +  
containers  in  a  secure  way?  
3.  How  do  containers  change  my  security  pracOces,  
e.g.  monitoring?
empathy: understanding the security
engineer’s concerns
but also consider
the  consistency  of  applicaOon  environments  in  Docker  
containers  provides  for  interesOng  opportuniHes  for  
new  automaOon  around  security  hardening,  audiOng,  
and  tesOng.
issues with trust
docker  images  are  binaries  (opaque)  
who  am  I  trusOng?  
who  is  updaOng  these  things  when  there  is  a  criOcal  
security  flaw?  
The problem of patch management is a
real thing.
http://www.banyanops.com/blog/analyzing-docker-hub/
confusing advice
http://serverfault.com/questions/611082/how-to-handle-security-updates-within-docker-containers
always be updating!
• Do  perform  security  upgrades  (debian  example  
below)  
• sudo	
  docker	
  exec	
  -­‐it	
  <container>	
  apt-­‐get	
  update	
  	
  
• sudo	
  docker	
  exec	
  -­‐it	
  <container>	
  apt-­‐get	
  upgrade	
  
-­‐s	
  |	
  grep	
  -­‐i	
  security	
  #	
  dry	
  run	
  
• sudo	
  docker	
  exec	
  -­‐it	
  <container>	
  apt-­‐get	
  upgrade	
  
#	
  commit	
  changes	
  when	
  done	
  
who are you
trusting?
what  if  someone  
replaced  libc  with  a  
backdoored  version?
community  
addressing trust
automate  policy  audiOng  +  
enforcement
for  a  given  container,  tell  me  who/what  
I  am  trusOng
build  from  a  trusted  base  image
be  aware  of  who  you  are  trusOng
don’t  overrely  on  Docker  hub
tooling  to  apply  and    
validate  security  updates
more advice
• “The  best  opOon  is  to  block  index.docker.io  locally,  and  
download  and  verify  images  manually  before  imporOng  
them  into  Docker  using  docker  load.”  
• hcps://Otanous.com/posts/docker-­‐insecurity#fn:4  
• Use  a  private  docker  registry  
• hcps://www.digitalocean.com/community/tutorials/how-­‐to-­‐set-­‐up-­‐a-­‐private-­‐docker-­‐registry-­‐
on-­‐ubuntu-­‐14-­‐04  ,  hcps://quay.io        
• Use  RedHat  cerOfied  containers  
•   hcp://www.redhat.com/en/about/press-­‐releases/red-­‐hat-­‐announces-­‐cerOficaOon-­‐for-­‐
containerized-­‐applicaOons-­‐extends-­‐customer-­‐confidence-­‐and-­‐trust-­‐to-­‐the-­‐cloud  
opportunities
• trust,  but  verify:  build  an  binary  audiOng  tool  for  Docker  
images!  
• e.g.,  scan  images,  validate  installed  libraries  and  binaries    do  
not  have  criOcal  security  issues  and  align  with  signed  package  
manifests.  
• hcps://github.com/banyanops/collector    +`cruh’  but  for  containers?  
• hcps://github.com/OpenSCAP/container-­‐compliance  -­‐  RHEL  only  
• contribute  to  the  packaging/distribuOon  trust  conversaOon!  
• hcps://github.com/docker/distribuOon/pull/179  
• references:  hcp://theupdateframework.com/  
best practices,
hardening, &
secure
configurations
]
security empathy
How  do  I  know  if  I’ve  
configured  my  Docker  host  +  
containers  in  a  secure  way?  
the good!
Docker  released  a  
comprehensive  
security  benchmark.
hcps://blog.docker.com/2015/05/understanding-­‐docker-­‐security-­‐and-­‐best-­‐pracOces/
the bad
…it’s  118  pages  of  material!
the good!: can we automate these
checks?
for  most  of  them,  yes!  
github.com/dockersecuritytools/bacen  -­‐  IN  PROGRESS
serverspec example
the problem of isolation
container hardening: the good
there’s actually a lot of knobs to turn!
• SELinux  /  AppArmor  policies  (—security-­‐opt)    (more  
about  this  later)  
• capabiliHes  (—cap-­‐add,  —cap-­‐drop)    
• “give  root  without  all  of  root”
• cgroups  (resource  allocaOon,  many  flags)  
• Example:  $ docker run -it --rm -m
128m fedora bash
• hcps://goldmann.pl/blog/2014/09/11/resource-­‐management-­‐in-­‐docker/  
• user  namespaces  (soon!)  so  you  don’t  have  to  run  
id=0  processes  as  root!  
• seccomp  filtering  to  permit  or  block  individual  
system  calls  (soon!)  
• hcp://opensource.com/business/15/3/docker-­‐security-­‐future
the bad
there’s a lot of knobs to turn :(
we can do better.
what  problems  are  they  trying  to  solve?
AppArmor  +  SELinux
a question
if  engineers  can’t  figure  out  how  to  build  and  apply  SELinux  policies  now,    
how  will  Docker  change  things?
apparmor
a  gentler  mandatory  access  control  system  
hcps://wiki.ubuntu.com/AppArmor  
introducing  
#include <tunables/global>
/usr/sbin/tcpdump {
#include <abstractions/base>
#include <abstractions/nameservice>
#include <abstractions/user-tmp>
capability net_raw,
capability setuid,
capability setgid,
capability dac_override,
network raw,
network packet,
# for -D
capability sys_module,
@{PROC}/bus/usb/ r,
@{PROC}/bus/usb/** r,
# for -F and -w
audit deny @{HOME}/.* mrwkl,
audit deny @{HOME}/.*/ rw,
audit deny @{HOME}/.*/** mrwkl,
audit deny @{HOME}/bin/ rw,
audit deny @{HOME}/bin/** mrwkl,
@{HOME}/ r,
@{HOME}/** rw,
/usr/sbin/tcpdump r,
}
name of profile — generally the
binary.
the permitted (or denied)
capabilities
the files it can access (or is denied
access to).
• Docker’s  default  capabiliOes  are  
set  by  app  armor!  (and  turned  
off  when  you  docker	
  run	
  —
privileged=true)    
• be  careful:  when  you  supply  
your  own  apparmor  profile,  
your  are  essenOally  resetng  
the  capabiliOes.  
• copy  or  inherit  these  when  you  create  a  
new  profile  for  your  containers.      
this looks familiar…
using apparmor with
1. Create  the  custom  profile:	
  vim	
  my_container_profile	
  
2. Load  it  into  app  armor:  cat	
  my_container_profile	
  |	
  
sudo	
  apparmor_parser	
  -­‐r  
3. `
4. Run  it  with  your  docker  container:  docker	
  run	
  —
security-­‐opt=“apparmor:my_container_profile”	
  
5. $$$  Profit?
ok but what if I break things?
tip:
make  a  permissive  profile,  and  run  it  in  complain  mode
sudo	
  aa-­‐complain	
  my_container_profile
it  will  log  to  auditd
type=AVC	
  msg=audit(1390936201.188:15647):	
  apparmor="AUDIT"	
  
operation="file_lock"	
  parent=7873	
  profile="my_container_profile"	
  f	
  
name="/tmp/pam_krb5_tmp_FqhNDa"	
  pid=7875	
  comm="sshd"	
  
requested_mask="k"	
  denied_mask="k"	
  fsuid=0	
  ouid=0	
  
iterate  unOl  right.
“Great! but this is still hard
and annoying.”
what if you could automate it?
tip:
use  aa-­‐logprof  to  generate  the  apparmor  profiles  
automagically?
aa-­‐logprof	
  [	
  -­‐d	
  /path/to/profiles	
  ]	
  [	
  -­‐f	
  /path/to/logfile	
  ]	
  
!!  don’t  use  these  without  manual  review  and  ediHng  !!
http://manpages.ubuntu.com/manpages/natty/man8/aa-­‐logprof.8.html
(ok: we still need better tooling)
a vision
• IF  in  the  future…  
• DockerHub  registry  becomes  your  go-­‐to  trusted  
distribuOon  source  for  applicaOons.…  
•   Why  not    
• Have  a  registry  for  apparmor  and  SELinux  profiles  
geared  for  official  dockerized  app  containers?  
• …Include  seccomp  filters  and  other  security  configs?  
• Share  your  polices  &  reduce  the  burden  of  having  to  
harden  your  own  apps/containers.
#	
  fetch	
  apparmor	
  security	
  profile	
  for	
  wordpress	
  
image	
  
docker	
  security-­‐profile	
  fetch	
  wordpress:latest	
  
	
  	
  
#	
  you	
  can	
  even	
  fetch	
  by	
  image	
  /	
  tag	
  
docker	
  security-­‐profile	
  fetch	
  
0cc6ffbf1a0cd78ab244c4b3b5cef13618bf4c8bcd229ec2673
1a951c33df72e	
  	
  
#	
  allow	
  users	
  to	
  submit/push	
  their	
  own	
  app	
  armor	
  
profiles	
  	
  
docker	
  security-­‐profile	
  push	
  —-­‐profile=“apparmor:/
etc/apparmor/wordpress.profile”	
  jandre/
wordpress:custom
in conclusion
• we  need  more  automaOon  around  security  audiOng,  
hardening,  tesOng,  and  monitoring  
• InnovaOon  here  should  come  not  just  from  the  
Docker  folks.  
• The  consistency  of  Docker  containers  enables  us  to  
be  innovaOve  in  how  we  automate  the  above  ^^  
is this interesting to you?
• contact  me!  jandre@gmail.com  
• follow  @dockersecurity  for  news

Contenu connexe

Tendances

Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefNathen Harvey
 
DevSecCon Tel Aviv 2018 - End2End containers SSDLC by Vitaly Davidoff
DevSecCon Tel Aviv 2018 - End2End containers SSDLC by Vitaly DavidoffDevSecCon Tel Aviv 2018 - End2End containers SSDLC by Vitaly Davidoff
DevSecCon Tel Aviv 2018 - End2End containers SSDLC by Vitaly DavidoffDevSecCon
 
DevOOPS: Attacks and Defenses for DevOps Toolchains
DevOOPS: Attacks and Defenses for DevOps ToolchainsDevOOPS: Attacks and Defenses for DevOps Toolchains
DevOOPS: Attacks and Defenses for DevOps ToolchainsChris Gates
 
DevSecCon London 2017: Hands-on secure software development from design to de...
DevSecCon London 2017: Hands-on secure software development from design to de...DevSecCon London 2017: Hands-on secure software development from design to de...
DevSecCon London 2017: Hands-on secure software development from design to de...DevSecCon
 
Continuous Security Testing with Devops - OWASP EU 2014
Continuous Security Testing  with Devops - OWASP EU 2014Continuous Security Testing  with Devops - OWASP EU 2014
Continuous Security Testing with Devops - OWASP EU 2014Stephen de Vries
 
Banfootguns devseccon 2019
Banfootguns devseccon 2019Banfootguns devseccon 2019
Banfootguns devseccon 2019Morgan Roman
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeColdFusionConference
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?AFUP_Limoges
 
Security Testing with Zap
Security Testing with ZapSecurity Testing with Zap
Security Testing with ZapSoluto
 
Akka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile gamesAkka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile gamesYan Cui
 
Drupal Deployment
Drupal DeploymentDrupal Deployment
Drupal DeploymentJeff Eaton
 
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)Alexandre Gouaillard
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Codemotion
 
DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim KadlecDevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim KadlecDevSecCon
 
DevSecCon Singapore 2018 - System call auditing made effective with machine l...
DevSecCon Singapore 2018 - System call auditing made effective with machine l...DevSecCon Singapore 2018 - System call auditing made effective with machine l...
DevSecCon Singapore 2018 - System call auditing made effective with machine l...DevSecCon
 
Sec4dev 2021 - Catch Me If You can : Continuous Delivery vs. Security Assurance
Sec4dev 2021  - Catch Me If You can : Continuous Delivery vs. Security AssuranceSec4dev 2021  - Catch Me If You can : Continuous Delivery vs. Security Assurance
Sec4dev 2021 - Catch Me If You can : Continuous Delivery vs. Security AssuranceAbdessamad TEMMAR
 
DevOpsDays Singapore Habitat Ignite
DevOpsDays Singapore Habitat IgniteDevOpsDays Singapore Habitat Ignite
DevOpsDays Singapore Habitat IgniteMatt Ray
 

Tendances (20)

Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Agility Requires Safety
Agility Requires SafetyAgility Requires Safety
Agility Requires Safety
 
DevSecCon Tel Aviv 2018 - End2End containers SSDLC by Vitaly Davidoff
DevSecCon Tel Aviv 2018 - End2End containers SSDLC by Vitaly DavidoffDevSecCon Tel Aviv 2018 - End2End containers SSDLC by Vitaly Davidoff
DevSecCon Tel Aviv 2018 - End2End containers SSDLC by Vitaly Davidoff
 
DevOOPS: Attacks and Defenses for DevOps Toolchains
DevOOPS: Attacks and Defenses for DevOps ToolchainsDevOOPS: Attacks and Defenses for DevOps Toolchains
DevOOPS: Attacks and Defenses for DevOps Toolchains
 
DevSecCon London 2017: Hands-on secure software development from design to de...
DevSecCon London 2017: Hands-on secure software development from design to de...DevSecCon London 2017: Hands-on secure software development from design to de...
DevSecCon London 2017: Hands-on secure software development from design to de...
 
Continuous Security Testing with Devops - OWASP EU 2014
Continuous Security Testing  with Devops - OWASP EU 2014Continuous Security Testing  with Devops - OWASP EU 2014
Continuous Security Testing with Devops - OWASP EU 2014
 
Banfootguns devseccon 2019
Banfootguns devseccon 2019Banfootguns devseccon 2019
Banfootguns devseccon 2019
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio Code
 
Testing Automaton - CFSummit 2016
Testing Automaton - CFSummit 2016Testing Automaton - CFSummit 2016
Testing Automaton - CFSummit 2016
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Designing & Building Secure Web APIs
Designing & Building Secure Web APIsDesigning & Building Secure Web APIs
Designing & Building Secure Web APIs
 
Security Testing with Zap
Security Testing with ZapSecurity Testing with Zap
Security Testing with Zap
 
Akka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile gamesAkka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile games
 
Drupal Deployment
Drupal DeploymentDrupal Deployment
Drupal Deployment
 
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
 
DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim KadlecDevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
 
DevSecCon Singapore 2018 - System call auditing made effective with machine l...
DevSecCon Singapore 2018 - System call auditing made effective with machine l...DevSecCon Singapore 2018 - System call auditing made effective with machine l...
DevSecCon Singapore 2018 - System call auditing made effective with machine l...
 
Sec4dev 2021 - Catch Me If You can : Continuous Delivery vs. Security Assurance
Sec4dev 2021  - Catch Me If You can : Continuous Delivery vs. Security AssuranceSec4dev 2021  - Catch Me If You can : Continuous Delivery vs. Security Assurance
Sec4dev 2021 - Catch Me If You can : Continuous Delivery vs. Security Assurance
 
DevOpsDays Singapore Habitat Ignite
DevOpsDays Singapore Habitat IgniteDevOpsDays Singapore Habitat Ignite
DevOpsDays Singapore Habitat Ignite
 

En vedette

Docker app armor_usecase
Docker app armor_usecaseDocker app armor_usecase
Docker app armor_usecaseKazuki Omo
 
Kernel Recipes 2013 - Linux Security Modules: different formal concepts
Kernel Recipes 2013 - Linux Security Modules: different formal conceptsKernel Recipes 2013 - Linux Security Modules: different formal concepts
Kernel Recipes 2013 - Linux Security Modules: different formal conceptsAnne Nicolas
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiWhat's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiMike Goelzer
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security OverviewSreenivas Makam
 
Containerd: Building a Container Supervisor by Michael Crosby
Containerd: Building a Container Supervisor by Michael CrosbyContainerd: Building a Container Supervisor by Michael Crosby
Containerd: Building a Container Supervisor by Michael CrosbyDocker, Inc.
 
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Docker, Inc.
 
Docker Security Deep Dive by Ying Li and David Lawrence
Docker Security Deep Dive by Ying Li and David LawrenceDocker Security Deep Dive by Ying Li and David Lawrence
Docker Security Deep Dive by Ying Li and David LawrenceDocker, Inc.
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriDocker, Inc.
 

En vedette (9)

Docker app armor_usecase
Docker app armor_usecaseDocker app armor_usecase
Docker app armor_usecase
 
Apparmor
ApparmorApparmor
Apparmor
 
Kernel Recipes 2013 - Linux Security Modules: different formal concepts
Kernel Recipes 2013 - Linux Security Modules: different formal conceptsKernel Recipes 2013 - Linux Security Modules: different formal concepts
Kernel Recipes 2013 - Linux Security Modules: different formal concepts
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiWhat's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security Overview
 
Containerd: Building a Container Supervisor by Michael Crosby
Containerd: Building a Container Supervisor by Michael CrosbyContainerd: Building a Container Supervisor by Michael Crosby
Containerd: Building a Container Supervisor by Michael Crosby
 
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
 
Docker Security Deep Dive by Ying Li and David Lawrence
Docker Security Deep Dive by Ying Li and David LawrenceDocker Security Deep Dive by Ying Li and David Lawrence
Docker Security Deep Dive by Ying Li and David Lawrence
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
 

Similaire à Operating Docker

Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slidesDocker, Inc.
 
Thotcon - All aboard the Fail Whale
Thotcon - All aboard the Fail WhaleThotcon - All aboard the Fail Whale
Thotcon - All aboard the Fail WhaleErin Willingham
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureAdrian Otto
 
TIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepTIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepThe Incredible Automation Day
 
Creating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneCreating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneGary Wisniewski
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanMihai Criveti
 
Docker Introduction.pdf
Docker Introduction.pdfDocker Introduction.pdf
Docker Introduction.pdfOKLABS
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java binOlve Hansen
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014Carlo Bonamico
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
Security Tips to run Docker in Production
Security Tips to run Docker in ProductionSecurity Tips to run Docker in Production
Security Tips to run Docker in ProductionGianluca Arbezzano
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...Codemotion
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewiredotCloud
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerizationBalint Pato
 
Cloud Device Insecurity
Cloud Device InsecurityCloud Device Insecurity
Cloud Device InsecurityJeremy Brown
 
Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Jun Hong Kim
 
Docker Basics & Alfresco Content Services
Docker Basics & Alfresco Content ServicesDocker Basics & Alfresco Content Services
Docker Basics & Alfresco Content ServicesSujay Pillai
 

Similaire à Operating Docker (20)

Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Thotcon - All aboard the Fail Whale
Thotcon - All aboard the Fail WhaleThotcon - All aboard the Fail Whale
Thotcon - All aboard the Fail Whale
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable Infrastructure
 
TIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepTIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by step
 
Introduction To Docker
Introduction To DockerIntroduction To Docker
Introduction To Docker
 
Creating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneCreating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with Chaperone
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with Podman
 
Docker Introduction.pdf
Docker Introduction.pdfDocker Introduction.pdf
Docker Introduction.pdf
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Security Tips to run Docker in Production
Security Tips to run Docker in ProductionSecurity Tips to run Docker in Production
Security Tips to run Docker in Production
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Cloud Device Insecurity
Cloud Device InsecurityCloud Device Insecurity
Cloud Device Insecurity
 
Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)
 
Docker Basics & Alfresco Content Services
Docker Basics & Alfresco Content ServicesDocker Basics & Alfresco Content Services
Docker Basics & Alfresco Content Services
 

Dernier

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durbanmasabamasaba
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 

Dernier (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 

Operating Docker

  • 2. about me @fun_cuddles  /  jenpire.com  /  organizer  @BostonGoLang   co-­‐founder  @threatstack,    formely  Mandiant  /  Symantec   **  I  HAVE  NO  AFFILIATION  WITH  THE  SMART  PEOPLE  AT  DOCKER  **
  • 3.
  • 4. REALITY  CHECK *  I  stole  this  shamelessly  from  @petecheslock
  • 5. houston,  we  have  concerns
  • 7. -­‐  your  security  engineer “Docker needs to fix all of these problems.” “It’s probably fine.” -­‐ -­‐your  hipster  devops     -­‐ gal  or  guy
  • 9. this is the wrong question.
  • 10.
  • 11. How  can  we  enable  organizaOons  (security   +  dev  +  ops)  operate  Docker  safely? 1. Understand  your  threat  model   2. Understand  Docker’s  limitaOons   3. Understand  the  tools  available  to  us     4. Evolve  the  Docker  security  ecosystem  :)
  • 12. 1.  How  do  I  trust  the  code?   2.  How  do  I  know  if  I’ve  configured  my  Docker  host  +   containers  in  a  secure  way?   3.  How  do  containers  change  my  security  pracOces,   e.g.  monitoring? empathy: understanding the security engineer’s concerns
  • 13. but also consider the  consistency  of  applicaOon  environments  in  Docker   containers  provides  for  interesOng  opportuniHes  for   new  automaOon  around  security  hardening,  audiOng,   and  tesOng.
  • 14. issues with trust docker  images  are  binaries  (opaque)   who  am  I  trusOng?   who  is  updaOng  these  things  when  there  is  a  criOcal   security  flaw?  
  • 15. The problem of patch management is a real thing. http://www.banyanops.com/blog/analyzing-docker-hub/
  • 17. always be updating! • Do  perform  security  upgrades  (debian  example   below)   • sudo  docker  exec  -­‐it  <container>  apt-­‐get  update     • sudo  docker  exec  -­‐it  <container>  apt-­‐get  upgrade   -­‐s  |  grep  -­‐i  security  #  dry  run   • sudo  docker  exec  -­‐it  <container>  apt-­‐get  upgrade   #  commit  changes  when  done  
  • 19. what  if  someone   replaced  libc  with  a   backdoored  version?
  • 20. community   addressing trust automate  policy  audiOng  +   enforcement for  a  given  container,  tell  me  who/what   I  am  trusOng build  from  a  trusted  base  image be  aware  of  who  you  are  trusOng don’t  overrely  on  Docker  hub tooling  to  apply  and     validate  security  updates
  • 21. more advice • “The  best  opOon  is  to  block  index.docker.io  locally,  and   download  and  verify  images  manually  before  imporOng   them  into  Docker  using  docker  load.”   • hcps://Otanous.com/posts/docker-­‐insecurity#fn:4   • Use  a  private  docker  registry   • hcps://www.digitalocean.com/community/tutorials/how-­‐to-­‐set-­‐up-­‐a-­‐private-­‐docker-­‐registry-­‐ on-­‐ubuntu-­‐14-­‐04  ,  hcps://quay.io         • Use  RedHat  cerOfied  containers   •  hcp://www.redhat.com/en/about/press-­‐releases/red-­‐hat-­‐announces-­‐cerOficaOon-­‐for-­‐ containerized-­‐applicaOons-­‐extends-­‐customer-­‐confidence-­‐and-­‐trust-­‐to-­‐the-­‐cloud  
  • 22. opportunities • trust,  but  verify:  build  an  binary  audiOng  tool  for  Docker   images!   • e.g.,  scan  images,  validate  installed  libraries  and  binaries    do   not  have  criOcal  security  issues  and  align  with  signed  package   manifests.   • hcps://github.com/banyanops/collector    +`cruh’  but  for  containers?   • hcps://github.com/OpenSCAP/container-­‐compliance  -­‐  RHEL  only   • contribute  to  the  packaging/distribuOon  trust  conversaOon!   • hcps://github.com/docker/distribuOon/pull/179   • references:  hcp://theupdateframework.com/  
  • 24. security empathy How  do  I  know  if  I’ve   configured  my  Docker  host  +   containers  in  a  secure  way?  
  • 25. the good! Docker  released  a   comprehensive   security  benchmark. hcps://blog.docker.com/2015/05/understanding-­‐docker-­‐security-­‐and-­‐best-­‐pracOces/
  • 26. the bad …it’s  118  pages  of  material!
  • 27. the good!: can we automate these checks? for  most  of  them,  yes!   github.com/dockersecuritytools/bacen  -­‐  IN  PROGRESS
  • 29. the problem of isolation
  • 30. container hardening: the good there’s actually a lot of knobs to turn!
  • 31. • SELinux  /  AppArmor  policies  (—security-­‐opt)    (more   about  this  later)   • capabiliHes  (—cap-­‐add,  —cap-­‐drop)     • “give  root  without  all  of  root”
  • 32. • cgroups  (resource  allocaOon,  many  flags)   • Example:  $ docker run -it --rm -m 128m fedora bash • hcps://goldmann.pl/blog/2014/09/11/resource-­‐management-­‐in-­‐docker/   • user  namespaces  (soon!)  so  you  don’t  have  to  run   id=0  processes  as  root!   • seccomp  filtering  to  permit  or  block  individual   system  calls  (soon!)   • hcp://opensource.com/business/15/3/docker-­‐security-­‐future
  • 33. the bad there’s a lot of knobs to turn :(
  • 34. we can do better.
  • 35. what  problems  are  they  trying  to  solve? AppArmor  +  SELinux
  • 36. a question if  engineers  can’t  figure  out  how  to  build  and  apply  SELinux  policies  now,     how  will  Docker  change  things?
  • 37. apparmor a  gentler  mandatory  access  control  system   hcps://wiki.ubuntu.com/AppArmor   introducing  
  • 38. #include <tunables/global> /usr/sbin/tcpdump { #include <abstractions/base> #include <abstractions/nameservice> #include <abstractions/user-tmp> capability net_raw, capability setuid, capability setgid, capability dac_override, network raw, network packet, # for -D capability sys_module, @{PROC}/bus/usb/ r, @{PROC}/bus/usb/** r, # for -F and -w audit deny @{HOME}/.* mrwkl, audit deny @{HOME}/.*/ rw, audit deny @{HOME}/.*/** mrwkl, audit deny @{HOME}/bin/ rw, audit deny @{HOME}/bin/** mrwkl, @{HOME}/ r, @{HOME}/** rw, /usr/sbin/tcpdump r, } name of profile — generally the binary. the permitted (or denied) capabilities the files it can access (or is denied access to).
  • 39. • Docker’s  default  capabiliOes  are   set  by  app  armor!  (and  turned   off  when  you  docker  run  — privileged=true)     • be  careful:  when  you  supply   your  own  apparmor  profile,   your  are  essenOally  resetng   the  capabiliOes.   • copy  or  inherit  these  when  you  create  a   new  profile  for  your  containers.       this looks familiar…
  • 40. using apparmor with 1. Create  the  custom  profile:  vim  my_container_profile   2. Load  it  into  app  armor:  cat  my_container_profile  |   sudo  apparmor_parser  -­‐r   3. ` 4. Run  it  with  your  docker  container:  docker  run  — security-­‐opt=“apparmor:my_container_profile”   5. $$$  Profit?
  • 41. ok but what if I break things?
  • 42. tip: make  a  permissive  profile,  and  run  it  in  complain  mode sudo  aa-­‐complain  my_container_profile it  will  log  to  auditd type=AVC  msg=audit(1390936201.188:15647):  apparmor="AUDIT"   operation="file_lock"  parent=7873  profile="my_container_profile"  f   name="/tmp/pam_krb5_tmp_FqhNDa"  pid=7875  comm="sshd"   requested_mask="k"  denied_mask="k"  fsuid=0  ouid=0   iterate  unOl  right.
  • 43. “Great! but this is still hard and annoying.”
  • 44. what if you could automate it?
  • 45. tip: use  aa-­‐logprof  to  generate  the  apparmor  profiles   automagically? aa-­‐logprof  [  -­‐d  /path/to/profiles  ]  [  -­‐f  /path/to/logfile  ]   !!  don’t  use  these  without  manual  review  and  ediHng  !! http://manpages.ubuntu.com/manpages/natty/man8/aa-­‐logprof.8.html
  • 46. (ok: we still need better tooling)
  • 48. • IF  in  the  future…   • DockerHub  registry  becomes  your  go-­‐to  trusted   distribuOon  source  for  applicaOons.…   •  Why  not     • Have  a  registry  for  apparmor  and  SELinux  profiles   geared  for  official  dockerized  app  containers?   • …Include  seccomp  filters  and  other  security  configs?   • Share  your  polices  &  reduce  the  burden  of  having  to   harden  your  own  apps/containers.
  • 49. #  fetch  apparmor  security  profile  for  wordpress   image   docker  security-­‐profile  fetch  wordpress:latest       #  you  can  even  fetch  by  image  /  tag   docker  security-­‐profile  fetch   0cc6ffbf1a0cd78ab244c4b3b5cef13618bf4c8bcd229ec2673 1a951c33df72e     #  allow  users  to  submit/push  their  own  app  armor   profiles     docker  security-­‐profile  push  —-­‐profile=“apparmor:/ etc/apparmor/wordpress.profile”  jandre/ wordpress:custom
  • 50. in conclusion • we  need  more  automaOon  around  security  audiOng,   hardening,  tesOng,  and  monitoring   • InnovaOon  here  should  come  not  just  from  the   Docker  folks.   • The  consistency  of  Docker  containers  enables  us  to   be  innovaOve  in  how  we  automate  the  above  ^^  
  • 51.
  • 52. is this interesting to you? • contact  me!  jandre@gmail.com   • follow  @dockersecurity  for  news