128
November 15, 2016 Serverless and the Way Forward James Wickett // @wickett

Serverless and the Way Forward

Embed Size (px)

Citation preview

Page 1: Serverless and the Way Forward

November 15, 2016

Serverless and the Way ForwardJames Wickett // @wickett

Page 2: Serverless and the Way Forward

November 15, 2016@WICKETT

JAMES WICKETT

๏ Head of Research at Signal Sciences

๏ Author at Lynda/LinkedIn Training for DevOps Fundamentals course releasing in the next week!

๏ Blogger at theagileadmin.com and labs.signalsciences.com

Page 3: Serverless and the Way Forward

November 15, 2016@WICKETT

DEVOPS ROADMAP FOR SECURITY

http://info.signalsciences.com/book

Page 4: Serverless and the Way Forward

November 15, 2016@WICKETT

๏ Web App Firewall for modern workloads

๏ Cloud-native and devops friendly

๏ Answer the questions: Am I being attacked right now? Are attackers becoming successful?

๏ We are hiring (Golang, appsec, devops)

@WICKETT

Page 5: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 6: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 7: Serverless and the Way Forward

November 15, 2016@WICKETT

CONCLUSION

๏ Serverless encourages functions as deploy units, coupled with third party services that allow running end-to-end applications without worrying about system operation.

๏ New serverless patterns are just emerging

๏ Security with serverless is easier

๏ Security with serverless is harder

Page 8: Serverless and the Way Forward

November 15, 2016@WICKETT

CONCLUSION (2)

๏ Four key areas apply to serverless security

๏ Software Supply Chain Security

๏ Delivery Pipeline Security

๏ Data Flow Security

๏ Attack Detection

Page 9: Serverless and the Way Forward

November 15, 2016@WICKETT

WHAT IS SERVERLESS?

Page 10: Serverless and the Way Forward

November 15, 2016@WICKETT

MISCONCEPTIONS

Page 11: Serverless and the Way Forward

November 15, 2016@WICKETT

IT’S MARKETING (CLOUD REBRANDED)

Page 12: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS == NO SERVERS

Page 13: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS == CLOUD

Page 14: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS == BACKEND AS A

SERVICE

Page 15: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS == PLATFORM AS A

SERVICE

Page 16: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 17: Serverless and the Way Forward

November 15, 2016@WICKETT

SO, WHAT IS SERVERLESS?

Page 18: Serverless and the Way Forward

November 15, 2016@WICKETT

http://martinfowler.com/articles/serverless.html

Page 19: Serverless and the Way Forward

November 15, 2016@WICKETT

@MIKEBROBERTS

Page 20: Serverless and the Way Forward

November 15, 2016@WICKETT

Serverless was first used to describe applications that significantly or fully

depend on 3rd party applications / services (‘in

the cloud’) to manage server-side logic and

state. http://martinfowler.com/articles/serverless.html

Page 21: Serverless and the Way Forward

November 15, 2016@WICKETT

Serverless can also mean applications where some amount of server-side logic is still written by the application developer but unlike traditional architectures is

run in stateless compute containers that are event-

triggered, ephemeral (may only last for one invocation), and fully

managed by a 3rd party. http://martinfowler.com/articles/serverless.html

Page 22: Serverless and the Way Forward

November 15, 2016@WICKETT

HISTORY OF SERVERLESS๏ 2012 - used to describe BaaS and Continuous Integration

services run by third parties

๏ Late 2014 - AWS launched Lambda

๏ July 2015 - AWS launched API Gateway

๏ October 2015 - AWS re:Invent - The Serverless company using AWS Lambda

๏ 2015 to present - Frameworks forming

๏ 2016 - Serverless Conference

http://www.slideshare.net/AmazonWebServices/arc308-the-serverless-company-using-aws-lambda

Page 23: Serverless and the Way Forward

November 15, 2016@WICKETT

Client

Server

Database

Proxy/LB

ServerServer

Page 24: Serverless and the Way Forward

November 15, 2016@WICKETT

Client

Auth Service API Gateway

Database Service

Function A

Function B

Web Delivery

Page 25: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 26: Serverless and the Way Forward

