SlideShare a Scribd company logo
Minimizing the attack
surface in Serverless
Avi Shulman
Co Founder & CTO @ PureSec
Serverless Security Expert
Security Research - F5 Networks, Argus, Israel Defense Forces
Twitter - @Shulik
What Will You Hear About Today?
What influences Serverless attack surface?
What are the exploitability options?
What can be done to minimize the risks?
SERVERLESS
ATTACK SURFACE
Data
Application
Configurations
Scalability
Monitoring
Patching
Setup
Operating System
Provisioning
Virtualization
Servers
Network
Data Center
Data
Application
Configurations
Scalability
Monitoring
Patching
Setup
Operating System
Provisioning
Virtualization
Data
Application
Configurations
Scalability
Monitoring
Patching
Setup
Operating System
Data
Application
Configurations
On Premise Data Center
Hosting
IaaS Serverless
Security - The Responsibility of the Enterprise or The Cloud Provider?
Servers
Network
Data Center
Provisioning
Virtualization
Servers
Network
Data Center
Scalability
Monitoring
Patching
Setup
OS
Provisioning
Virtualization
Servers
Network
Data Center
Executes our code
Manages scalability
Keeps data safe in transit
Patches the operating system
Provides isolation
“...IN CLOUD WE TRUST”
CLOUD PROVIDER
The Cloud “Operating System”
2
4
1
3
5
Functions
Storage
API Gateways
Streams
Databases
Queues
https://hackernoon.com/yubls-road-to-serverless-part-1-overview-ca348370acde
The attack surface becomes
… Harder to understand
… Harder to visualize
… Harder to test
EXPLOITING SERVERLESS
ATTACK SURFACE
Complex data flows:
What exactly happened to a specific request?
Traditional security doesn’t fit:
How do I protect my serverless application?
Detect a Vulnerability
Find a serverless target
Fuzz the input
Code Injection
Identify available access
Lateral MovementPersistency Exfiltration
Normal Execution
$ curl –s https://****.execute-api.us-east-
1.amazonaws.com/dev/users/get/KGRwM...nNTJ2l
kJwpwNApJMTIzNDUKcy4= | python –m json.tool
{
"address" : "US"
}
$ curl –s https://****.execute-api.us-east-
1.amazonaws.com/dev/users/get/Y3N5cwpleGl0Ci
hTJzAnCnRSLickdFIu | python –m json.tool
{
"message" : "Internal
server error"
}
Indication of a potential vulnerability
Injected command: sys.exit('0')
Successful Payload
>>> exploit = "csysnexitn(S'0'ntR.'ntR."
>>> base64.b64encode(exploit)
'Y3N5cwpleGl0CihTJzAnCnRSLickKdFIu'
The Vulnerability (Under the Hood)
CWE-502:
Deserialization
of Untrusted
Data
>>>
Many more resources:
Potentially many functions, many IAM roles, etc.
Lack of visibility:
What’s happening in my application right now?
Access to an AWS account
Publicly available access keys
Malicious Lambda
Identify available access
Lateral MovementPersistency Exfiltration
https://www.blackhat.com/docs/us-16/materials/us-16-Amiga-Account-Jumping-Post-Infection-Persistency-And-Lateral-Movement-In-AWS-wp.pdf
Serverless - minimizing the attack surface
Easy to add input sources:
Just add another trigger to a Lambda function
Agile on steroids:
Code goes faster to production
Malicious 3rd party library
Code Injection
Identify available access
Lateral MovementPersistency Exfiltration
acqusition  acquisition
apidev-coop  apidev-coop_cms
bzip  bz2file
crypt  crypto
django-server  django-server-guardian-api
pwd  pwdhash
setup-tools  setuptools
telnet  telnetsrvlib
urlib3  urllib3
urllib  urllib3
https://arstechnica.com/information-technology/2017/09/devs-unknowingly-use-malicious-modules-put-into-official-python-repository/
“Devs unknowingly use malicious
modules snuck into official Python
repository”
After gaining access,
attackers will try to use the
access available to them
Identify available access
Lateral MovementPersistency Exfiltration
How?
https://www.blackhat.com/docs/us-17/wednesday/us-17-Krug-Hacking-Severless-Runtimes.pdf
By bruteforcing boto3 API calls
Data leakage
Tampering with data
Exfiltration
Persistency
Lateral movement
Denial of Service
a
*
ses:SendEmail
Privilege Elevation
Easy, but bad practice
Serverless - minimizing the attack surface
Serverless - minimizing the attack surface
of serverless projects on Github are
improperly configured and
probability contain over privileged
roles
Minimize the Attack Surface with PureSec’s Serverless Plugin
Auto-magically creates least privileged
IAM roles for you – with the minimum required
permissions
Reduces the attack surface of
Serverless applications on AWS
Currently supported runtimes: Python & Node.js
Currently supported services: DynamoDB, Kinesis,
KMS, Lambda, S3, SES, SNS & Step Functions
Works with the Serverless Framework
DEMO
a
*
X
X
X
X
X
X
X
Minimize the risk
 Construct a proper threat model
 Follow best practices and tips
