SlideShare a Scribd company logo
1 of 25
Addressing Top API Security
Risks
with OAuth
Judith Kahrer
• API1:2023 – Broken Object Level Authorization
• API2:2023 – Broken Authentication
Two with one Scheme
• Incorrect implementation of authentication
• Allows attackers to compromise authentication tokens
• Paves the way for user impersonation
Broken Authentication
• Zero-Trust – authenticate all flows
• Use standards
• Implement multi-factor authentication
• Implement anti-brute-force mechanisms
Prevent Broken Authentication
• OAuth 2.0 is not authentication
• OAuth 2.0 is about delegation
How can OAuth 2.0 help?
Delegated Access
OAuth 2.0 Flow
• Username and Password
• Federated Authentication (OpenID Connect, SAML)
• Passwordless (WebAuthn)
• Multiple Factors (SMS, E-Mail, TOTP…)
Authentication
• Zero-Trust – authenticate all flows
• Use standards
• Implement multi-factor authentication
• Implement anti-brute-force mechanisms
Prevent Broken Authentication
• Zero-Trust – authenticate all flows
 Use standards
 Implement multi-factor authentication
 Implement anti-brute-force mechanisms
Prevent Broken Authentication
OAuth 2.0
• Validity time (exp, nbf)
• Issuer (iss)
• Audience (aud)
• Signature
• Asymmetric, approved algorithms
JWT Validation
const options = {
algorithms: [‘PS256’],
issuer: 'https://login.example.com/’,
audience: 'api.example.com',
};
verifyJwt(accessTokenJwt, tokenVerificationKey,
options);
Simple Code
• Unauthorized access to objects
/orders/{order-id}
Broken Object Level Authorization
• Unauthorized access to objects
• Failures in access control mechanisms
Broken Object Level Authorization
• Unauthorized access to objects
• Failures in access control mechanisms
• Data disclosure, loss, manipulation
• Account takeover
Broken Object Level Authorization
• Use random, unpredictable values for (object) identifiers
• Implement authorization based on policies
• Validate permissions on every request
• Test authorization mechanisms
Prevent Broken Object Level Authorization
• Principle of Least Privilege
• Deny by Default
• Attribute-Based Access Control
Authorization Cheat Sheet
Claims
{
sub: alex,
scope: order_read,
customer_id: 3AQJEYyhCk,
…
}
Claims
{
sub: alex,
scope: order_read,
customer_id: 3AQJEYyhCk,
…
}
GET /orders/tIwRD4BTmr
Claims
{
sub: alex,
scope: order_read,
customer_id: 3AQJEYyhCk,
…
}
GET /orders/tIwRD4BTmr
• Validate permissions on every request
• Implement attribute-based access control
Prevent Broken Object Authorization
• Authenticate all requests
• Validate permissions on every request
• Implement secure authentication
• Implement attribute-based access control
Addressing Top API Security Risks
• Delegate access with access tokens
• API Gateway for coarse grained access control
• Attribute-based access control with Claims
OAuth 2.0 to Mitigate Risks
Addressing Top API Security Risks

More Related Content

Similar to Addressing Top API Security Risks

Web API 2 Token Based Authentication
Web API 2 Token Based AuthenticationWeb API 2 Token Based Authentication
Web API 2 Token Based Authenticationjeremysbrown
 
SharePoint Authentication And Authorization SPTechCon San Francisco
SharePoint Authentication And Authorization SPTechCon San FranciscoSharePoint Authentication And Authorization SPTechCon San Francisco
SharePoint Authentication And Authorization SPTechCon San FranciscoLiam Cleary [MVP]
 
OAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId ConnectOAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId ConnectSaran Doraiswamy
 
Building a secure BFF at Postman
Building a secure BFF at PostmanBuilding a secure BFF at Postman
Building a secure BFF at PostmanAnkit Muchhala
 
Spring security oauth2
Spring security oauth2Spring security oauth2
Spring security oauth2axykim00
 
IBM Spectrum Scale Authentication For Object - Deep Dive
IBM Spectrum Scale Authentication For Object - Deep Dive IBM Spectrum Scale Authentication For Object - Deep Dive
IBM Spectrum Scale Authentication For Object - Deep Dive Smita Raut
 
OAuth [noddyCha]
OAuth [noddyCha]OAuth [noddyCha]
OAuth [noddyCha]noddycha
 
Secure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfSecure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfnanangAris1
 
