SlideShare a Scribd company logo
1 of 60
Download to read offline
API Security Best Practices and
Guidelines
Thursday, October 22, 2020
Hello!
Omindu Rathnaweera
Thanuja Jayasinghe
Associate Technical Lead
thanuja@wso2.com
omindu@wso2.com
Technical Lead
About ‘API Security and Beyond’ Webinar Series
3
4
600+ Employees
50% Engineering
500+ Customers
Around the world
(129 New in 2019)
Open Source
Flexible Deployment,
Faster Time To Market
Founded in 2005
Backed by Cisco and
Toba Capital
Global Presence
Colombo, New York,
London, Mountain View,
São Paulo, Sydney, Berlin,
Mexico, Italy
20% YOY Growth
$49.9M total ARR
$10.47M ARR from WSO2 Identity
Server (as of March 31, 2020)
5
Addresses full API lifecycle
management operations. Open,
extensible, customizable.
200K+ APIs for 20K+ Orgs
Hybrid integration platform for
quick, iterative integration of any
application, data, or system.
6 Trillion Transactions/yr
Federates and manages identities
across both cloud service and
enterprise environments.
250M+ identities managed
WSO2 API MANAGER WSO2 IDENTITY SERVERWSO2 ENTERPRISE INTEGRATOR
WSO2 Integration Platform
6
WSO2 Identity Server is a strong performer
among the 13 CIAM providers that matter
most according to Forrester Research, Inc..
● Highest scores possible in customer
authentication, self service, business
integration, reporting and dashboarding, and
privacy & consent management in the
Product Offering category
● Highest scores for commercial model in
strategy and authentication plans
WSO2 Identity Server has been recognized as a strong performer
7
Key Capabilities
● Identity federation and SSO
● Identity bridging
● MFA and adaptive authentication
● Managing access to APIs
● Consent management
● Accounts management
● Progressive profiling
● RESTful APIs for integration
● Regulatory compliance
● Identity analytics
WSO2 Identity Server Capabilities
APIs & Security
● A substantial growth in API economy
● Businesses are leaning towards an API-first strategy
● “API traffic amounts to 83% of all web traffic” - Akamai
● APIs are susceptible to attacks now more than ever
The State of APIs
9
APIs will become the
#1 Attack vector by 2022
10
● API access control and privacy, as well as the detection and remediation of
attacks on APIs
● Lack of security may lead to
⦿ Data breaches
⦿ Data manipulation
⦿ Downtime
API Security - What & Why
11
● Who is the intended audience
⦿ Public
⦿ Employees
⦿ Partners
● Who is accessing
⦿ A human user
⦿ A system
● How are the APIs accessed
⦿ Web app
⦿ Mobile app/SPA
API Security - Things to Consider
12
● Trust bootstrap
⦿ Direct
⦿ Brokered
● The data
⦿ Collection
⦿ Exposure
API Security - Things to Consider
13
OWASP API Security Top 10
OWASP API Security Top 10
15
● Focuses on the top 10 most common vulnerabilities in API security
● Attacker substitutes ID of their resource in API call with an ID of a different
user resource. Access will be granted if authorization checks are not in place
1. Broken Object Level Authorization
16
GET /user/1001
GET /user/1002
{
“name” : “Attacker”,
“phone” : 8931883
}
{
“name” : “Another User”,
“phone” : 3433896
}
1. Broken Object Level Authorization
17
● Mitigation
⦿ Set up policies for user specific authorization checks
⦿ Rely on the session object and not the ID sent by the user
⦿ Check authorization when access a data source based on request
⦿ Randomize IDs
2. Broken Authentication
18
● Incorrectly implemented API authentication allowing attackers to assume
other users’ identities.
Authorization: Bearer expired-token
GET /user-profile?user=sam
{
“name” : “Sam”,
“phone” : “8931883”,
“email” : “sam@foo.com”,
}
2. Broken Authentication
19
● Mitigation
⦿ Validate authenticate mechanisms in all APIs
⦿ Use of industry standards and best practices
⦿ Short-lived access tokens
⦿ Client authentication
⦿ Enforce authentication policies
3. Excessive Data Exposure
20
● APIs exposing data which is not needed for clients, expecting the client to do
the filtering. Attacker goes directly to the API and has it all.
GET /user-profile?user=sam
{
“name” : “Sam”,
“phone” : “8931883”,
“salary” : “100000”,
“account-no” : “1286-4499-0275”
}
3. Excessive Data Exposure
21
● Mitigation
⦿ Don’t expect the client to filter data
⦿ Validate all the API responses including errors
⦿ Have a defined schemas for all the API responses
⦿ Be mindful about sensitive or PII information
● API is not geared to handle excessive amount of requests or payload sizes
4. Lack of Resources and Rate Limiting
22
.
.
.
4. Lack of Resources and Rate Limiting
23
● Mitigation
⦿ Limit request rates and payload sizes
⦿ Impose rate limits to API methods, application and users
⦿ Integrate with DDoS protection services
⦿ Impose resource limits on containers
● API expects clients to use user level or admin level APIs. Attacker can figure
out the admin API methods and invokes them directly.
5. Broken Function Level Authorization
24
GET /users/me
GET /admins
{
“name” : “Attacker”,
“phone” : 8931883
}
{
“username” : “admin-user1”,
“email” : “admin1@foo.com”
} . . .
5. Broken Function Level Authorization
25
● Mitigation
⦿ Don’t rely on app to enforce admin access
⦿ Deny by default
⦿ Role based access control
⦿ Have a properly authorization model
● Binding request input to data models, without proper input filtering, can lead to
mass assignment where attackers can modify object they are not supposed to
6. Mass Assignment
26
GET /user-profile?user=sam
{
“name” : “Sam”,
“phone” : “8931883”,
“account-no” : “1286-4499-0275”
}
PUT /user-profile?user=sam
{
“name” : “Sam”,
“phone” : “8931883”,
“account-no” : “1233-4655-0171”
}
200 OK
6. Mass Assignment
27
● Mitigation
⦿ Don’t automatically bind incoming data and internal objects
⦿ Define all the expected parameters and payloads
⦿ Mark read only properties in object schemas
⦿ Define precise requests schemas and validate them at runtime
● Improper configuration of the API servers allows attackers to exploit the
systems
7. Security Misconfigurations
28
Unsecured transport(HTTP)
Poor CORS policy enforcement
Unpatched systems
Verbose error messages
7. Security Misconfigurations
29
● Mitigation
⦿ Continuous hardening and patching processes
⦿ System to locate configuration flaws
⦿ Include only required features
⦿ Restrict root access
● Attacker makes API calls with syntaxes or commands that the API or backend
executee blindly
8. Injection
30
GET /accounts?id=' or '1'='1 "SELECT * FROM accounts
WHERE userId=' or '1'='1";
[ {“name” : “Sam”, “phone” : “78144753”, “credit” : 500000},
{“name” : “Mary”, “phone” : “43211234”, “credit” : 1000}]
8. Injection
31
● Mitigation
⦿ Do not trust the client inputs
⦿ Do proper validation for input data against predefined schemas
⦿ Define, limit, and enforce API outputs to prevent data leaks
● Attacker locates non-production or legacy versions of the API that are not well
protected, and uses to exploit the systems
9. Improper Assets Management
32
DEV
PROD
LEGACY STAGING
9. Improper Assets Management
33
● Mitigation
⦿ Maintain an inventory APIs
⦿ Limit access to anything that should not be public
⦿ Separate production data from others
⦿ Have a proper API deprecation strategy
10. Insufficient Logging and Monitoring
34
● Insufficient logging, monitoring, and alerting lets attackers to further exploit
the systems
Authorization: Basic <sam:pwd1>
GET /users/me
Authorization: Basic <sam:pwd2>
GET /users/me
Authorization: Basic <sam:pwd3>
GET /users/me
10. Insufficient Logging and Monitoring
35
● Mitigation
⦿ Log anomalies in requests
⦿ Protect logs as sensitive information
⦿ Include information that can identify an attackers
⦿ No sensitive data in logs
⦿ Integrate with SIEMs and alerting systems
API Security with OAuth 2.0
One day you went for groceries and you parked your car near the store.
When you get back from the store, you noticed that someone has hit
your car...
At a glance you saw some paint scratches on your car...
So you took your car to the auto repair shop and handed over
the key...
Young Vin Diesel, one of the mechanics who works there saw your car & thought...
Let’s Start with a Story...
37
Perfect Opportunity for an
Ultimate Drift…!!!
38
Valet Key
Valet key concept is to have a special key which allows the driver to perform limited
functionalities under restrictions. So, when the valet key is used,
● Speed is limited
● Storage areas are locked
● Infotainment system is disabled
● Record the trip
39
The Password Anti Pattern
40
Access Delegation with OAuth 2.0
OAuth 2.0 was introduced in 2012 to solve this access delegation problem.
41
RFC6749 - OAuth2 Core
Authorization Code
Implicit
Password
Client Credentials
RFC6750 - Bearer Tokens
Request Header Field
Form-Encoded Body Parameter
URI Query Parameter
Authorization Code Grant Flow
42
User
Web Browser
Web App
Fast Forward to 2020...
43
What Changed in the API World
44
1st Party Apps
SPA
Over the past 8 years, we saw incidents which involve,
● Leakage of client (app) credentials
● Phishing
● Stolen authorization codes / access tokens
● Redirect URI interception
● Signature Verification Bypass
Things were not always perfect...
45
So we did lot to improve the security...
● RFC6749 Section 10
● RFC6819
● RFC8252 Section 8
● Security Best Current Practice - draft
46
Is it the time for OAuth 2.1?
47
Drafted OAuth 2.1
● OAuth 2.1 gets the best of OAuth 2.0(RFC 6749), Bearer Tokens(RFC 6750),
Native Apps (RFC 8252), PKCE (RFC7636), Browser Based Apps BCP(draft)
and Security BCP(draft)
● In Summary,
⦿ PKCE is required for all OAuth clients using the authorization code flow
⦿ Redirect URIs must be compared using exact string matching
⦿ The implicit grant (response_type=token) is omitted from this specification
⦿ The Resource Owner Password Credentials grant is omitted from this specification
⦿ Bearer token usage omits the use of bearer tokens in the query string of URIs
⦿ Refresh tokens for public clients must either be sender-constrained or one-time use
48
It is much simpler now...
49
Authorization Code Grant Flow with PKCE
50
Web App
51
Roles in OAuth
Covered so far...
Now we look at...
Things to Consider for Protecting API Invocations
● Scopes & Resources
● Token Types & Validations
● Security Enforcement Point
52
Scopes & Resources
● Scope is a mechanism in OAuth 2.0 to limit the application's access to a user's
protected resource
● Sometimes scopes are overloaded to convey the location or identity of the
protected resource; however, doing so isn't always feasible or desirable
● Resource Indicators spec (RFC8707) is introduced for the application to
explicitly signal to the authorization server where it intends to redeem the
access token it is requesting
53
Token Types & Validations
● What type of token should be used?
⦿ Reference token
⦿ JWT
● How should we decide the validity period?
⦿ Based on user type
⦿ Based on operation type
● Is refresh token allowed?
54
Security Enforcement Point - API Gateway Pattern
55
Let’s Recap
56
● API security and security considerations
● Common API security vulnerabilities
● API security with OAuth 2.0
● What’s new in OAuth 2.1
● Things to consider when protecting API invocations
Question Time!
57
Next in the Series
58
wso2.com
Thanks!
References
60
● OWASP API Security Top 10 -
https://github.com/OWASP/API-Security/raw/master/2019/en/dist/owasp-api-security-to
p-10.pdf
● The OAuth 2.0 Authorization Framework - https://tools.ietf.org/html/rfc6749
● OAuth 2.0 Device Authorization Grant - https://tools.ietf.org/html/rfc8628
● OAuth 2.0 Threat Model and Security Considerations - https://tools.ietf.org/html/rfc6819
● The OAuth 2.0 Authorization Framework: Bearer Token Usage -
https://tools.ietf.org/html/rfc6750
● OAuth 2.0 Security Best Current Practice -
https://tools.ietf.org/html/draft-ietf-oauth-security-topics-16
● The OAuth 2.1 Authorization Framework -
https://tools.ietf.org/html/draft-ietf-oauth-v2-1-00

