SlideShare una empresa de Scribd logo
1 de 35
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
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
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!

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

The Role of CDP in Data-Driven Marketing
The Role of CDP in Data-Driven MarketingThe Role of CDP in Data-Driven Marketing
The Role of CDP in Data-Driven Marketing
 
Data Architecture Strategies: Building an Enterprise Data Strategy – Where to...
Data Architecture Strategies: Building an Enterprise Data Strategy – Where to...Data Architecture Strategies: Building an Enterprise Data Strategy – Where to...
Data Architecture Strategies: Building an Enterprise Data Strategy – Where to...
 
The Value of the Modern Data Architecture with Apache Hadoop and Teradata
The Value of the Modern Data Architecture with Apache Hadoop and Teradata The Value of the Modern Data Architecture with Apache Hadoop and Teradata
The Value of the Modern Data Architecture with Apache Hadoop and Teradata
 
Data Virtualization: An Essential Component of a Cloud Data Lake
Data Virtualization: An Essential Component of a Cloud Data LakeData Virtualization: An Essential Component of a Cloud Data Lake
Data Virtualization: An Essential Component of a Cloud Data Lake
 
What is (and who needs) a customer data platform?
What is (and who needs) a customer data platform?What is (and who needs) a customer data platform?
What is (and who needs) a customer data platform?
 
Microservices: A Step Towards Modernizing Healthcare Applications
Microservices: A Step Towards Modernizing Healthcare ApplicationsMicroservices: A Step Towards Modernizing Healthcare Applications
Microservices: A Step Towards Modernizing Healthcare Applications
 
Building a Data Strategy – Practical Steps for Aligning with Business Goals
Building a Data Strategy – Practical Steps for Aligning with Business GoalsBuilding a Data Strategy – Practical Steps for Aligning with Business Goals
Building a Data Strategy – Practical Steps for Aligning with Business Goals
 
Big Data / Büyük Veri Nedir?
Big Data / Büyük Veri Nedir?Big Data / Büyük Veri Nedir?
Big Data / Büyük Veri Nedir?
 
Data Lakehouse, Data Mesh, and Data Fabric (r2)
Data Lakehouse, Data Mesh, and Data Fabric (r2)Data Lakehouse, Data Mesh, and Data Fabric (r2)
Data Lakehouse, Data Mesh, and Data Fabric (r2)
 
KEAMANAN KOMPUTER
KEAMANAN KOMPUTERKEAMANAN KOMPUTER
KEAMANAN KOMPUTER
 
Cybersecurity | Cylus: Railway Cybersecurity
Cybersecurity | Cylus: Railway CybersecurityCybersecurity | Cylus: Railway Cybersecurity
Cybersecurity | Cylus: Railway Cybersecurity
 
Canvas and Model Driven Apps
Canvas and Model Driven AppsCanvas and Model Driven Apps
Canvas and Model Driven Apps
 
Advanced PII / PI data discovery and data protection
Advanced PII / PI data discovery and data protectionAdvanced PII / PI data discovery and data protection
Advanced PII / PI data discovery and data protection
 
Machine Learning Data Lineage with MLflow and Delta Lake
Machine Learning Data Lineage with MLflow and Delta LakeMachine Learning Data Lineage with MLflow and Delta Lake
Machine Learning Data Lineage with MLflow and Delta Lake
 
CB-Insights_Big-Tech-In-Pharma.pdf
CB-Insights_Big-Tech-In-Pharma.pdfCB-Insights_Big-Tech-In-Pharma.pdf
CB-Insights_Big-Tech-In-Pharma.pdf
 
OneIdentity - A Future-Ready Approach to IAM
OneIdentity - A Future-Ready Approach to IAMOneIdentity - A Future-Ready Approach to IAM
OneIdentity - A Future-Ready Approach to IAM
 
SharePoint Document Management
SharePoint Document ManagementSharePoint Document Management
SharePoint Document Management
 
MDM & BI Strategy For Large Enterprises
MDM & BI Strategy For Large EnterprisesMDM & BI Strategy For Large Enterprises
MDM & BI Strategy For Large Enterprises
 
Impact industry 4.0 on the (SAP) intelligent enterprise
Impact industry 4.0 on the (SAP) intelligent enterpriseImpact industry 4.0 on the (SAP) intelligent enterprise
Impact industry 4.0 on the (SAP) intelligent enterprise
 
Data Lake Architecture – Modern Strategies & Approaches
Data Lake Architecture – Modern Strategies & ApproachesData Lake Architecture – Modern Strategies & Approaches
Data Lake Architecture – Modern Strategies & Approaches
 

Similar a Serverless - minimizing the attack surface