Adding Identity Management and Access Control to your App
Adding Identity Management and Access Control to your AppAdding Identity Management and Access Control to your App
Adding Identity Management and Access Control to your AppFIWARE
 
Oauth Behind The Scenes
Oauth Behind The Scenes Oauth Behind The Scenes
Oauth Behind The Scenes Thang Tran Duc
 
JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2Rodrigo Cândido da Silva
 
Automated Inference of Access Control Policies for Web Applications
Automated Inference of Access Control Policies for Web ApplicationsAutomated Inference of Access Control Policies for Web Applications
Automated Inference of Access Control Policies for Web ApplicationsLionel Briand
 
Mobile Authentication - Onboarding, best practices & anti-patterns
Mobile Authentication - Onboarding, best practices & anti-patternsMobile Authentication - Onboarding, best practices & anti-patterns
Mobile Authentication - Onboarding, best practices & anti-patternsPieter Ennes
 
Adding identity management and access control to your app
Adding identity management and access control to your appAdding identity management and access control to your app
Adding identity management and access control to your appÁlvaro Alonso González
 
IAM Introduction and Best Practices
IAM Introduction and Best PracticesIAM Introduction and Best Practices
IAM Introduction and Best PracticesAmazon Web Services
 

Similar to Addressing Top API Security Risks (20)

Web API 2 Token Based Authentication
Web API 2 Token Based AuthenticationWeb API 2 Token Based Authentication
Web API 2 Token Based Authentication
 
SharePoint Authentication And Authorization SPTechCon San Francisco
SharePoint Authentication And Authorization SPTechCon San FranciscoSharePoint Authentication And Authorization SPTechCon San Francisco
SharePoint Authentication And Authorization SPTechCon San Francisco
 
Java zone ASVS 2015
Java zone ASVS 2015Java zone ASVS 2015
Java zone ASVS 2015
 
OAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId ConnectOAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId Connect
 
Building a secure BFF at Postman
Building a secure BFF at PostmanBuilding a secure BFF at Postman
Building a secure BFF at Postman
 
Spring security oauth2
Spring security oauth2Spring security oauth2
Spring security oauth2
 
IBM Spectrum Scale Authentication For Object - Deep Dive
IBM Spectrum Scale Authentication For Object - Deep Dive IBM Spectrum Scale Authentication For Object - Deep Dive
IBM Spectrum Scale Authentication For Object - Deep Dive
 
OAuth [noddyCha]
OAuth [noddyCha]OAuth [noddyCha]
OAuth [noddyCha]
 
Secure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfSecure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdf
 
Adding Identity Management and Access Control to your App
Adding Identity Management and Access Control to your AppAdding Identity Management and Access Control to your App
Adding Identity Management and Access Control to your App
 
OAuth2
OAuth2OAuth2
OAuth2
 
SCWCD : Secure web
SCWCD : Secure webSCWCD : Secure web
SCWCD : Secure web
 
SCWCD : Secure web : CHAP : 7
SCWCD : Secure web : CHAP : 7SCWCD : Secure web : CHAP : 7
SCWCD : Secure web : CHAP : 7
 
OAuth2 + API Security
OAuth2 + API SecurityOAuth2 + API Security
OAuth2 + API Security
 
Oauth Behind The Scenes
Oauth Behind The Scenes Oauth Behind The Scenes
Oauth Behind The Scenes
 
JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2
 
Automated Inference of Access Control Policies for Web Applications
Automated Inference of Access Control Policies for Web ApplicationsAutomated Inference of Access Control Policies for Web Applications
Automated Inference of Access Control Policies for Web Applications
 
Mobile Authentication - Onboarding, best practices & anti-patterns
Mobile Authentication - Onboarding, best practices & anti-patternsMobile Authentication - Onboarding, best practices & anti-patterns
Mobile Authentication - Onboarding, best practices & anti-patterns
 
Adding identity management and access control to your app
Adding identity management and access control to your appAdding identity management and access control to your app
Adding identity management and access control to your app
 
IAM Introduction and Best Practices
IAM Introduction and Best PracticesIAM Introduction and Best Practices
IAM Introduction and Best Practices
 

More from Nordic APIs

How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...Nordic APIs
 
The Art of API Design, by David Biesack at Apiture
The Art of API Design, by David Biesack at ApitureThe Art of API Design, by David Biesack at Apiture
The Art of API Design, by David Biesack at ApitureNordic APIs
 
