36
Faster, Cheaper, Safer Secure Microservice Architectures using Docker Adrian Cockcroft @adrianco Technology Fellow - Battery Ventures June 2015

Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

  • Upload
    others

  • View
    20

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Adrian Cockcroft @adrianco Technology Fellow - Battery Ventures

June 2015

Page 2: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Key Goals of the CIO? Align IT with the business Develop products faster Try not to get breached

Page 3: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Security Blanket Failure

Insecure applications hidden behind firewalls make you feel safe until the breach happens…

http://peanuts.wikia.com/wiki/Linus'_security_blanket

Page 4: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

What needs to change?

Page 5: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Developer responsibilities: Faster, cheaper, safer

Page 6: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Faster - Agile

Page 7: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

“You build it, you run it.”

Werner Vogels 2006

Page 8: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

DevOps Continuous Delivery

No meetings, no tickets Self service tools and APIs

Page 9: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

DeveloperDeveloper Developer

Run What You Wrote

Micro service

Micro service

Micro service

Micro service

Micro service

Micro service

Micro service

Developer Developer

Manager Manager

VP Engineering

Site Reliability

Monitoring Tools

Availability Metrics

99.95% customer success rate

Page 10: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Observe

Orient

Decide

Act

Land grab opportunity Competitive

Move

Customer Pain Point

Analysis

JFDI

Plan Response

Share Plans

Incremental Features

Automatic Deploy

Launch AB Test

Model Hypotheses

BIG DATA

INNOVATION

CULTURE

CLOUD

Measure Customers

Continuous Delivery

Page 11: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Low Cost of Change Using Docker

Fast tooling supports continuous delivery of many tiny changes

Developers • Compile/Build • Seconds

Extend container • Package dependencies • Seconds

PaaS deploy Container • Docker startup • Seconds

Page 12: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Change One Thing at a Time!

Page 13: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

What Happened?

Rate of change increased

Cost and size and risk of change

reduced

Page 14: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Cheaper - Lean

Page 15: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

“Freedom and responsibility”

Reed Hastings 2009

Page 16: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Fail early and often Instrument everything

Hypothesis driven development Efficient and autoscaled

Page 17: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Efficiency Gains: Virtualization consolidates CPUs

Docker consolidates CPU and RAM

Page 18: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

With Docker a test environment should only exist for the few seconds it takes to run a test

Page 19: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Autoscale production to consume just the resources you need,

by the second

Page 20: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Safer - Rugged

Page 21: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

“Developer Defined Infrastructure”

Jerry Chen 2015

Page 22: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

What can developers do about the threats?

Page 23: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

External Threats

Build using penetration test tools Manage image supply chain

Hardened immutable services Service roles and security groups

Page 24: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Internal Threats

Assume employees are compromised User roles, minimum privilege

Audit logs for everything Encrypt data at rest

Page 25: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Patterns and practices

Page 26: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

In Production

https://www.docker.com/resources/usecases/ and many more….

Page 27: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Patterns and practices

Page 28: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Best Practices

https://blog.docker.com/2015/05/understanding-docker-security-and-best-practices/

Page 29: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Immutable deployments Automated penetration testing Role based identity and access Trusted container supply chain

Continuous audit

Page 30: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Workloads

Page 31: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Need for Speed

CPU and IO Intensive workloads Hadoop, streaming, datastores

Bare metal for efficiency Well isolated for security

Page 32: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Cutting the Cost

Many similar containers per VM Saving on RAM, oversubscribe CPU

Deploy with Swarm, Mesos, ECS, GKE VM based single tenant security

Page 33: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Playing it Safe

One critical container per VM Extra security for exposed services

Deploy as immutable VM image Docker adds to VM security

Page 34: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Tooling for Docker

and many more….

Page 35: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Docker in Production 2014 - DIY frameworks

2015 - Hardening and best practices 2016 - Mature production tooling

Page 36: Faster, Cheaper, Safer - 7u2psl.com5.z0.glb.qiniucdn.com7u2psl.com5.z0.glb.qiniucdn.com/dockercon/Faster... · Faster, Cheaper, Safer Secure Microservice Architectures using Docker

Thanks ! Continue the discussion on Twitter @adrianco

Adrian Cockcroft Technology Fellow - Battery Ventures

June 2015

Disclosure: some of the companies mentioned may be Battery Ventures Portfolio Companies See www.battery.com for a list of portfolio investments