appsec usa 2014 denver, colorado implications & opportunities at the bleeding edge of devops...

29
AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Upload: aria-rule

Post on 01-Apr-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

AppSec USA 2014

Denver, Colorado

Implications & Opportunities at the

Bleeding Edge of DevOpsChris Swan, CTO CohesiveFT

@cpswan

Page 2: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

@cpswanCTO – CohesiveFTCloud native networking

Chris Swan – why me?

Introduction

Page 3: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Dockerfile is awesomely productive Great for DevOps

Containers don’t contain At least not yet

Images have a manifest problemKeep track of your stuff

TL;DR

Page 4: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

What do I mean when I say ‘DevOps’?

Part 1

Page 5: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Let’s start with a demo

Demo time

Page 6: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

John Boyd’s OODA loop

Page 7: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Industrial design maturity – the auto example

Design for purpose

Design for manufacture

Design for operations

Page 8: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Industrial design maturity - software

Design for purpose

Design for manufacture

Design for operations

DevOps is just an artefact

Page 9: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Containers and containment

Part 2

Page 10: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Containers don’t contain

With thanks to Dan Walsh @rhatdanWatch his DockerCon 2014 presentation at http://is.gd/dcrhdw

Page 11: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Shocker

The issue

The responsehttp://stealth.openwall.net/xSports/shocker.c

https://news.ycombinator.com/item?id=7910117

Page 12: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Because containers aren’t VMs

And this has yet to come:

Page 13: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Possible to have our cake and eat it?

Page 14: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

cgroups

Page 15: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

namespaces

mnt mount points, filesystemspid processesnet networkipc inter process communicationuts hostnamedevice devicesuser UIDs

Page 16: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Fine grained control over ‘root’ privileges:• deny all "mount" operations;• deny access to raw sockets (to prevent packet

spoofing);• deny access to some filesystem operations, like

creating new device nodes, changing the owner of files, or altering attributes (including the immutable flag);

• deny module loading;• etc.

capabilities

Page 17: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

AppArmor and SELinux

Mandatory Access Control (MAC)

Page 18: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

• Use of namespaces, capabilities and MAC will improve– Might be a game of ‘whack a mole’

• Hard to tell when we’re done (is @solomonstre’s word going to be enough?)

• Libcontainer can drive other mechanisms– More secure options might come

• Hardware support might come– Existing rings 1 & 2 aren’t used much, but aren’t really suitable– VT-x introduced ring -1, do we need a ring 0.5?

<optimist>Containers will contain</optimist>

Page 19: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

The manifest problem

Part 3

Page 20: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

My Dockerfile from (much) earlier

Page 21: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Each active line creates a layer

Page 22: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

An image binds layers together

Page 23: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

The image is the unit of deployment

Page 24: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Which version of Nginx is that?

Page 25: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Which version of OpenSSL is installed?

Page 26: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Whilst we want this to be cached in the short term:

apt-get install nginx

We perhaps don’t want it cached in the long term

What are those durations?

Problem 1 – non determinism

Page 27: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

When I runapt-get install nginxI don’t know which version of Nginx I just got

Should I?nginx –v > some_log.txtOr maybe?apt-cache policy nginx > some_log.txt

Problem 2 – the manifest problem

Page 28: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Dockerfile is awesomely productive Great for DevOps

Containers don’t contain At least not yet

Images have a manifest problemKeep track of your stuff

TL;DR

Page 29: AppSec USA 2014 Denver, Colorado Implications & Opportunities at the Bleeding Edge of DevOps Chris Swan, CTO CohesiveFT @cpswan

Questions?

Ask now, or on Twitter: @cpswan

Question time