Top Banner
Aguascalientes Local Chapter 2 nd Meeting
19

Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Jan 13, 2019

Download

Documents

dangmien
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

AguascalientesLocalChapter

2nd Meeting

Page 2: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

About– ChapterLeader

• JuanGama– ApplicationSecurityEngineer@AspectSecurity– 9+yearsinAppsec,Testing,Development– MaintainerofOWASPBenchmark– IlikeGIFs!

Page 3: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker

Page 4: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

WhatisDocker?

• "Docker istheworld'sleadingsoftwarecontainerizationplatform"

Page 5: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Whatisacontainer?

• Consistsofanentireruntimeenvironment:anapplication,plusallitsdependencies,librariesandotherbinaries,andconfigurationfilesneededtorunit,bundledintoonepackage.

Page 6: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker inventedcontainers?

Page 7: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker vs LXC,Jails,Vagrant

• LXCrunsinthehostbuthasit'sownsectionofRAM,CPU,disk,etc.ClosertoaVM.Dockercanbejustoneprocess,needsavolume.

• VagrantisascriptforVMs.

Page 8: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker vs Virtualization

• Virtualizationincludesanentireoperatingsystemaswellastheapplication.Docker sitsontopoftheOS

Page 9: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker vs Virtualization

Page 10: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker vs Virtualization

Page 11: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

WhyDocker?

• Solvesdependencyproblemsandtheproblemofancienttimes:

• "Itworksonmymachine!"

Page 12: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker Components

• Docker Engine

• Docker Hub

Page 13: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker Engine

• Docker daemon– Runsonthehostmachine

• Docker Client– CLIusedtointeractwiththedaemon

• WindowsandOSX– docker-machine(smalllinux runningtheDockerdaemon)- NeedsVirtualbox

Page 14: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker WorkflowComponents

• Docker image– Hastheenv,yourapplication,OS,dependencies,

• Docker Container– Createdfromimages,start,stop,move,delete

• Docker Registry– Publicandprivaterepotostoreimages

• Dockerfile– Automatesimageconstruction

Page 15: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker

• Docker Container

• Docker Composer

• Docker Swarm

Page 16: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Demo

Page 17: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker Security

• Quitesecure.• Namespacesforisolation:processesrunningwithina

containercannotsee,andevenlessaffect,processesrunninginanothercontainer,orinthehostsystem

• Eachcontaineralsogetsitsownnetworkstack.• ControlGroupsforresourceaccountingandlimiting,

ensurethateachcontainergetsitsfairshareofmemory,CPU,diskI/O;and,moreimportantly,thatasinglecontainercannotbringthesystemdownbyexhaustingoneofthoseresources.

Page 18: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker Security• OnlytrustedusersshouldbeallowedtocontrolyourDocker daemon

• “root”withinacontainerhasmuchlessprivilegesthanthereal“root”.Forinstance,itispossibleto:– denyall“mount”operations;– denyaccesstorawsockets(topreventpacketspoofing);– denyaccesstosomefilesystem operations,likecreatingnewdevicenodes,changingtheowneroffiles,oralteringattributes(includingtheimmutableflag);

– denymoduleloading;– andmanyothers.

Page 19: Aguascalientes Local Chapter - OWASP · Dockervs LXC, Jails, Vagrant • LXC runs in the host but has it's own section of RAM, CPU, disk, etc. Closer to a VM. Docker can be just one

Docker Security

• Additional:AppArmor,SELinux,GRSEC• RuninsideaVM• Compromisedimages• DOS• https://www.docker.com/docker-security