appsec & microservices - velocity 2016

160
APPSEC & MICROSERVICES Sam Newman Velocity 2016

Upload: sam-newman

Post on 21-Jan-2017

3.364 views

Category:

Software


0 download

TRANSCRIPT

Page 1: AppSec & Microservices - Velocity 2016

APPSEC & MICROSERVICESSam Newman Velocity 2016

Page 2: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 3: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

Page 4: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Microservices Can Make Everything Worse

Page 5: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 6: AppSec & Microservices - Velocity 2016

@samnewman#velocityconfhttps://www.flickr.com/photos/seattlemunicipalarchives/4058808950

Page 7: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf https://www.flickr.com/photos/theseanster93/485390997/

Page 8: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

http://map.norsecorp.com/

Page 9: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 10: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 11: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Accounts

Returns

Invoicing

Shipping

Inventory

Customer Service

Page 12: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Accounts

Returns

Invoicing

Shipping

Inventory

Customer Service

Small Independently Deployable services that work together, modelled

around a business domain

Page 13: AppSec & Microservices - Velocity 2016

https://www.flickr.com/photos/wwworks/2607036664/

Page 14: AppSec & Microservices - Velocity 2016

https://www.flickr.com/photos/lkowen/15803718243/

Page 15: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 16: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 17: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 18: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 19: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 20: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention

Page 21: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

Page 22: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

Response

Page 23: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 24: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 25: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 26: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf https://www.flickr.com/photos/adulau/15680439035/

Page 27: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf https://www.flickr.com/photos/duanestorey/469163789/

Page 28: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

https://www.schneier.com/paper-attacktrees-ddj-ft.html

Page 29: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Open Safe

Page 30: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Open Safe

Pick Lock Learn Combo Cut Open

Page 31: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Open Safe

Pick Lock Learn Combo Cut Open

Find Written Combo

Get Combo from the target

Page 32: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Open Safe

Pick Lock Learn Combo Cut Open

Find Written Combo

Get Combo from the target

Blackmail Threaten Bribe

Page 33: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Open Safe

Pick Lock Learn Combo Cut Open

Find Written Combo

Get Combo from the target

Blackmail Threaten Bribe

Impossible

Impossible ImpossiblePossible

Possible

Possible

Page 34: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Open Safe

Pick Lock Learn Combo Cut Open

Find Written Combo

Get Combo from the target

Blackmail Threaten Bribe

Page 35: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Open Safe

Pick Lock Learn Combo Cut Open

Find Written Combo

Get Combo from the target

Blackmail Threaten Bribe

$$$$

$$$$ $$$$$$

$$

$

Page 36: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User service

Page 37: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User service

Transport Security

Page 38: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

HTTPS Everywhere!

Page 39: AppSec & Microservices - Velocity 2016

BENEFITS OF HTTPS?

Page 40: AppSec & Microservices - Velocity 2016

BENEFITS OF HTTPS?

▫︎ Server guarantees!

Page 41: AppSec & Microservices - Velocity 2016

BENEFITS OF HTTPS?

▫︎ Server guarantees!

▫︎ Payload not manipulated…

Page 42: AppSec & Microservices - Velocity 2016

BENEFITS OF HTTPS?

▫︎ Server guarantees!

▫︎ Payload not manipulated…

▫︎…but no client guarantee and…

Page 43: AppSec & Microservices - Velocity 2016

BENEFITS OF HTTPS?

▫︎ Server guarantees!

▫︎ Payload not manipulated…

▫︎…but no client guarantee and…

▫︎…certificates can be a pain

Page 44: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

https://letsencrypt.org/

Page 45: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 46: AppSec & Microservices - Velocity 2016

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User service

Page 47: AppSec & Microservices - Velocity 2016

CLIENT-SIDE CERTIFICATES?

Page 48: AppSec & Microservices - Velocity 2016

CLIENT-SIDE CERTIFICATES?

▫︎Client guarantees!

Page 49: AppSec & Microservices - Velocity 2016

CLIENT-SIDE CERTIFICATES?

▫︎Client guarantees!

▫︎…but a PITA to manage….