Keep least privileged permissions
 Integrate suitable detection and response solutions
THANK
YOU!

More Related Content

Similar to Serverless - minimizing the attack surface (20)

PDF
Reducing Your Attack Surface & Your Role in Cloud Workload Protection
Alert Logic
 
PPTX
Serverless Siege: AWS Lambda Pentesting - OWASP Top 10 Serverless C0c0n 2023
Divyanshu
 
PPTX
OWASP Serverless Top 10
Chandrapal Badshah
 
PPTX
Vulnerability Management
justinkallhoff
 
PPTX
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
BlueHat Security Conference
 
PPTX
Indianapolis Splunk User Group Dec 22
WesComer2
 
PDF
Us 17-krug-hacking-severless-runtimes
Ravishankar Somasundaram
 
PDF
Serverless Security: What's Left To Protect
Guy Podjarny
 
ODP
Security its-more-than-just-your-database-you-should-worry-about
David Busby, CISSP
 
PDF
Serverless Security: Best practices and mitigation strategies (re:Inforce 2019)
Jeremy Daly
 
PDF
Web hackingtools cf-summit2014
ColdFusionConference
 
PDF
Zerotrusting serverless applications protecting microservices using secure d...
Trupti Shiralkar, CISSP
 
PDF
5 attack vectors behind 3000+ breaches.pdf
prithaaash
 
ODP
Web application-security-and-why-you-should-review-yours
David Busby, CISSP
 
PPT
MIT-6-determina-vps.ppt
webhostingguy
 
PPTX
Ple18 web-security-david-busby
David Busby, CISSP
 
PPTX
The Top 10 Most Common Weaknesses in Serverless Applications 2018
PureSec
 
PDF
Securing serverless system
NUS-ISS
 
PPTX
Securing Serverless Systems
Vincent Lau
 
PDF
The State of Application Security: What Hackers Break
Imperva
 
Reducing Your Attack Surface & Your Role in Cloud Workload Protection
Alert Logic
 
Serverless Siege: AWS Lambda Pentesting - OWASP Top 10 Serverless C0c0n 2023
Divyanshu
 
OWASP Serverless Top 10
Chandrapal Badshah
 
Vulnerability Management
justinkallhoff
 
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
BlueHat Security Conference
 
Indianapolis Splunk User Group Dec 22
WesComer2
 
Us 17-krug-hacking-severless-runtimes
Ravishankar Somasundaram
 
Serverless Security: What's Left To Protect
Guy Podjarny
 
Security its-more-than-just-your-database-you-should-worry-about
David Busby, CISSP
 
Serverless Security: Best practices and mitigation strategies (re:Inforce 2019)
Jeremy Daly
 
Web hackingtools cf-summit2014
ColdFusionConference
 
Zerotrusting serverless applications protecting microservices using secure d...
Trupti Shiralkar, CISSP
 
5 attack vectors behind 3000+ breaches.pdf
prithaaash
 