ABAC, ReBAC, Zanzibar, ALFA… How Should I Implement AuthZ in My APIs? by Dav...
ABAC, ReBAC, Zanzibar, ALFA…  How Should I Implement AuthZ in My APIs? by Dav...ABAC, ReBAC, Zanzibar, ALFA…  How Should I Implement AuthZ in My APIs? by Dav...
ABAC, ReBAC, Zanzibar, ALFA… How Should I Implement AuthZ in My APIs? by Dav...Nordic APIs
 
Crafting a Cloud Native API Platform to Accelerate Your Platform Maturity - B...
Crafting a Cloud Native API Platform to Accelerate Your Platform Maturity - B...Crafting a Cloud Native API Platform to Accelerate Your Platform Maturity - B...
Crafting a Cloud Native API Platform to Accelerate Your Platform Maturity - B...Nordic APIs
 
The Federated Future: Pioneering Next-Gen Solutions in API Management - Marku...
The Federated Future: Pioneering Next-Gen Solutions in API Management - Marku...The Federated Future: Pioneering Next-Gen Solutions in API Management - Marku...
The Federated Future: Pioneering Next-Gen Solutions in API Management - Marku...Nordic APIs
 
API Authorization Using an Identity Server and Gateway - Aldo Pietropaolo, SGNL
API Authorization Using an Identity Server and Gateway - Aldo Pietropaolo, SGNLAPI Authorization Using an Identity Server and Gateway - Aldo Pietropaolo, SGNL
API Authorization Using an Identity Server and Gateway - Aldo Pietropaolo, SGNLNordic APIs
 
API Discovery from Crawl to Run - Rob Dickinson, Graylog
API Discovery from Crawl to Run - Rob Dickinson, GraylogAPI Discovery from Crawl to Run - Rob Dickinson, Graylog
API Discovery from Crawl to Run - Rob Dickinson, GraylogNordic APIs
 
Productizing and Monetizing APIs - Derric Gilling, Moseif
Productizing and Monetizing APIs - Derric Gilling, MoseifProductizing and Monetizing APIs - Derric Gilling, Moseif
Productizing and Monetizing APIs - Derric Gilling, MoseifNordic APIs
 
Securely Boosting Any Product with Generative AI APIs - Ruben Sitbon, Sipios
Securely Boosting Any Product with Generative AI APIs - Ruben Sitbon, SipiosSecurely Boosting Any Product with Generative AI APIs - Ruben Sitbon, Sipios
Securely Boosting Any Product with Generative AI APIs - Ruben Sitbon, SipiosNordic APIs
 
Security of LLM APIs by Ankita Gupta, Akto.io
Security of LLM APIs by Ankita Gupta, Akto.ioSecurity of LLM APIs by Ankita Gupta, Akto.io
Security of LLM APIs by Ankita Gupta, Akto.ioNordic APIs
 
I'm an API Hacker, Here's How to Go from Making APIs to Breaking Them - Katie...
I'm an API Hacker, Here's How to Go from Making APIs to Breaking Them - Katie...I'm an API Hacker, Here's How to Go from Making APIs to Breaking Them - Katie...
I'm an API Hacker, Here's How to Go from Making APIs to Breaking Them - Katie...Nordic APIs
 
Unleashing the Potential of GraphQL with Streaming Data - Kishore Banala, Net...
Unleashing the Potential of GraphQL with Streaming Data - Kishore Banala, Net...Unleashing the Potential of GraphQL with Streaming Data - Kishore Banala, Net...
Unleashing the Potential of GraphQL with Streaming Data - Kishore Banala, Net...Nordic APIs
 
Reigniting the API Description Wars with TypeSpec and the Next Generation of ...
Reigniting the API Description Wars with TypeSpec and the Next Generation of...Reigniting the API Description Wars with TypeSpec and the Next Generation of...
Reigniting the API Description Wars with TypeSpec and the Next Generation of ...Nordic APIs
 
Establish, Grow, and Mature Your API Platform - James Higginbotham, LaunchAny
Establish, Grow, and Mature Your API Platform - James Higginbotham, LaunchAnyEstablish, Grow, and Mature Your API Platform - James Higginbotham, LaunchAny
Establish, Grow, and Mature Your API Platform - James Higginbotham, LaunchAnyNordic APIs
 
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations - A...
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations - A...Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations - A...
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations - A...Nordic APIs
 