More Related Content

What's hot

Frida Android run time hooking - Bhargav Gajera & Vitthal Shinde
Frida  Android run time hooking - Bhargav Gajera & Vitthal ShindeFrida  Android run time hooking - Bhargav Gajera & Vitthal Shinde
Frida Android run time hooking - Bhargav Gajera & Vitthal ShindeNSConclave
 
Kubernetes Secrets Management on Production with Demo
Kubernetes Secrets Management on Production with DemoKubernetes Secrets Management on Production with Demo
Kubernetes Secrets Management on Production with DemoOpsta
 
OWASP API Security Top 10 Examples
OWASP API Security Top 10 ExamplesOWASP API Security Top 10 Examples
OWASP API Security Top 10 Examples42Crunch
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration TestingSubho Halder
 
Overview of the Cyber Kill Chain [TM]
Overview of the Cyber Kill Chain [TM]Overview of the Cyber Kill Chain [TM]
Overview of the Cyber Kill Chain [TM]David Sweigert
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by defaultSecuRing
 
kill-chain-presentation-v3
kill-chain-presentation-v3kill-chain-presentation-v3
kill-chain-presentation-v3Shawn Croswell
 
Threat modelling(system + enterprise)
Threat modelling(system + enterprise)Threat modelling(system + enterprise)
Threat modelling(system + enterprise)abhimanyubhogwan
 