Security concerns with SaaS layer of cloud computing
Security concerns with SaaS layer of cloud computingSecurity concerns with SaaS layer of cloud computing
Security concerns with SaaS layer of cloud computing
Clinton DSouza
 
Oscon anatomy of_os_cloud_ecosystem
Oscon anatomy of_os_cloud_ecosystemOscon anatomy of_os_cloud_ecosystem
Oscon anatomy of_os_cloud_ecosystem
htdvul
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
cgt38842
 

Similar a Serverless - minimizing the attack surface (20)

AWS Lambda Security Inside & Out
AWS Lambda Security Inside & OutAWS Lambda Security Inside & Out
AWS Lambda Security Inside & Out
 
Secure & Automate AWS Deployments with Next-Generation Security from Palo Alt...
Secure & Automate AWS Deployments with Next-Generation Security from Palo Alt...Secure & Automate AWS Deployments with Next-Generation Security from Palo Alt...
Secure & Automate AWS Deployments with Next-Generation Security from Palo Alt...
 
Security concerns with SaaS layer of cloud computing
Security concerns with SaaS layer of cloud computingSecurity concerns with SaaS layer of cloud computing
Security concerns with SaaS layer of cloud computing
 
Content Analysis System and Advanced Threat Protection
Content Analysis System and Advanced Threat ProtectionContent Analysis System and Advanced Threat Protection
Content Analysis System and Advanced Threat Protection
 
How to build observability into a serverless application
How to build observability into a serverless applicationHow to build observability into a serverless application
How to build observability into a serverless application
 
The future will be Serverless - JSDay Verona 2018
The future will be Serverless - JSDay Verona 2018The future will be Serverless - JSDay Verona 2018
The future will be Serverless - JSDay Verona 2018
 
Kali linux useful tools
Kali linux useful toolsKali linux useful tools
Kali linux useful tools
 
Ending the Tyranny of Expensive Security Tools
Ending the Tyranny of Expensive Security ToolsEnding the Tyranny of Expensive Security Tools
Ending the Tyranny of Expensive Security Tools
 
Ending the Tyranny of Expensive Security Tools
Ending the Tyranny of Expensive Security ToolsEnding the Tyranny of Expensive Security Tools
Ending the Tyranny of Expensive Security Tools
 
How to build observability into a serverless application
How to build observability into a serverless applicationHow to build observability into a serverless application
How to build observability into a serverless application
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline Security
 
Security in the cloud Workshop HSTC 2014
Security in the cloud Workshop HSTC 2014Security in the cloud Workshop HSTC 2014
Security in the cloud Workshop HSTC 2014
 
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
 
3 Secrets to Becoming a Cloud Security Superhero
3 Secrets to Becoming a Cloud Security Superhero 3 Secrets to Becoming a Cloud Security Superhero
3 Secrets to Becoming a Cloud Security Superhero
 
HLC302_Adopting Microservices in Healthcare Building a Compliant DevOps Pipel...
HLC302_Adopting Microservices in Healthcare Building a Compliant DevOps Pipel...HLC302_Adopting Microservices in Healthcare Building a Compliant DevOps Pipel...
HLC302_Adopting Microservices in Healthcare Building a Compliant DevOps Pipel...
 
Vices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
Vices & Devices - How IoT & Insecure APIs Became the New Cyber BattlefrontVices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
Vices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
 
Oscon anatomy of_os_cloud_ecosystem
Oscon anatomy of_os_cloud_ecosystemOscon anatomy of_os_cloud_ecosystem
Oscon anatomy of_os_cloud_ecosystem
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
Automating your AWS Security Operations
Automating your AWS Security OperationsAutomating your AWS Security Operations
Automating your AWS Security Operations
 
Automating your AWS Security Operations
Automating your AWS Security OperationsAutomating your AWS Security Operations
Automating your AWS Security Operations
 

Último

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Último (20)

%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 

Serverless - minimizing the attack surface

Notas del editor

  1. PureSec – A security platform for serverless architectures. Over the past year I have been researching serverless security
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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?
  7. 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?
  8. 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?
  9. For those of you who wondered.. It's not a real book :) 1. A potential course of events may be…
  10. 1. Vulnerability in the cPickle library in Python 2. Deserialization of Untrusted Data
  11. 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.
  12. 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.
  13. 1. As you’ve seen in the previous slides…
  14. Speak only about identifying the access
  15. 1. This is what an attacker can do if he an over privileged compromised Lambda function.
  16. 1. Let’s talk about over permissive roles …
  17. 1. Do you want to guess how many projects contain iamRolesStatement?
  18. 1. Happy to introduce PureSec’s serverless plugin
  19. 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.