Going Platinum: How to Make a Hit API by Bill Doerrfeld, Nordic APIs
Going Platinum: How to Make a Hit API by Bill Doerrfeld, Nordic APIsGoing Platinum: How to Make a Hit API by Bill Doerrfeld, Nordic APIs
Going Platinum: How to Make a Hit API by Bill Doerrfeld, Nordic APIsNordic APIs
 
Getting Better at Risk Management Using Event Driven Mesh Architecture - Ragh...
Getting Better at Risk Management Using Event Driven Mesh Architecture - Ragh...Getting Better at Risk Management Using Event Driven Mesh Architecture - Ragh...
Getting Better at Risk Management Using Event Driven Mesh Architecture - Ragh...Nordic APIs
 
GenAI: Producing and Consuming APIs by Paul Dumas, Gartner
GenAI: Producing and Consuming APIs by Paul Dumas, GartnerGenAI: Producing and Consuming APIs by Paul Dumas, Gartner
GenAI: Producing and Consuming APIs by Paul Dumas, GartnerNordic APIs
 
The SAS developer portal – developer.sas.com 2.0: How we built it by Joe Furb...
The SAS developer portal –developer.sas.com 2.0: How we built it by Joe Furb...The SAS developer portal –developer.sas.com 2.0: How we built it by Joe Furb...
The SAS developer portal – developer.sas.com 2.0: How we built it by Joe Furb...Nordic APIs
 
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...Nordic APIs
 

More from Nordic APIs (20)

How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
 
The Art of API Design, by David Biesack at Apiture
The Art of API Design, by David Biesack at ApitureThe Art of API Design, by David Biesack at Apiture
The Art of API Design, by David Biesack at Apiture
 
ABAC, ReBAC, Zanzibar, ALFA… How Should I Implement AuthZ in My APIs? by Dav...
ABAC, ReBAC, Zanzibar, ALFA…  How Should I Implement AuthZ in My APIs? by Dav...ABAC, ReBAC, Zanzibar, ALFA…  How Should I Implement AuthZ in My APIs? by Dav...
ABAC, ReBAC, Zanzibar, ALFA… How Should I Implement AuthZ in My APIs? by Dav...
 
Crafting a Cloud Native API Platform to Accelerate Your Platform Maturity - B...
Crafting a Cloud Native API Platform to Accelerate Your Platform Maturity - B...Crafting a Cloud Native API Platform to Accelerate Your Platform Maturity - B...
Crafting a Cloud Native API Platform to Accelerate Your Platform Maturity - B...
 
The Federated Future: Pioneering Next-Gen Solutions in API Management - Marku...
The Federated Future: Pioneering Next-Gen Solutions in API Management - Marku...The Federated Future: Pioneering Next-Gen Solutions in API Management - Marku...
The Federated Future: Pioneering Next-Gen Solutions in API Management - Marku...
 
API Authorization Using an Identity Server and Gateway - Aldo Pietropaolo, SGNL
API Authorization Using an Identity Server and Gateway - Aldo Pietropaolo, SGNLAPI Authorization Using an Identity Server and Gateway - Aldo Pietropaolo, SGNL
API Authorization Using an Identity Server and Gateway - Aldo Pietropaolo, SGNL
 
API Discovery from Crawl to Run - Rob Dickinson, Graylog
API Discovery from Crawl to Run - Rob Dickinson, GraylogAPI Discovery from Crawl to Run - Rob Dickinson, Graylog
API Discovery from Crawl to Run - Rob Dickinson, Graylog
 
Productizing and Monetizing APIs - Derric Gilling, Moseif
Productizing and Monetizing APIs - Derric Gilling, MoseifProductizing and Monetizing APIs - Derric Gilling, Moseif
Productizing and Monetizing APIs - Derric Gilling, Moseif
 
Securely Boosting Any Product with Generative AI APIs - Ruben Sitbon, Sipios
Securely Boosting Any Product with Generative AI APIs - Ruben Sitbon, SipiosSecurely Boosting Any Product with Generative AI APIs - Ruben Sitbon, Sipios
Securely Boosting Any Product with Generative AI APIs - Ruben Sitbon, Sipios
 
Security of LLM APIs by Ankita Gupta, Akto.io
Security of LLM APIs by Ankita Gupta, Akto.ioSecurity of LLM APIs by Ankita Gupta, Akto.io
Security of LLM APIs by Ankita Gupta, Akto.io
 