API Security in a Microservice Architecture
API Security in a Microservice ArchitectureAPI Security in a Microservice Architecture
API Security in a Microservice ArchitectureMatt McLarty
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top TenSecurity Innovation
 
Pentesting Android Applications
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android ApplicationsCláudio André
 
Owasp mobile top 10
Owasp mobile top 10Owasp mobile top 10
Owasp mobile top 10Pawel Rzepa
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Moataz Kamel
 
Application Security Architecture and Threat Modelling
Application Security Architecture and Threat ModellingApplication Security Architecture and Threat Modelling
Application Security Architecture and Threat ModellingPriyanka Aash
 
Learn to pen-test with OWASP ZAP
Learn to pen-test with OWASP ZAPLearn to pen-test with OWASP ZAP
Learn to pen-test with OWASP ZAPPaul Ionescu
 

What's hot (20)

Frida Android run time hooking - Bhargav Gajera & Vitthal Shinde
Frida  Android run time hooking - Bhargav Gajera & Vitthal ShindeFrida  Android run time hooking - Bhargav Gajera & Vitthal Shinde
Frida Android run time hooking - Bhargav Gajera & Vitthal Shinde
 
Kubernetes Secrets Management on Production with Demo
Kubernetes Secrets Management on Production with DemoKubernetes Secrets Management on Production with Demo
Kubernetes Secrets Management on Production with Demo
 