November 15, 2016@WICKETT

WHAT CAN WE SAY IS SERVERLESS?

Page 27: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS IS FUNCTIONS AS A SERVICE (FaaS)

Page 28: Serverless and the Way Forward

November 15, 2016@WICKETT

BUT, BUT…CONTAINERS!

Page 29: Serverless and the Way Forward

November 15, 2016@WICKETT

CONTAINERS … ON DEMAND

Page 30: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS IS (NO MANAGEMENT OF)

SERVERS

Page 31: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS IS SERVICEFULL

Page 32: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS IS AN OPINIONATED FRAMEWORK

FOR COMPUTE

Page 33: Serverless and the Way Forward

November 15, 2016@WICKETT

Serverless encourages functions as deploy units, coupled with third party

services that allow running end-to-end applications without worrying about

system operation.

Page 34: Serverless and the Way Forward

November 15, 2016@WICKETT

A SHORT HISTORY OF CLOUD

Page 35: Serverless and the Way Forward

November 15, 2016@WICKETT

VIRTUALIZATION

Page 36: Serverless and the Way Forward

November 15, 2016@WICKETT

“THE CLOUD”

Page 37: Serverless and the Way Forward

November 15, 2016@WICKETT

DEVOPS

Page 38: Serverless and the Way Forward

November 15, 2016@WICKETT

SaaS PaaS IaaS

Page 39: Serverless and the Way Forward

November 15, 2016@WICKETT

PRIVATE CLOUD

Page 40: Serverless and the Way Forward

November 15, 2016@WICKETT

THEN, ALONG CAME CONTAINERS

Page 41: Serverless and the Way Forward

November 15, 2016@WICKETT

CONTAINERS ARE TEH HAWTNESS

Page 42: Serverless and the Way Forward

November 15, 2016@WICKETT

\

Page 43: Serverless and the Way Forward

November 15, 2016@WICKETT

LOTS OF EFFORT IN CONTAINER

ORCHESTRATION

Page 44: Serverless and the Way Forward

November 15, 2016@WICKETT

THE CLOUD WAS TO VIRTUALIZATION AS SERVERLESS WILL

BE TO CONTAINERS

Page 45: Serverless and the Way Forward

November 15, 2016@WICKETT

IF YOU WANT TO LEAD YOUR COMPANY BRAVELY INTO THE NEW WORLD, YOU WOULD DO WELL TO FOCUS LOT ON HOW

SERVERLESS WILL EVOLVE. - @CLOUDOPINION

https://medium.com/@cloud_opinion/the-pattern-may-repeat-26de1e8b489d

Page 46: Serverless and the Way Forward

November 15, 2016@WICKETT

Serverless encourages functions as deploy units, coupled with third party

services that allow running end-to-end applications without worrying about

system operation.

Page 47: Serverless and the Way Forward

November 15, 2016@WICKETT

SO, WHAT ARE THE UPSIDES?

Page 48: Serverless and the Way Forward

November 15, 2016@WICKETT

SCALING BUILT IN

Page 49: Serverless and the Way Forward

November 15, 2016@WICKETT

PAY FOR WHAT YOU USE IN 100MS INCREMENTS

Page 50: Serverless and the Way Forward

November 15, 2016@WICKETT

WITH SERVERLESS SYSTEM ADMINISTRATION

IS (MOSTLY) LOWER

Page 51: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS IS IMPLICIT

MICROSERVICES

Page 52: Serverless and the Way Forward

November 15, 2016@WICKETT

SHORT CIRCUITS OPS AND MOVES

INFRASTRUCTURE RUNTIME CLOSER TO

DEVS

Page 53: Serverless and the Way Forward

November 15, 2016@WICKETT

YOU CAN SKIP CHEFFING DOCKERING

ALL THE THINGS!

Page 54: Serverless and the Way Forward

November 15, 2016@WICKETT

LEAN STARTUP FRIENDLY

Page 55: Serverless and the Way Forward

November 15, 2016@WICKETT

INCREASED VELOCITY

Page 56: Serverless and the Way Forward

November 15, 2016@WICKETT

GREAT, WHAT’S THE CATCH?

Page 57: Serverless and the Way Forward