I'm an API Hacker, Here's How to Go from Making APIs to Breaking Them - Katie...
I'm an API Hacker, Here's How to Go from Making APIs to Breaking Them - Katie...I'm an API Hacker, Here's How to Go from Making APIs to Breaking Them - Katie...
I'm an API Hacker, Here's How to Go from Making APIs to Breaking Them - Katie...
 
Unleashing the Potential of GraphQL with Streaming Data - Kishore Banala, Net...
Unleashing the Potential of GraphQL with Streaming Data - Kishore Banala, Net...Unleashing the Potential of GraphQL with Streaming Data - Kishore Banala, Net...
Unleashing the Potential of GraphQL with Streaming Data - Kishore Banala, Net...
 
Reigniting the API Description Wars with TypeSpec and the Next Generation of ...
Reigniting the API Description Wars with TypeSpec and the Next Generation of...Reigniting the API Description Wars with TypeSpec and the Next Generation of...
Reigniting the API Description Wars with TypeSpec and the Next Generation of ...
 
Establish, Grow, and Mature Your API Platform - James Higginbotham, LaunchAny
Establish, Grow, and Mature Your API Platform - James Higginbotham, LaunchAnyEstablish, Grow, and Mature Your API Platform - James Higginbotham, LaunchAny
Establish, Grow, and Mature Your API Platform - James Higginbotham, LaunchAny
 
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations - A...
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations - A...Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations - A...
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations - A...
 
Going Platinum: How to Make a Hit API by Bill Doerrfeld, Nordic APIs
Going Platinum: How to Make a Hit API by Bill Doerrfeld, Nordic APIsGoing Platinum: How to Make a Hit API by Bill Doerrfeld, Nordic APIs
Going Platinum: How to Make a Hit API by Bill Doerrfeld, Nordic APIs
 
Getting Better at Risk Management Using Event Driven Mesh Architecture - Ragh...
Getting Better at Risk Management Using Event Driven Mesh Architecture - Ragh...Getting Better at Risk Management Using Event Driven Mesh Architecture - Ragh...
Getting Better at Risk Management Using Event Driven Mesh Architecture - Ragh...
 
GenAI: Producing and Consuming APIs by Paul Dumas, Gartner
GenAI: Producing and Consuming APIs by Paul Dumas, GartnerGenAI: Producing and Consuming APIs by Paul Dumas, Gartner
GenAI: Producing and Consuming APIs by Paul Dumas, Gartner
 
The SAS developer portal – developer.sas.com 2.0: How we built it by Joe Furb...
The SAS developer portal –developer.sas.com 2.0: How we built it by Joe Furb...The SAS developer portal –developer.sas.com 2.0: How we built it by Joe Furb...
The SAS developer portal – developer.sas.com 2.0: How we built it by Joe Furb...
 
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
 

