SlideShare a Scribd company logo
Security in the Serverless World
Yan Cui
http://theburningmonk.com
@theburningmonk
Principal Engineer @
Independent Consultant
Security in serverless world
We’re hiring! Visit
engineering.dazn.com
to learn more.
follow @dazneng for
updates about the
engineering team
follow @dazneng for
updates about the
engineering team
We’re hiring! Visit
engineering.dazn.com
to learn more.
WE’RE HIRING!
AWS user since 2009
http://bit.ly/yubl-serverless
Shared Responsibility Model
Shared Responsibility Model
protection from OS attacks
Amazon automatically apply latest patches to host VMs
Security in serverless world
Security in serverless world
still have to patch your code
vulnerable code, 3rd party dependencies, etc.
Security in serverless world
https://snyk.io/blog/owasp-top-10-breaches
https://snyk.io/blog/owasp-top-10-breaches
Known Vulnerable Components cause 24% of the top 50 data breaches
https://snyk.io/blog/77-percent-of-sites-use-vulnerable-js-libraries
Security in serverless world
Security in serverless world
Security in serverless world
Security in serverless world
http://bit.ly/2topw5I
sanitise inputs & outputs
(standardise and encapsulate into shared lib)
Security in serverless world
http://bit.ly/2gSHtay
Broken Access Control
Insecure Direct Object Reference
Information Leakage
GraphQL Injection
http://bit.ly/2uKhGXF
Security in serverless world
app dependencies
is a
attack surface
BIGGER
than you think
your dependencies
your dependencies
transient dependencies
https://david-dm.org/request/request?view=tree
Security in serverless world
https://snyk.io
security updates are often
bundled with unrelated
feature and API changes
your security is as strong
as its weakest link
OS
Application
Dependencies
physical
infrastructure
NPM Authors
Container
runs in
runs in
runs in
has
hosted by published by
pushes to
Developers
develops uses
Users
guardsprotects
Networking
runs on
needs
Source Code
has
maintains
OS
Application
Dependencies
physical
infrastructure
NPM Authors
Container
runs in
runs in
runs in
has
hosted by published by
pushes to
Developers
develops uses
Users
guardsprotects
Networking
needs
runs on this is where an attacker will
target in a movie
Source Code
has
maintains
Security in serverless world
Security in serverless world
OS
Dependencies
physical
infrastructure
NPM Authors
Container
runs in
runs in
runs in
has
hosted by published by
pushes to
Developers
develops uses
Users
guardsprotects
Application
A9
Networking
runs on
needs
Source Code
has
maintains
A1, A3, …
people are often the WEAKEST link
in the security chain
Security in serverless world
OS
Dependencies
physical
infrastructure
NPM Authors
Container
runs in
runs in
runs in
has
hosted by published by
pushes to
Developers
develops uses
Users
guardsprotects
Application
phishing…
Networking
runs on
needs
Source Code
has
maintains
OS
Dependencies
physical
infrastructure
NPM Authors
Container
runs in
runs in
runs in
has
hosted by published by
pushes to
Developers
develops uses
Users
guardsprotects
Application
brute force, known
account leaks, …
Networking
runs on
needs
Source Code
has
maintains
OS
Dependencies
physical
infrastructure
NPM Authors
Container
runs in
runs in
runs in
has
hosted by published by
pushes to
Developers
develops uses
Users
guardsprotects
Application
brute force, known
account leaks, …
Networking
runs on
needs
Source Code
has
maintains
http://bit.ly/2sFDwYX
…obtained publish access to 14% of npm packages…
http://bit.ly/2sFDwYX
debug, request, react, co, express, moment, gulp, mongoose, mysql, bower,
browserify, electron, jasmine, cheerio, modernizr, redux, …
http://bit.ly/2sFDwYX
total downloads/month of the unique packages which I got
myself publish access to was 1 972 421 945, that’s
20% of the total number of d/m directly.
20% of all monthly NPM downloads…
brute force
known account leaks from other sources
leaked NPM credentials (github, etc.)
http://bit.ly/2sFDwYX
http://bit.ly/2sFDwYX
662 users had password “123456”
172 — “123”
124 — “password”
Security in serverless world
Security in serverless world
WTF!?!?
Security in serverless world
Security in serverless world
Security in serverless world
Security in serverless world
oh god, that was too easy…
Security in serverless world
Security in serverless world
compromised package is a
transient dependency
sigh…
still “works”…
Security in serverless world
Security in serverless world
npmjs.com/~hacktask
Security in serverless world
rm -rf /!!!
Security in serverless world
NPM default - get latest
“compatible” version, ie. 1.X.X
clean install (eg. on CI server) will
download the latest, compromised
package without any code change…
NPM default - get latest
“compatible” version, ie. 1.X.X
Security in serverless world
use npm shrinkwrap
or upgrade to NPM 5 or above
not specific to Node.js or NPM
the attackers are in…
the attackers are in…
what now?
Shared Responsibility Model
who can invoke the function?
what can the function access?
Least Privilege Principle
Security in serverless world
everything here
is trusted
Security in serverless world
sensitive data
http://bit.ly/2zHvbcB
always public
access is controlled via IAM
Security in serverless world
Security in serverless world
Security in serverless world
Security in serverless world
http://bit.ly/2lNInES
adds up to 10s to cold start!!
http://bit.ly/2lNInES
compromised servers allow
attacker to access all of
your sensitive data!
implement authentication
for internal APIs
Security in serverless world
use AWS_IAM
authentication for
internal APIs
Security in serverless world
minimise function’s access
Security in serverless world
Security in serverless world
Security in serverless world
requires developer discipline
Security in serverless world
Security in serverless world
AWS Lambda
docs
Write your Lambda function
code in a stateless style, and
ensure there is no affinity
between your code and the
underlying compute
infrastructure.
http://amzn.to/2jzLmkb
S3
AWS IoT
DynamoDB
RDS
EventStore
Elasticsearch Couchbase
Redshift
Neo4j
Google BigQuery
secure sensitive data both
at rest and in-transit
leverage server-side encryption
http://amzn.to/1N3Twb8
http://amzn.to/1xF41eX
http://amzn.to/2tgvFR2
https://amzn.to/2DaXFwA
Least Privilege Principle
Disposability is a virtue
AWS Lambda
docs
Delete old Lambda functions that
you are no longer using.
http://amzn.to/2jzLmkb
easier said than done…
identifying component
ownership in a big IT
organization is challenging
identifying ownership of
individual functions is
much harder
source: http://www.digitalattackmap.com
more likely to scale through
DoS attacks
DoS + per exec billing =
Denial of Wallet problem
have to choose between a
DoS and a DoW problem…
Security in serverless world
AWS Shield Advanced also gives you access to the AWS DDoS
Response Team (DRT) and protection against DDoS related
spikes in your ELB, CloudFront or Route 53 charges.
async sync
S3
SNS
SES
CloudFormation
CloudWatch Logs
CloudWatch Events
Scheduled Events
CodeCommit
AWS Config
http://amzn.to/2vs2lIg
Cognito
Alexa
Lex
API Gateway
pulling
DynamoDB Stream
Kinesis Stream
SQS
Lambda handles retries
(twice, then DLQ)
http://bit.ly/2v7F2E4
DoS attack
2+ Retries+
?
DoS attack
Regex DoS attack
long Lambda timeout
2+ Retries+
?
Security in serverless world
Day 1
Day 2
Security in serverless world
no long-lived compromised servers
containers are reused, avoid
sensitive data in /tmp
https://www.puresec.io/function-shield
Security in serverless world
Security in serverless world
Security in serverless world
no accidentally exposed directories
Security in serverless world
Security in serverless world
Security in serverless world
http://bit.ly/2tlGTbc
monitor activities in
unused regions using
CloudWatch Events
Security in serverless world
set up billing alarms in unused regions
watertight compartments that can contain water in
the case of hull breach or other leaks
Michael Nygard
least privilege principle
per function policies
account level isolation
Recap
app dependencies
is a
attack surface
BIGGER
than you think
Security in serverless world
sanitise inputs and outputs
Least Privilege Principle
here’s your per function policy
NEXT!
S3
AWS IoT
DynamoDB
RDS
EventStore
Elasticsearch Couchbase
Redshift
Neo4j
Google BigQuery
encrypt data at rest
S3
AWS IoT
DynamoDB
RDS
EventStore
Elasticsearch Couchbase
Redshift
Neo4j
Google BigQuery
and in-transit
delete unused functions.
DoS DoW*
* Denial of Wallet
Security in serverless world
Security in serverless world
Security in serverless world
no server*
no OS attacks
no long lived compromised servers
* I know I know, there’s still a server somewhere, but it’s managed and secured by AWS engineers who can do a much better job of it
than most of us can; and the servers are ephemeral and short-lived
don’t be an unwilling bit miner
don’t be an unwilling bit miner
safeguard your credentials…
prod dev
compartmentalise breaches
people are often the WEAKEST link
in the security chain
@theburningmonk
theburningmonk.com
github.com/theburningmonk