OWASP API Security Top 10 Examples
OWASP API Security Top 10 ExamplesOWASP API Security Top 10 Examples
OWASP API Security Top 10 Examples
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration Testing
 
Overview of the Cyber Kill Chain [TM]
Overview of the Cyber Kill Chain [TM]Overview of the Cyber Kill Chain [TM]
Overview of the Cyber Kill Chain [TM]
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 
API Security Fundamentals
API Security FundamentalsAPI Security Fundamentals
API Security Fundamentals
 
API Security Lifecycle
API Security LifecycleAPI Security Lifecycle
API Security Lifecycle
 
Container Security
Container SecurityContainer Security
Container Security
 
kill-chain-presentation-v3
kill-chain-presentation-v3kill-chain-presentation-v3
kill-chain-presentation-v3
 
Threat modelling(system + enterprise)
Threat modelling(system + enterprise)Threat modelling(system + enterprise)
Threat modelling(system + enterprise)
 
API Security in a Microservice Architecture
API Security in a Microservice ArchitectureAPI Security in a Microservice Architecture
API Security in a Microservice Architecture
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top Ten
 
Pentesting Android Applications
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android Applications
 
Owasp mobile top 10
Owasp mobile top 10Owasp mobile top 10
Owasp mobile top 10
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020
 
Application Security Architecture and Threat Modelling
Application Security Architecture and Threat ModellingApplication Security Architecture and Threat Modelling
Application Security Architecture and Threat Modelling
 
IBM Security QRadar
 IBM Security QRadar IBM Security QRadar
IBM Security QRadar
 
Learn to pen-test with OWASP ZAP
Learn to pen-test with OWASP ZAPLearn to pen-test with OWASP ZAP
Learn to pen-test with OWASP ZAP
 

Similar to API Security Best Practices and Guidelines

APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...apidays
 
42Crunch Security Audit for WSO2 API Manager 3.1
42Crunch Security Audit for WSO2 API Manager 3.142Crunch Security Audit for WSO2 API Manager 3.1
42Crunch Security Audit for WSO2 API Manager 3.1WSO2
 
Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)
Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)
Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)DicodingEvent
 
API Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentestersAPI Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentestersInon Shkedy
 
WSO2- OSC Korea - Accelerating Digital Businesses with APIs
WSO2- OSC Korea - Accelerating Digital Businesses with APIsWSO2- OSC Korea - Accelerating Digital Businesses with APIs
WSO2- OSC Korea - Accelerating Digital Businesses with APIsWSO2
 
What API Specifications and Tools Help Engineers to Construct a High-Security...
What API Specifications and Tools Help Engineers to Construct a High-Security...What API Specifications and Tools Help Engineers to Construct a High-Security...
What API Specifications and Tools Help Engineers to Construct a High-Security...Hitachi, Ltd. OSS Solution Center.
 
How to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxHow to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxChanna Ly
 
AWS November meetup Slides
AWS November meetup SlidesAWS November meetup Slides
AWS November meetup SlidesJacksonMorgan9
 
Standard Based API Security, Access Control and AI Based Attack - API Days Pa...
Standard Based API Security, Access Control and AI Based Attack - API Days Pa...Standard Based API Security, Access Control and AI Based Attack - API Days Pa...
Standard Based API Security, Access Control and AI Based Attack - API Days Pa...Ping Identity
 
APIConnect Security Best Practice
APIConnect Security Best PracticeAPIConnect Security Best Practice
APIConnect Security Best PracticeShiu-Fun Poon
 
LF_APIStrat17_OWASP’s Latest Category: API Underprotection
LF_APIStrat17_OWASP’s Latest Category: API UnderprotectionLF_APIStrat17_OWASP’s Latest Category: API Underprotection
LF_APIStrat17_OWASP’s Latest Category: API UnderprotectionLF_APIStrat
 
API, Integration, and SOA Convergence
API, Integration, and SOA ConvergenceAPI, Integration, and SOA Convergence
API, Integration, and SOA ConvergenceKasun Indrasiri
 