November 15, 2016@WICKETT

OPS BURDEN TO RATIONALIZE

SERVERLESS MODEL (SPECIFICALLY DEPLOY)

Page 58: Serverless and the Way Forward

November 15, 2016@WICKETT

MONITORING

Page 59: Serverless and the Way Forward

November 15, 2016@WICKETT

LOGGING

Page 60: Serverless and the Way Forward

November 15, 2016@WICKETT

STATELESS FOR REAL NO MEMORY PERSISTENCE

ACROSS FUNCTION RUNS

Page 61: Serverless and the Way Forward

November 15, 2016@WICKETT

VENDOR LOCK-IN

Page 62: Serverless and the Way Forward

November 15, 2016@WICKETT

SECURITY

Page 63: Serverless and the Way Forward

November 15, 2016@WICKETT

RELIABILITY

Page 64: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 65: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS USE CASES

Page 66: Serverless and the Way Forward

November 15, 2016@WICKETT

IMAGE RESIZING

Page 67: Serverless and the Way Forward

November 15, 2016@WICKETT

QUEUE PROCESSING

http://martinfowler.com/articles/serverless.html

Page 68: Serverless and the Way Forward

November 15, 2016@WICKETT

RUN A WEB APPLICATION

Page 69: Serverless and the Way Forward

November 15, 2016@WICKETT

API GATEWAY

http://martinfowler.com/articles/serverless.html

Page 70: Serverless and the Way Forward

November 15, 2016@WICKETT

CI/CD

Page 71: Serverless and the Way Forward

November 15, 2016@WICKETT

LICENSING

Page 72: Serverless and the Way Forward

November 15, 2016@WICKETT

SECURITY IS THE SAME AND DIFFERENT

Page 73: Serverless and the Way Forward

November 15, 2016@WICKETT

EVERYTHING IS HTTP(S)

Page 74: Serverless and the Way Forward

November 15, 2016@WICKETT

WHAT USED TO BE SYSTEM CALLS IS

NOW DISTRIBUTED COMPUTING OVER

THE NETWORK

Page 75: Serverless and the Way Forward

November 15, 2016@WICKETT

SERVERLESS SHIFTS ATTACK SURFACE TO

THIRD PARTIES

Page 76: Serverless and the Way Forward

November 15, 2016@WICKETT

LETS TRY A SAMPLE APPLICATION IN AWS

Page 77: Serverless and the Way Forward

November 15, 2016@WICKETT

๏ Golang!

๏ AWS Lambda supports bring your own binary

๏ Sparta wraps your binary with node.js shim

Page 78: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 79: Serverless and the Way Forward

November 15, 2016@WICKETT

OTHER OPTIONS

๏ Serverless Framework

๏ APEX

๏ Kappa

Page 80: Serverless and the Way Forward

November 15, 2016@WICKETT

WORDY๏ Analyzes textual

occurrences given a block of text, returns JSON count of words

๏ Calls API under the hood to get text

๏ It is comprised of Lambda, s3, API Gateway

Page 81: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 82: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 83: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 84: Serverless and the Way Forward

November 15, 2016@WICKETT

go run main.go provision -s S3_BUCKET

Page 85: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 86: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 87: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 88: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 89: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 90: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 91: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 92: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 93: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 94: Serverless and the Way Forward

November 15, 2016@WICKETT

WHAT I LEARNED ABOUT SERVERLESS

SECURITY

Page 95: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 96: Serverless and the Way Forward

November 15, 2016@WICKETT

FOUR AREAS OF SERVERLESS SECURITY

๏ Secure Software Supply Chain

๏ Delivery Pipeline

๏ Data Flow Security

๏ Attack Detection

Page 97: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 98: Serverless and the Way Forward

November 15, 2016@WICKETT

SURFACE AREA REDUCTION!

Page 99: Serverless and the Way Forward

November 15, 2016@WICKETT

SURFACE AREA EXPANSION!

Page 100: Serverless and the Way Forward

November 15, 2016@WICKETT

SSL / TLS FROM THE PROVIDER

Page 101: Serverless and the Way Forward

November 15, 2016@WICKETT

DNS!