Page 50: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

http://techblog.netflix.com/2015/09/introducing-lemur.html

Page 51: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User service

Page 52: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Auth?

Page 53: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Auth?

Authentication

Page 54: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Auth?

Authentication Authorisation

Page 55: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User service

Web browsers

Page 56: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User service

Web browsers

Form AuthOAuth

Page 57: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User service

Web browsers

Form AuthOAuthPERIMETER SECURITY!

Page 58: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User service

Web browsers

Form AuthOAuthPERIMETER SECURITY!

User service

Page 59: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Music Web Shop

User serviceUser

service

Implicit Trust?

Page 60: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Mobile app

Web browsers

User service

Web browsers

User service

Page 61: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Mobile app

Web browsers

User service

Web browsers

User service

Asking As Bob

Page 62: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Mobile app

Web browsers

User service

Web browsers

User service

Asking As Bob

Can I see Alice’s Data?

Page 63: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf https://www.flickr.com/photos/lundyd/14481829564/

Confused Deputy

Problem!

Page 64: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Music Web Shop

Web browsers

User service

Page 65: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Music Web Shop

Web browsers

User service

Page 66: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Music Web Shop

Web browsers

User service

Page 67: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Music Web Shop

Web browsers

User service

{ "id": "402ndj39", "name": “Alice Alison" }

Page 68: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Music Web Shop

Web browsers

User service

{ "id": "402ndj39", "name": “Alice Alison" }

Page 69: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Music Web Shop

Web browsers

User service

{ "id": "402ndj39", "name": “Alice Alison" }

Page 70: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Data At Rest?

Page 71: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty Payment Gateway

Mobile app

Web browsers

User serviceUser

service

Page 72: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Encryption!

Page 73: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf https://www.flickr.com/photos/aigle_dore/2781302649

Page 74: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Plain Text?

Page 75: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 76: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

“In the API server secret data is stored as plaintext in etcd"

http://kubernetes.io/docs/user-guide/secrets/#security-properties

Page 77: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Secure Vaults

Page 78: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 79: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 80: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Aside: Docker

Page 81: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

http://www.banyanops.com/blog/analyzing-docker-hub/

Page 82: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 83: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 84: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

S/M TestsBuild Large Tests Production

Page 85: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

S/M TestsBuild Large Tests Production

Security?

Page 86: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

S/M TestsBuild Large Tests Production

Security?

OWASP ZAP Attack ProxyStatic Analysers

Page 87: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf https://www.microsoft.com/en-us/sdl/

Page 88: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

https://medium.com/built-to-adapt/the-three-r-s-of-enterprise-security-rotate-repave-and-repair-f64f6d6ba29d

Page 89: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

“At or near the top of security concerns in the datacenter is something called an Advanced Persistent Threat (APT). An APT gains unauthorized access to a network and can stay hidden for a long period of time. Its goal is usually to steal, corrupt, or ransom data.”

- Justin Smith, Pivotal

Page 90: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Rotate: Short-lived Credentials

Page 91: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Rotate: Short-lived Credentials

Repair: Patch Your Stuff

Page 92: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Rotate: Short-lived Credentials

Repave: Burn It Down!

Repair: Patch Your Stuff

Page 93: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

http://www.theregister.co.uk/2014/06/18/code_spaces_destroyed/

Page 94: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

https://github.com/michenriksen/gitrob

Page 95: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

(don’t forget to limit credential scope too)

Page 96: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 97: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 98: AppSec & Microservices - Velocity 2016

@samnewman#velocityconfhttps://www.qualys.com/research/top10/

Page 99: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

http://www.extremetech.com/computing/190959-shellshock-a-deadly-new-vulnerability-that-could-lay-waste-to-the-internet

Page 100: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 101: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Repair: Patch Your Stuff

Page 102: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

https://www.modsecurity.org/

Page 103: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty service

Mobile app

Web browsers

User service

Page 104: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty service

Mobile app

Web browsers

User service

PERIMETER SECURITY!

Page 105: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty service

Mobile app

Web browsers

User service

PERIMETER SECURITY!

PERIMETER SECURITY!

Page 106: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Catalog service

Music Web Shop

Recommend service

Royalty service

Mobile app

Web browsers

User service

PERIMETER SECURITY!

PERIMETER SECURITY!

PERIMETER SECU

RITY!

Page 107: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Polyglot = more stuff to track!

Page 108: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

https://www.npmjs.com/package/npm-check

Page 109: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 110: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

b4a2f5ga2

4335egad3

ab2d56be3

847ea3dbe

Page 111: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

b4a2f5ga2

4335egad3

ab2d56be3

847ea3dbe !!!

!!!

Page 112: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

b4a2f5ga2

4335egad3

ab2d56be3

847ea3dbe

847ea3dbe

847ea3dbe

847ea3dbe

4335egad34335egad3

4335egad3

4335egad3

4335egad3

4335egad3

4335egad3

4335egad3

4335egad3

4335egad3

4335egad3

847ea3dbe

!!!

!!!

Page 113: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

https://github.com/coreos/clair

Page 114: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Repair: Patch Your Stuff

Page 115: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Repair: Patch Your Stuff

Automate it

Page 116: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Repair: Patch Your Stuff

Automate it

Do It A Lot

Page 117: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Repair: Patch Your Stuff

Automate it

Do It A Lot

And Check Your Work

Page 118: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 119: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Polyglot = more things to break?

Page 120: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 121: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 122: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 123: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 124: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 125: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf http://krebsonsecurity.com/tag/target-data-breach/

Page 126: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Comms

Page 127: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 128: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 129: AppSec & Microservices - Velocity 2016

@samnewman#velocityconfhttps://en.wikipedia.org/wiki/Chicago_Tylenol_murders

Page 130: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 131: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 132: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Customer

Page 133: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Customer

Page 134: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 135: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 136: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Backups

Page 137: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Page 138: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Repave: Burn It Down!

Page 139: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Phoenix Servers

Page 140: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Phoenix Servers

Immutable Servers

Page 141: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Phoenix Servers

Immutable Servers= repave on every release

Page 142: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Why not repave automatically when you apply a patch?

Page 143: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

RepaveBackups

Page 144: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Harder with microservices?

RepaveBackups

Page 145: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Harder with microservices?

RepaveBackups

AUTOMATE ALL THE THINGS

Page 146: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Post Mortems

Page 147: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

http://www.smh.com.au/digital-life/mobiles/telstra-outage-manager-connected-customers-to-faulty-node-in-embarrassing-error-20160209-gmpn7f.html

Page 148: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

"[The employee responsible] didn't follow procedures and clearly that's not a good thingbut I wouldn't want to pre-empt the proper investigation and we'll figure out what the right response is when we've had a chance to dig into the detail." - Australian Financial Review

http://www.afr.com/business/telecommunications/telstra-mobile-network-down-across-australia-reports-20160209-gmpaty

Page 149: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

http://samnewman.io/blog/2016/02/10/telstra_outage/

Page 150: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

https://vimeo.com/102167635

Page 151: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

“Finding the root cause of a failure is like finding a root cause of a success.”

http://www.kitchensoap.com/2012/02/10/each-necessary-but-only-jointly-sufficient/

John Allspaw

Page 152: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

http://www.smh.com.au/technology/technology-news/telstra-free-data-guy-clocks-up-almost-a-terabyte-of-downloads-20160404-gnxu14.html

Page 153: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Don’t forget to review your old post-mortems too…

Page 154: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Don’t forget to review your old post-mortems too…

…and the resulting action plans!

Page 155: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Prevention Detection

ResponseRecovery

Page 156: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

http://buildingmicroservices.com/

Page 157: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

http://buildingmicroservices.com/

http://samnewman.io/

Page 158: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

http://buildingmicroservices.com/

http://magpietalkshow.com/

http://samnewman.io/

Page 159: AppSec & Microservices - Velocity 2016

@samnewman#velocityconf

Wednesday 22nd

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

Signing

5.45pm

@ Oreilly Booth

Page 160: AppSec & Microservices - Velocity 2016

@samnewman [email protected]

THANKS!