Protecting Microservices APIs with 42Crunch API Firewall
Protecting Microservices APIs with 42Crunch API FirewallProtecting Microservices APIs with 42Crunch API Firewall
Protecting Microservices APIs with 42Crunch API Firewall42Crunch
 
Microservices security - jpmc tech fest 2018
Microservices security - jpmc tech fest 2018Microservices security - jpmc tech fest 2018
Microservices security - jpmc tech fest 2018MOnCloud
 
apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...
apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...
apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...apidays
 
Perth Meetup August 2021
Perth Meetup August 2021Perth Meetup August 2021
Perth Meetup August 2021Michael Price
 
Setting the Foundation for Digital Transformation Through API Management and ...
Setting the Foundation for Digital Transformation Through API Management and ...Setting the Foundation for Digital Transformation Through API Management and ...
Setting the Foundation for Digital Transformation Through API Management and ...WSO2
 

Similar to API Security Best Practices and Guidelines (20)

How To Fix The Most Critical API Security Risks.pdf
How To Fix The Most Critical API Security Risks.pdfHow To Fix The Most Critical API Security Risks.pdf
How To Fix The Most Critical API Security Risks.pdf
 
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
 
42Crunch Security Audit for WSO2 API Manager 3.1
42Crunch Security Audit for WSO2 API Manager 3.142Crunch Security Audit for WSO2 API Manager 3.1
42Crunch Security Audit for WSO2 API Manager 3.1
 
Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)
Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)
Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)
 
API Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentestersAPI Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentesters
 
WSO2- OSC Korea - Accelerating Digital Businesses with APIs
WSO2- OSC Korea - Accelerating Digital Businesses with APIsWSO2- OSC Korea - Accelerating Digital Businesses with APIs
WSO2- OSC Korea - Accelerating Digital Businesses with APIs
 
What API Specifications and Tools Help Engineers to Construct a High-Security...
What API Specifications and Tools Help Engineers to Construct a High-Security...What API Specifications and Tools Help Engineers to Construct a High-Security...
What API Specifications and Tools Help Engineers to Construct a High-Security...
 
How to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxHow to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptx
 
AWS November meetup Slides
AWS November meetup SlidesAWS November meetup Slides
AWS November meetup Slides
 
AWS User Group November
AWS User Group NovemberAWS User Group November
AWS User Group November
 
Standard Based API Security, Access Control and AI Based Attack - API Days Pa...
Standard Based API Security, Access Control and AI Based Attack - API Days Pa...Standard Based API Security, Access Control and AI Based Attack - API Days Pa...
Standard Based API Security, Access Control and AI Based Attack - API Days Pa...
 
APIConnect Security Best Practice
APIConnect Security Best PracticeAPIConnect Security Best Practice
APIConnect Security Best Practice
 
LF_APIStrat17_OWASP’s Latest Category: API Underprotection
LF_APIStrat17_OWASP’s Latest Category: API UnderprotectionLF_APIStrat17_OWASP’s Latest Category: API Underprotection
LF_APIStrat17_OWASP’s Latest Category: API Underprotection
 
API, Integration, and SOA Convergence
API, Integration, and SOA ConvergenceAPI, Integration, and SOA Convergence
API, Integration, and SOA Convergence
 
Protecting Microservices APIs with 42Crunch API Firewall
Protecting Microservices APIs with 42Crunch API FirewallProtecting Microservices APIs with 42Crunch API Firewall
Protecting Microservices APIs with 42Crunch API Firewall
 
Microservices security - jpmc tech fest 2018
Microservices security - jpmc tech fest 2018Microservices security - jpmc tech fest 2018
Microservices security - jpmc tech fest 2018
 
apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...
apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...
apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...
 
Perth Meetup August 2021
Perth Meetup August 2021Perth Meetup August 2021
Perth Meetup August 2021
 
Api security-present
Api security-presentApi security-present
Api security-present
 
Setting the Foundation for Digital Transformation Through API Management and ...
Setting the Foundation for Digital Transformation Through API Management and ...Setting the Foundation for Digital Transformation Through API Management and ...
Setting the Foundation for Digital Transformation Through API Management and ...
 

More from WSO2

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in ChoreoWSO2
 
Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023WSO2
 
Platform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzurePlatform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzureWSO2
 
GartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfGartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfWSO2
 
[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in MinutesWSO2
 
Modernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityModernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityWSO2
 
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...WSO2
 
CIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfCIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfWSO2
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoWSO2
 
Fueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsFueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsWSO2
 
A Reference Methodology for Agile Digital Businesses
 A Reference Methodology for Agile Digital Businesses A Reference Methodology for Agile Digital Businesses
A Reference Methodology for Agile Digital BusinessesWSO2
 
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)WSO2
 