Page 102: Serverless and the Way Forward

November 15, 2016@WICKETT

LAMBDA + S3 + KINESIS + DYNAMODB + CLOUDFORMATION + API GATEWAY + AUTH0

Page 103: Serverless and the Way Forward

November 15, 2016@WICKETT

USE A THIRD-PARTY SERVICE FOR CONFIG

CHANGES

Page 104: Serverless and the Way Forward

November 15, 2016@WICKETT

ACCESS CONTROL

Page 105: Serverless and the Way Forward

November 15, 2016@WICKETT

DELIVERY PIPELINE SECURITY

Page 106: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 107: Serverless and the Way Forward

November 15, 2016@WICKETT

UNIT TESTING

Page 108: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 109: Serverless and the Way Forward

November 15, 2016@WICKETT

INTEGRATION TESTING

Page 110: Serverless and the Way Forward

November 15, 2016@WICKETT

CONFIGURATION IS PART OF DELIVERY

Page 111: Serverless and the Way Forward

November 15, 2016@WICKETT

PROVIDER SECURITY

๏ Disable root access keys

๏ Manage users with profiles

๏ Secure your keys in your deploy system

๏ Secure keys in dev system

๏ Use provider MFA

Page 112: Serverless and the Way Forward

November 15, 2016@WICKETT

SIMPLE DEPLOY PIPELINE SECURITY

๏ Only dev keys can push to ‘dev’

๏ Only build/deploy system can push to pre-prod

๏ Integration tests must pass in this env

๏ Security validation must take place

๏ Allow push to prod, only by deploy system

Page 113: Serverless and the Way Forward

November 15, 2016@WICKETT

SECURITY INTEGRATION TESTING

๏ BDD-Security - github.com/continuumsecurity/bdd-security

๏ Gauntlt - gauntlt.org

Page 114: Serverless and the Way Forward

November 15, 2016@WICKETT

http://www.slideshare.net/wickett/pragmatic-security-and-rugged-devops-sxsw-2015

Page 115: Serverless and the Way Forward

November 15, 2016@WICKETT

DATA FLOW SECURITY

๏ Development

๏ Data Flow Diagrams

๏ Threat modeling

๏ Runtime

Page 116: Serverless and the Way Forward

November 15, 2016@WICKETT

Application layer DoS

Page 117: Serverless and the Way Forward

November 15, 2016@WICKETT

TIMEOUTS AND EXECUTION

RESTRICTIONS

Page 118: Serverless and the Way Forward

November 15, 2016@WICKETT

HTTP / HTTPS

Page 119: Serverless and the Way Forward

November 15, 2016@WICKETT

ATTACK DETECTION

Page 120: Serverless and the Way Forward

November 15, 2016@WICKETT

DEVELOPMENT

๏ Normal OWASP tooling

๏ Language filtering and more

Page 121: Serverless and the Way Forward

November 15, 2016@WICKETT

APPSEC PROBLEMS

Page 122: Serverless and the Way Forward

November 15, 2016@WICKETT

DEFENSE

๏ Logging, emitting events

๏ Vandium (SQLi) wrapper

๏ Content Security Policy (CSP)

๏ More work needs to be done here…

Page 123: Serverless and the Way Forward

November 15, 2016@WICKETT

CONCLUSION

๏ Serverless encourages functions as deploy units, coupled with third party services that allow running end-to-end applications without worrying about system operation.

๏ New serverless patterns are just emerging

๏ Security with serverless is easier

๏ Security with serverless is harder

Page 124: Serverless and the Way Forward

November 15, 2016@WICKETT

CONCLUSION (2)

๏ Four key areas apply to serverless security

๏ Software Supply Chain Security

๏ Delivery Pipeline Security

๏ Data Flow Security

๏ Attack Detection

Page 125: Serverless and the Way Forward

November 15, 2016@WICKETT

Page 126: Serverless and the Way Forward

November 15, 2016@WICKETT

LET’S TALK!

[email protected]

๏ @wickett

๏ http://info.signalsciences.com/book

Page 127: Serverless and the Way Forward

November 15, 2016

Page 128: Serverless and the Way Forward

November 15, 2016