Web application-security-and-why-you-should-review-yours
David Busby, CISSP
 
MIT-6-determina-vps.ppt
webhostingguy
 
Ple18 web-security-david-busby
David Busby, CISSP
 
The Top 10 Most Common Weaknesses in Serverless Applications 2018
PureSec
 
Securing serverless system
NUS-ISS
 
Securing Serverless Systems
Vincent Lau
 
The State of Application Security: What Hackers Break
Imperva
 

Recently uploaded (20)

PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Ad

Serverless - minimizing the attack surface

Editor's Notes

  • #3: PureSec – A security platform for serverless architectures. Over the past year I have been researching serverless security
  • #4: Share my perspectives regarding what… What influences the attack surface – serverless changes the way we build applications – how these changes influence the security and the attack surface. What are the exploitability options – how attackers think. How attackers can leverage the changes that serverless development brings. What can be done to minimize the risk – what actions can we take to reduce probability of being successfully attacked.
  • #6: Shared responsibility concept. – Mark has already mentioned it earlier today, but please notice the great animation  Cloud computing evolution. The cloud provider is now responsible more layers.
  • #7: Executes our code – after deploying our functions we trust the cloud provider to execute them. Manages scalability – we trust that the scale of the application will be fully managed by the providers. Keeps data safe in transit - when an event is passed to a function we trust that is happened securely. Patches the operating system – the image of the container in which our code is executed. Keeps the libraries up-to-date. Enforces the required permissions. Provides the required Isolation – between different functions and different customers.
  • #8: Serverless is not only the compute functionality. Array of services and tools. The compute part links all the services together. One term to describe what serverless creates is a Cloud Operating System. This is important because ... When analyzing and thinking about the attack surface in serverless, we should think about all the components we have, including the services we use. Every configuration in a service that is connected to our functions – is important for analyzing the attack surface. Let’s see an example of how a serverless architecture may look like.
  • #9: 1. A quite complicated architecture. 2. How many entry points does this application have? 3. Where should we put the security controls? 4. What are all the possible flows? 5. How can we define what might go wrong?
  • #10: Understand – an event driven architecture with limited control. Visualize – distributed logic, micro services. Test – How do we test the attack surface when we have difficulties debugging? How do we perform penetration testing in such applications?
  • #12: Influential factors on the attack surface: Complex data flows – Difficult to trace – API Gateway -> Lambda -> S3 -> Lambda Traditional security – What kind of security controls can we enforce? How do we protect event driven applications? What shall we do when the operating system and the network are abstracted?
  • #13: For those of you who wondered.. It's not a real book :) 1. A potential course of events may be…
  • #16: 1. Vulnerability in the cPickle library in Python 2. Deserialization of Untrusted Data
  • #17: More influential factors are... Many functions, many IAM roles. Instead of having several servers, we now have many Lambda functions (AWS), many DynamoDB tables and S3 Buckets… Lack of visibility – black box. Tracing requests, having a good understand of what’s going on.
  • #21: In serverless it becomes easy to add input sources and create new entry points to the system. Increases the probability of having a misconfigured entry point. CICD processes become much faster, code is easily added to production. It’s harder to remove pieces of code.
  • #24: 1. As you’ve seen in the previous slides…
  • #25: Speak only about identifying the access
  • #27: 1. This is what an attacker can do if he an over privileged compromised Lambda function.
  • #28: 1. Let’s talk about over permissive roles …
  • #29: 1. Do you want to guess how many projects contain iamRolesStatement?
  • #32: 1. Happy to introduce PureSec’s serverless plugin
  • #35: Threat modeling – What is the application is supposed to do? What the application shouldn’t allow to do? Trust Level External dependencies Entry points Best practices Development – input validation, popular frameworks. Use static & dynamic analysis tools. Scan for vulnerabilities in 3rd libraries and check their integrity. Use single purpose functions and limit the functions that have access to sensitive data. Don’t embed secrets and access keys in code. Least privileged – Functions Deployment System Solutions. That suite.