Lessons from the pandemic - From a single use case to true transformation
 Lessons from the pandemic - From a single use case to true transformation Lessons from the pandemic - From a single use case to true transformation
Lessons from the pandemic - From a single use case to true transformationWSO2
 
Adding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesAdding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesWSO2
 
Building a Future-ready Bank
Building a Future-ready BankBuilding a Future-ready Bank
Building a Future-ready BankWSO2
 
WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2
 
[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIsWSO2
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native DeploymentWSO2
 
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”WSO2
 

More from WSO2 (20)

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in Choreo
 
Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023
 
Platform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzurePlatform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on Azure
 
GartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfGartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdf
 
[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes
 
Modernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityModernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos Identity
 
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
 
CIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfCIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdf
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing Choreo
 
Fueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsFueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected Products
 
A Reference Methodology for Agile Digital Businesses
 A Reference Methodology for Agile Digital Businesses A Reference Methodology for Agile Digital Businesses
A Reference Methodology for Agile Digital Businesses
 
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
 
Lessons from the pandemic - From a single use case to true transformation
 Lessons from the pandemic - From a single use case to true transformation Lessons from the pandemic - From a single use case to true transformation
Lessons from the pandemic - From a single use case to true transformation
 
Adding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesAdding Liveliness to Banking Experiences
Adding Liveliness to Banking Experiences
 
Building a Future-ready Bank
Building a Future-ready BankBuilding a Future-ready Bank
Building a Future-ready Bank
 
WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021
 
[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment
 
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

API Security Best Practices and Guidelines

  • 1. API Security Best Practices and Guidelines Thursday, October 22, 2020
  • 2. Hello! Omindu Rathnaweera Thanuja Jayasinghe Associate Technical Lead thanuja@wso2.com omindu@wso2.com Technical Lead
  • 3. About ‘API Security and Beyond’ Webinar Series 3
  • 4. 4 600+ Employees 50% Engineering 500+ Customers Around the world (129 New in 2019) Open Source Flexible Deployment, Faster Time To Market Founded in 2005 Backed by Cisco and Toba Capital Global Presence Colombo, New York, London, Mountain View, São Paulo, Sydney, Berlin, Mexico, Italy 20% YOY Growth $49.9M total ARR $10.47M ARR from WSO2 Identity Server (as of March 31, 2020)
  • 5. 5 Addresses full API lifecycle management operations. Open, extensible, customizable. 200K+ APIs for 20K+ Orgs Hybrid integration platform for quick, iterative integration of any application, data, or system. 6 Trillion Transactions/yr Federates and manages identities across both cloud service and enterprise environments. 250M+ identities managed WSO2 API MANAGER WSO2 IDENTITY SERVERWSO2 ENTERPRISE INTEGRATOR WSO2 Integration Platform
  • 6. 6 WSO2 Identity Server is a strong performer among the 13 CIAM providers that matter most according to Forrester Research, Inc.. ● Highest scores possible in customer authentication, self service, business integration, reporting and dashboarding, and privacy & consent management in the Product Offering category ● Highest scores for commercial model in strategy and authentication plans WSO2 Identity Server has been recognized as a strong performer
  • 7. 7 Key Capabilities ● Identity federation and SSO ● Identity bridging ● MFA and adaptive authentication ● Managing access to APIs ● Consent management ● Accounts management ● Progressive profiling ● RESTful APIs for integration ● Regulatory compliance ● Identity analytics WSO2 Identity Server Capabilities
  • 9. ● A substantial growth in API economy ● Businesses are leaning towards an API-first strategy ● “API traffic amounts to 83% of all web traffic” - Akamai ● APIs are susceptible to attacks now more than ever The State of APIs 9
  • 10. APIs will become the #1 Attack vector by 2022 10
  • 11. ● API access control and privacy, as well as the detection and remediation of attacks on APIs ● Lack of security may lead to ⦿ Data breaches ⦿ Data manipulation ⦿ Downtime API Security - What & Why 11
  • 12. ● Who is the intended audience ⦿ Public ⦿ Employees ⦿ Partners ● Who is accessing ⦿ A human user ⦿ A system ● How are the APIs accessed ⦿ Web app ⦿ Mobile app/SPA API Security - Things to Consider 12
  • 13. ● Trust bootstrap ⦿ Direct ⦿ Brokered ● The data ⦿ Collection ⦿ Exposure API Security - Things to Consider 13
  • 15. OWASP API Security Top 10 15 ● Focuses on the top 10 most common vulnerabilities in API security
  • 16. ● Attacker substitutes ID of their resource in API call with an ID of a different user resource. Access will be granted if authorization checks are not in place 1. Broken Object Level Authorization 16 GET /user/1001 GET /user/1002 { “name” : “Attacker”, “phone” : 8931883 } { “name” : “Another User”, “phone” : 3433896 }
  • 17. 1. Broken Object Level Authorization 17 ● Mitigation ⦿ Set up policies for user specific authorization checks ⦿ Rely on the session object and not the ID sent by the user ⦿ Check authorization when access a data source based on request ⦿ Randomize IDs
  • 18. 2. Broken Authentication 18 ● Incorrectly implemented API authentication allowing attackers to assume other users’ identities. Authorization: Bearer expired-token GET /user-profile?user=sam { “name” : “Sam”, “phone” : “8931883”, “email” : “sam@foo.com”, }
  • 19. 2. Broken Authentication 19 ● Mitigation ⦿ Validate authenticate mechanisms in all APIs ⦿ Use of industry standards and best practices ⦿ Short-lived access tokens ⦿ Client authentication ⦿ Enforce authentication policies
  • 20. 3. Excessive Data Exposure 20 ● APIs exposing data which is not needed for clients, expecting the client to do the filtering. Attacker goes directly to the API and has it all. GET /user-profile?user=sam { “name” : “Sam”, “phone” : “8931883”, “salary” : “100000”, “account-no” : “1286-4499-0275” }
  • 21. 3. Excessive Data Exposure 21 ● Mitigation ⦿ Don’t expect the client to filter data ⦿ Validate all the API responses including errors ⦿ Have a defined schemas for all the API responses ⦿ Be mindful about sensitive or PII information
  • 22. ● API is not geared to handle excessive amount of requests or payload sizes 4. Lack of Resources and Rate Limiting 22 . . .
  • 23. 4. Lack of Resources and Rate Limiting 23 ● Mitigation ⦿ Limit request rates and payload sizes ⦿ Impose rate limits to API methods, application and users ⦿ Integrate with DDoS protection services ⦿ Impose resource limits on containers
  • 24. ● API expects clients to use user level or admin level APIs. Attacker can figure out the admin API methods and invokes them directly. 5. Broken Function Level Authorization 24 GET /users/me GET /admins { “name” : “Attacker”, “phone” : 8931883 } { “username” : “admin-user1”, “email” : “admin1@foo.com” } . . .
  • 25. 5. Broken Function Level Authorization 25 ● Mitigation ⦿ Don’t rely on app to enforce admin access ⦿ Deny by default ⦿ Role based access control ⦿ Have a properly authorization model
  • 26. ● Binding request input to data models, without proper input filtering, can lead to mass assignment where attackers can modify object they are not supposed to 6. Mass Assignment 26 GET /user-profile?user=sam { “name” : “Sam”, “phone” : “8931883”, “account-no” : “1286-4499-0275” } PUT /user-profile?user=sam { “name” : “Sam”, “phone” : “8931883”, “account-no” : “1233-4655-0171” } 200 OK
  • 27. 6. Mass Assignment 27 ● Mitigation ⦿ Don’t automatically bind incoming data and internal objects ⦿ Define all the expected parameters and payloads ⦿ Mark read only properties in object schemas ⦿ Define precise requests schemas and validate them at runtime
  • 28. ● Improper configuration of the API servers allows attackers to exploit the systems 7. Security Misconfigurations 28 Unsecured transport(HTTP) Poor CORS policy enforcement Unpatched systems Verbose error messages
  • 29. 7. Security Misconfigurations 29 ● Mitigation ⦿ Continuous hardening and patching processes ⦿ System to locate configuration flaws ⦿ Include only required features ⦿ Restrict root access
  • 30. ● Attacker makes API calls with syntaxes or commands that the API or backend executee blindly 8. Injection 30 GET /accounts?id=' or '1'='1 "SELECT * FROM accounts WHERE userId=' or '1'='1"; [ {“name” : “Sam”, “phone” : “78144753”, “credit” : 500000}, {“name” : “Mary”, “phone” : “43211234”, “credit” : 1000}]
  • 31. 8. Injection 31 ● Mitigation ⦿ Do not trust the client inputs ⦿ Do proper validation for input data against predefined schemas ⦿ Define, limit, and enforce API outputs to prevent data leaks
  • 32. ● Attacker locates non-production or legacy versions of the API that are not well protected, and uses to exploit the systems 9. Improper Assets Management 32 DEV PROD LEGACY STAGING
  • 33. 9. Improper Assets Management 33 ● Mitigation ⦿ Maintain an inventory APIs ⦿ Limit access to anything that should not be public ⦿ Separate production data from others ⦿ Have a proper API deprecation strategy
  • 34. 10. Insufficient Logging and Monitoring 34 ● Insufficient logging, monitoring, and alerting lets attackers to further exploit the systems Authorization: Basic <sam:pwd1> GET /users/me Authorization: Basic <sam:pwd2> GET /users/me Authorization: Basic <sam:pwd3> GET /users/me
  • 35. 10. Insufficient Logging and Monitoring 35 ● Mitigation ⦿ Log anomalies in requests ⦿ Protect logs as sensitive information ⦿ Include information that can identify an attackers ⦿ No sensitive data in logs ⦿ Integrate with SIEMs and alerting systems
  • 36. API Security with OAuth 2.0
  • 37. One day you went for groceries and you parked your car near the store. When you get back from the store, you noticed that someone has hit your car... At a glance you saw some paint scratches on your car... So you took your car to the auto repair shop and handed over the key... Young Vin Diesel, one of the mechanics who works there saw your car & thought... Let’s Start with a Story... 37
  • 38. Perfect Opportunity for an Ultimate Drift…!!! 38
  • 39. Valet Key Valet key concept is to have a special key which allows the driver to perform limited functionalities under restrictions. So, when the valet key is used, ● Speed is limited ● Storage areas are locked ● Infotainment system is disabled ● Record the trip 39
  • 40. The Password Anti Pattern 40
  • 41. Access Delegation with OAuth 2.0 OAuth 2.0 was introduced in 2012 to solve this access delegation problem. 41 RFC6749 - OAuth2 Core Authorization Code Implicit Password Client Credentials RFC6750 - Bearer Tokens Request Header Field Form-Encoded Body Parameter URI Query Parameter
  • 42. Authorization Code Grant Flow 42 User Web Browser Web App
  • 43. Fast Forward to 2020... 43
  • 44. What Changed in the API World 44 1st Party Apps SPA
  • 45. Over the past 8 years, we saw incidents which involve, ● Leakage of client (app) credentials ● Phishing ● Stolen authorization codes / access tokens ● Redirect URI interception ● Signature Verification Bypass Things were not always perfect... 45
  • 46. So we did lot to improve the security... ● RFC6749 Section 10 ● RFC6819 ● RFC8252 Section 8 ● Security Best Current Practice - draft 46
  • 47. Is it the time for OAuth 2.1? 47
  • 48. Drafted OAuth 2.1 ● OAuth 2.1 gets the best of OAuth 2.0(RFC 6749), Bearer Tokens(RFC 6750), Native Apps (RFC 8252), PKCE (RFC7636), Browser Based Apps BCP(draft) and Security BCP(draft) ● In Summary, ⦿ PKCE is required for all OAuth clients using the authorization code flow ⦿ Redirect URIs must be compared using exact string matching ⦿ The implicit grant (response_type=token) is omitted from this specification ⦿ The Resource Owner Password Credentials grant is omitted from this specification ⦿ Bearer token usage omits the use of bearer tokens in the query string of URIs ⦿ Refresh tokens for public clients must either be sender-constrained or one-time use 48
  • 49. It is much simpler now... 49
  • 50. Authorization Code Grant Flow with PKCE 50 Web App
  • 51. 51 Roles in OAuth Covered so far... Now we look at...
  • 52. Things to Consider for Protecting API Invocations ● Scopes & Resources ● Token Types & Validations ● Security Enforcement Point 52
  • 53. Scopes & Resources ● Scope is a mechanism in OAuth 2.0 to limit the application's access to a user's protected resource ● Sometimes scopes are overloaded to convey the location or identity of the protected resource; however, doing so isn't always feasible or desirable ● Resource Indicators spec (RFC8707) is introduced for the application to explicitly signal to the authorization server where it intends to redeem the access token it is requesting 53
  • 54. Token Types & Validations ● What type of token should be used? ⦿ Reference token ⦿ JWT ● How should we decide the validity period? ⦿ Based on user type ⦿ Based on operation type ● Is refresh token allowed? 54
  • 55. Security Enforcement Point - API Gateway Pattern 55
  • 56. Let’s Recap 56 ● API security and security considerations ● Common API security vulnerabilities ● API security with OAuth 2.0 ● What’s new in OAuth 2.1 ● Things to consider when protecting API invocations
  • 58. Next in the Series 58
  • 60. References 60 ● OWASP API Security Top 10 - https://github.com/OWASP/API-Security/raw/master/2019/en/dist/owasp-api-security-to p-10.pdf ● The OAuth 2.0 Authorization Framework - https://tools.ietf.org/html/rfc6749 ● OAuth 2.0 Device Authorization Grant - https://tools.ietf.org/html/rfc8628 ● OAuth 2.0 Threat Model and Security Considerations - https://tools.ietf.org/html/rfc6819 ● The OAuth 2.0 Authorization Framework: Bearer Token Usage - https://tools.ietf.org/html/rfc6750 ● OAuth 2.0 Security Best Current Practice - https://tools.ietf.org/html/draft-ietf-oauth-security-topics-16 ● The OAuth 2.1 Authorization Framework - https://tools.ietf.org/html/draft-ietf-oauth-v2-1-00