Recently uploaded

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Addressing Top API Security Risks

  • 1. Addressing Top API Security Risks with OAuth Judith Kahrer
  • 2. • API1:2023 – Broken Object Level Authorization • API2:2023 – Broken Authentication Two with one Scheme
  • 3. • Incorrect implementation of authentication • Allows attackers to compromise authentication tokens • Paves the way for user impersonation Broken Authentication
  • 4. • Zero-Trust – authenticate all flows • Use standards • Implement multi-factor authentication • Implement anti-brute-force mechanisms Prevent Broken Authentication
  • 5. • OAuth 2.0 is not authentication • OAuth 2.0 is about delegation How can OAuth 2.0 help?
  • 8. • Username and Password • Federated Authentication (OpenID Connect, SAML) • Passwordless (WebAuthn) • Multiple Factors (SMS, E-Mail, TOTP…) Authentication
  • 9. • Zero-Trust – authenticate all flows • Use standards • Implement multi-factor authentication • Implement anti-brute-force mechanisms Prevent Broken Authentication
  • 10. • Zero-Trust – authenticate all flows  Use standards  Implement multi-factor authentication  Implement anti-brute-force mechanisms Prevent Broken Authentication
  • 12. • Validity time (exp, nbf) • Issuer (iss) • Audience (aud) • Signature • Asymmetric, approved algorithms JWT Validation
  • 13. const options = { algorithms: [‘PS256’], issuer: 'https://login.example.com/’, audience: 'api.example.com', }; verifyJwt(accessTokenJwt, tokenVerificationKey, options); Simple Code
  • 14. • Unauthorized access to objects /orders/{order-id} Broken Object Level Authorization
  • 15. • Unauthorized access to objects • Failures in access control mechanisms Broken Object Level Authorization
  • 16. • Unauthorized access to objects • Failures in access control mechanisms • Data disclosure, loss, manipulation • Account takeover Broken Object Level Authorization
  • 17. • Use random, unpredictable values for (object) identifiers • Implement authorization based on policies • Validate permissions on every request • Test authorization mechanisms Prevent Broken Object Level Authorization
  • 18. • Principle of Least Privilege • Deny by Default • Attribute-Based Access Control Authorization Cheat Sheet
  • 20. Claims { sub: alex, scope: order_read, customer_id: 3AQJEYyhCk, … } GET /orders/tIwRD4BTmr
  • 21. Claims { sub: alex, scope: order_read, customer_id: 3AQJEYyhCk, … } GET /orders/tIwRD4BTmr
  • 22. • Validate permissions on every request • Implement attribute-based access control Prevent Broken Object Authorization
  • 23. • Authenticate all requests • Validate permissions on every request • Implement secure authentication • Implement attribute-based access control Addressing Top API Security Risks
  • 24. • Delegate access with access tokens • API Gateway for coarse grained access control • Attribute-based access control with Claims OAuth 2.0 to Mitigate Risks

Editor's Notes

  1. Hello!  tired after long day => bedtime story: The Brave Little Tailor Tailor kills seven flies with one blow of his hand. Belt reading “SEVEN at ONE BOW” => everybody believes he is talking about killing seven men. Defeats giants, unicorn and boar. Becomes king. Judith Kahrer, Product Marketing Engineer at Curity
  2. Instead of killing seven with one blow, I am settled for addressing two API security risks with one scheme. In this talk, I show how to use OAuth to address the top of the top API Security Risks by OWASP. Number 1: Broken Object Level Authorization, and number two: Broken Authentication.
  3. Broken authentication occurs when authentication is not implemented correctly. Authentication is the process of verifying if somebody is who they claim to be. If you mess up with authentication or session management, you won’t be able to know for sure who is who. You will eventually believe that the tailor is indeed a dangerous man because he looks like one. When you break authentication and an attacker manages to compromise authentication tokens, temporarily or permanently, they can impersonate users. If an attacker manages to take over a high-privileged account, the potential impact is great and damage severe. Attackers may extend their exploit to other parts of the API.
  4. What should you do instead? First of all, do authenticate - always. Authenticate not only at the perimeter but also when communicating with other APIs inside the network. Base your solutions on standards, implement multi-factor authentication and protect the authentication process from brute-force attacks.
  5. How does OAuth fit into the picture? OAuth is a standard but OAuth is not authentication. OAuth is about delegation.  However, delegation is exactly what you want for your APIs. Delegation means, that instead of authenticating and authorizing the user directly, access gets delegated.
  6. Briefly, OAuth works like this: The client - that is the software that interacts with your API - gets a grant from the user.  The client uses this grant to fetch an access token from the authorization server. This access token represents the delegated access from the user to some resources at the API. The client can now use this access token to call APIs.
  7. When looking closer to the implementation of this abstract flow, you can see that the client does not collect the grant from the user directly but instead retrieves it via the authorization server.  So, in practice the story goes like this: The client asks the user “Please seek the authorization server to provide me with the grant”.  The user goes to the authorization server and tells it: “I want you to deliver a message to the client with my grant.”  The authorization server answers: “Sure, but you have to solve this quest first to prove that you are worthy”.  Well, the last part of the story, is artistic freedom. What usually happens is that the authorization server challenges the user to authenticate.
  8. Since the authorization server is a specialised component it can offer all sorts of authentication methods: Username and password, federated protocols like SAML and OpenID, passwordless techniques like WebAuthn and it can combine multiple. It can adapt the authentication process to the context. It can, for example, only enforce multiple factors when it considers it suitable. It can protect authentication with anti-brute force mechanisms like account lockout or cool downs. It can offer secure processes to recover passwords and accounts. In other words, the authorization server can offer secure authentication and account management.
  9. If we now recall how to prevent broken authentication, you may realise that we can check three of them
  10. - three at one blow!  What remains on the list is the requirement to authenticate all requests. And this is where the access token comes in. To simplify things even further for APIs, you can utilize an API gateway to enforce zero-trust.
  11. Before any request hits your API services, the API gateway can ensure that all requests include a valid access token and perform coarse grained access control. The API gateway can also ensure that - no matter the structure of the incoming token - it always serves a JWT to APIs. Then, the only thing your API has to focus on is to validate the access token properly and use it for authorization decisions to avoid Broken Object Level Authorization.
  12. JWT validation includes, checking the validity time of the JWT. Is it issued by a trusted issuer? Is it intended for this API, does it include this API as an audience? Does it have a valid signature? When validating signatures, make sure to define a list of approved algorithms. Do not solely depend on the information provided in the JWTs. JWT header fields are unprotected and an attacker may trick the JWT validation algorithm to accept an invalid signature by manipulating header fields. Therefore, use asymmetric and hardcoded algorithms. What may sound like quite some burden can be implemented with simple code as shown by the following pseudo code example.
  13. Just define the validation options, that is the expected values for common claims like signature algorithm, issuer, audience or scope. Assuming you have the token and signature verification key ready, just call the verification function with the options.  Since OAuth is a standard and since JWTs are the de-facto standard for access tokens, there are plenty of libraries for various programming languages out there that support JWT validation.  After JWT validation, it's time to enforce authorization rules.
  14. Broken Object Level Authorization occurs when users gain unauthorised access to objects. It can be the result of attackers manipulating object IDs that are sent with the request. The object ID may, for example, be part of the URL.
  15. Unauthorized access means that there are failures in access control mechanisms which can lead to data disclosure, data loss, manipulation of data, or, in worst case, result in account take over. Trust me, you want to avoid all of it.
  16. data disclosure, data loss, manipulation of data, or, in worst case, result in account take over. Trust me, you want to avoid all of it.
  17. What should you do to prevent broken object level authorization? OWASP recommends to use random, unpredictable values for object identifiers. Well, this recommendation only makes it harder to guess the value but randomising values doesn’t solve the underlying problem. To actually prevent unauthorised access, define access policies and base authorization implementations on those policies. Validate the permissions on every request - wait! That sounds similar to what we have just heard in regard to authentication. Right. So, you need to authenticate AND authorize with every request. And, you should test the authorization mechanisms for different scenarios. Do not deploy anything that does not pass the tests - but I think that is almost self-evident to point out. While the authorization server takes care of the authentication part, it is the API’s responsibility to validate the access token, the JWT on every request.
  18. Then, after the basic validation you get into the details of the authorization policy. When implementing authorization keep the following cheat sheet in mind: Use the principle of least privilege. Users should only be granted enough permissions for the current context but not more. Deny by default. If you are not sure, be on the safe side and deny access. Implement attribute based access control. For the latter access tokens are a very suitable tool. You can implement attribute based access control with the help of access tokens. 
  19. An access token contains, standard claims like a subject, a scope or audience claim as discussed earlier. But it can also contain custom claims like the customer ID as shown in this example. Since the access token is signed, it is integrity protected, meaning you can trust that the claims in the access token are correct and have not been changed.
  20. Use scopes for coarse grained access control. For example, to access the order API, you can define that the access token needs to include a scope with the value order read or order write. An access token with a scope order read is then accepted for a GET request on the order endpoint but insufficient for other endpoints or APIs, or even for requests using other HTTP verbs than GET on the order endpoint. 
  21. Additional claims like the customer ID can then be used for fine grained access control. For example, you can check if the referred customer has access to the given object. You can look up the customer and you can look up the object. You can check if and how they are related. Is this customer allowed to view the given order? With claims in the access token you can implement attribute based access control and prevent broken object level authorization. And because JWTs are self contained, the solution scales easily.
  22. To prevent broken object level authorization, use OAuth to validate permissions on every request – e.g. perform coarse grained access control at the API Gateway. Implement attribute-based access control with help of the access token.
  23. Once again, how do you mitigate the most critical API security risks? You authenticate and authorize every request. You use secure authentication methods. On a personal note, try to get rid of passwords.  You implement attribute based access control.
  24. What do you need? OAuth! Because with OAuth you can outsource authentication and delegate access using access tokens. You can call an API Gateway for assistance to enforce zero-trust and offload APIs.  You can implement attribute based access control using the claims in access tokens. With OAuth you can mitigate two risks with one blow and open the chamber of opportunities ! Thank you.