More Related Content

PDF
Serverless in production, an experience report
PDF
How did we get here and where are we going
PDF
Serverless security: defence against the dark arts
PDF
Serverless is a win for businesses, not just developers
PDF
Security in serverless world
PDF
You wouldn't build a toast, would you?
PDF
Security in serverless world
PDF
Security in serverless world (get.net)
Serverless in production, an experience report
How did we get here and where are we going
Serverless security: defence against the dark arts
Serverless is a win for businesses, not just developers
Security in serverless world
You wouldn't build a toast, would you?
Security in serverless world
Security in serverless world (get.net)

What's hot (14)

PDF
AWS Lambda from the trenches
PDF
Serverless Architectural Patterns
PDF
Continuous Integration and Deployment Best Practices on AWS
PDF
Build reactive systems on lambda
PDF
How to build observability into Serverless (O'Reilly Velocity 2018)
PDF
Serveless Design Patterns (Serverless Computing London)
PPTX
Ten^H^H^H Many Cloud App Design Patterns
PDF
Streams and serverless at DAZN
PDF
McrUmbMeetup 22 May 14: Umbraco and Amazon
PPTX
Microservices Delivery Platform. Tips & Tricks
PPTX
IP EXPO London 2017: Modernizing Traditional Apps with Docker
PDF
Multi-Cloud testing
PPTX
Azure Bootcamp 2016 - Docker Orchestration on Azure with Rancher
PDF
Installing WordPress on AWS
AWS Lambda from the trenches
Serverless Architectural Patterns
Continuous Integration and Deployment Best Practices on AWS
Build reactive systems on lambda
How to build observability into Serverless (O'Reilly Velocity 2018)
Serveless Design Patterns (Serverless Computing London)
Ten^H^H^H Many Cloud App Design Patterns
Streams and serverless at DAZN
McrUmbMeetup 22 May 14: Umbraco and Amazon
Microservices Delivery Platform. Tips & Tricks
IP EXPO London 2017: Modernizing Traditional Apps with Docker
Multi-Cloud testing
Azure Bootcamp 2016 - Docker Orchestration on Azure with Rancher
Installing WordPress on AWS

Similar to Security in serverless world (20)

PDF
DevSecCon London 2018: Security in the serverless world
PDF
Security in Serverless world
PDF
Serverless security: defense against the dark arts
PDF
Serverless Security: Defence Against the Dark Arts
PPTX
Container security
PDF
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
PDF
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
PDF
Continuous Security: From tins to containers - now what!
PPT
Google chrome sandbox
PPTX
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
PDF
Digital Forensics and Incident Response in The Cloud Part 3
PPTX
CEHv10 M0 Introduction.pptx
PDF
There is No Server: Immutable Infrastructure and Serverless Architecture
PDF
The lies we tell our code, LinuxCon/CloudOpen 2015-08-18
PDF
Dev and Blind - Attacking the weakest Link in IT Security
PDF
Stranger Danger: Your Java Attack Surface Just Got Bigger | JBCNConf 2022
PPTX
Buffer overflows
PDF
Docker, Linux Containers, and Security: Does It Add Up?
PPTX
Docker - Demo on PHP Application deployment
PDF
Docker, Linux Containers (LXC), and security
DevSecCon London 2018: Security in the serverless world
Security in Serverless world
Serverless security: defense against the dark arts
Serverless Security: Defence Against the Dark Arts
Container security
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Continuous Security: From tins to containers - now what!
Google chrome sandbox
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
Digital Forensics and Incident Response in The Cloud Part 3
CEHv10 M0 Introduction.pptx
There is No Server: Immutable Infrastructure and Serverless Architecture
The lies we tell our code, LinuxCon/CloudOpen 2015-08-18
Dev and Blind - Attacking the weakest Link in IT Security
Stranger Danger: Your Java Attack Surface Just Got Bigger | JBCNConf 2022
Buffer overflows
Docker, Linux Containers, and Security: Does It Add Up?
Docker - Demo on PHP Application deployment
Docker, Linux Containers (LXC), and security

More from Yan Cui (20)

PDF
How to win the game of trade-offs
PDF
How to choose the right messaging service
PDF
How to choose the right messaging service for your workload
PDF
Patterns and practices for building resilient serverless applications.pdf
PDF
Lambda and DynamoDB best practices
PDF
Lessons from running AppSync in prod
PDF
Serverless observability - a hero's perspective
PDF
How to ship customer value faster with step functions
PDF
How serverless changes the cost paradigm
PDF
Why your next serverless project should use AWS AppSync
PDF
Build social network in 4 weeks
PDF
Patterns and practices for building resilient serverless applications
PDF
How to bring chaos engineering to serverless
PDF
Migrating existing monolith to serverless in 8 steps
PDF
Building a social network in under 4 weeks with Serverless and GraphQL
PDF
FinDev as a business advantage in the post covid19 economy
PDF
How to improve lambda cold starts
PDF
What can you do with lambda in 2020
PDF
A chaos experiment a day, keeping the outage away
PDF
How to debug slow lambda response times
How to win the game of trade-offs
How to choose the right messaging service
How to choose the right messaging service for your workload
Patterns and practices for building resilient serverless applications.pdf
Lambda and DynamoDB best practices
Lessons from running AppSync in prod
Serverless observability - a hero's perspective
How to ship customer value faster with step functions
How serverless changes the cost paradigm
Why your next serverless project should use AWS AppSync
Build social network in 4 weeks
Patterns and practices for building resilient serverless applications
How to bring chaos engineering to serverless
Migrating existing monolith to serverless in 8 steps
Building a social network in under 4 weeks with Serverless and GraphQL
FinDev as a business advantage in the post covid19 economy
How to improve lambda cold starts
What can you do with lambda in 2020
A chaos experiment a day, keeping the outage away
How to debug slow lambda response times

Recently uploaded (20)

PDF
Getting Started with Data Integration: FME Form 101
PDF
Machine learning based COVID-19 study performance prediction
PDF
Empathic Computing: Creating Shared Understanding
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
1. Introduction to Computer Programming.pptx
PPT
Teaching material agriculture food technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mushroom cultivation and it's methods.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Getting Started with Data Integration: FME Form 101
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Programs and apps: productivity, graphics, security and other tools
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
Assigned Numbers - 2025 - Bluetooth® Document
1. Introduction to Computer Programming.pptx
Teaching material agriculture food technology
Encapsulation_ Review paper, used for researhc scholars
Mushroom cultivation and it's methods.pdf
NewMind AI Weekly Chronicles - August'25-Week II
MIND Revenue Release Quarter 2 2025 Press Release
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...

Security in serverless world