SlideShare uma empresa Scribd logo
1 de 42
©2016 Apigee Corp. All Rights Reserved.
Securing APIs the Right Way
Nandan Sridhar
©2016 Apigee Corp. All Rights Reserved.
The views expressed in this presentation are those of
the presenter, and not necessarily those of Apigee
Corporation.
2
©2016 Apigee Corp. All Rights Reserved.
All security presentations begin with some
scary stories…
3
©2016 Apigee Corp. All Rights Reserved.
Snapchat
4
• No rate limit on request to get friends by phone
number
• Hard-coded encryption key
• Weak cipher
• http://gibsonsec.org/snapchat/
©2016 Apigee Corp. All Rights Reserved.
Nissan Leaf
5
• http://www.troyhunt.com/2016/02/controlling-vehicle-features-of-nissan.html
• No authentication on some APIs
– Climate control, battery status
– Only VIN number required
• User ID leaked by some of those APIs
©2016 Apigee Corp. All Rights Reserved.
Some API Security Breaches
6©2016 Apigee Corp. All rights reserved.
Breach Reason Source
Buffer Compromised third-party admin password; OAuth
secret in GitHub
ProgrammableWeb
Multiple Kardashian
Apps
No authentication or authorization Wired
MoonPig No authentication or authorization www.ifc0nfig.com
Facebook Graph API Users can delete other users’ photos; Improper
authorization check
ProgrammableWeb
IRS GetTranscript
Application
Password reset mechanism relied on personal data IRS
Tesla Model S Six-character password that’s easily guessable Security Affairs,
Elsewhere
©2016 Apigee Corp. All Rights Reserved.
…they don’t necessarily apply to you.
7
©2016 Apigee Corp. All Rights Reserved.
Enterprises & API Security
• Large enterprises start with API Security in one of two ways:
– They have an existing web architecture (web servers, cookie based, etc.). Build on
top of it; build something that works with existing security
– “Wikitecture”: They start with Wikipedia, look at the latest trends, specs in the
space. Most settle on OAuth.
8
Neither approach is entirely wrong!
©2016 Apigee Corp. All Rights Reserved.
Use Cases
Broadly speaking we can classify (for the purposes of security) APIs into two
categories:
• Internal APIs
– Application-to-application communication
– Traffic never leaves your data center
• External APIs
– Any internet facing API
9
©2016 Apigee Corp. All Rights Reserved.
Layers
Security will always require multiple layers, all working in
conjunction to provide sufficient security. We will focus on the
security that can be implemented in the API Management
Layer (the API Gateway)
10
©2016 Apigee Corp. All Rights Reserved.
Security is embedded into Apigee API Management
11
Back-end
RBAC management
IDM Integration
Global Policies
User Provisioning
AD / LDAP
Groups
Quota/Spike Arrest
SQL threat protection
JSON bomb protection
IP based restrictions
Bot Detection
Data
Privacy
Two way TLS
API key
OAuth2
Threat Protection
Identity Mgmt & Governance
Manageme
nt Server
Portal Analytics
API
MANAGEMENT
Data Privacy
Two-way TLS
Southbound VPN
IP Access Control
Logging & Auditing
Data Privacy
Org Boundaries
Encryption
SOC 2, PCI-DSS,
HIPAA
Access Control
OAuth2
API Key Verification
IP Access Control
Logging & Auditing
Apps
©2016 Apigee Corp. All Rights Reserved.
Let’s get basics right first
• Don’t underestimate the value of mutual TLS
• IP Whitelist/Blacklist
• Analytics & Logging
• Validate messages (at least in the test environments)
– JSON/XML Schemas
– Open API Specs
• Pass context around, use a standard
– JWT (RFC 7519)
– JWT can be signed (JWS) or encrypted (JWE)
– Great support for libraries (JavaScript,
Java, .Net etc.)
12
©2016 Apigee Corp. All Rights Reserved.
External APIs need more care
13
©2016 Apigee Corp. All Rights Reserved.
Don’t JWTs Fix Everything?
Signed tokens will not work for everyone:
• Tokens cannot be revoked before their expiration time without a central
store of revoked tokens. (However there may be a smaller number of
these)
• JWT based signed tokens are very large - sometimes larger than the
API payload
• Custom attributes must go in the token (making it larger)
• Sometimes people have many scopes
• What if some custom attributes are very sensitive and should not be
there at all, even if encrypted?
14
©2016 Apigee Corp. All Rights Reserved.
OAuth 2.0 – most popular; a good place to start
• Application Authorization is a fundamental part of API
security
– Best way to stop runaway applications
– Only options for certain types of apps (anonymous
API access)
– Requirement for all forms of OAuth
• Best practices
– Use different credentials for each version of each
app
– Makes it easier to pull a bad version
– Hide the app credentials as best you can
– Realize that they still can be stolen
– Have an approval process for apps
15
©2016 Apigee Corp. All Rights Reserved.
Prevent Excessive Traffic
• Protect APIs that are vulnerable to brute force
– Validating password
– Validating anything
– Anything where the only ID is in a small space
• Protect from runaway applications
– Denial of service is also an attack
– Excessive usage may mean data is being harvested
– Not always an attack – developers make mistakes
16
/api
Good Guys Backend Systems
Allow
©2016 Apigee Corp. All Rights Reserved.
Prevent Content Attacks
• Accepting JSON over the Internet?
– Excessive identifier length
– Excessive nesting
– Large arrays and elements
• Accepting XML over the Internet?
– All that and more
• Are you sure there can’t be SQL injection?
– Regular expression checks
17
©2016 Apigee Corp. All Rights Reserved.
Watch for trouble
• Monitor the API
– Usage patterns, anomalies
– Usage patterns by application
– Latency
– Error rate
• Monitor the world too
– Unusual tweets?
– Other social media?
18
©2016 Apigee Corp. All Rights Reserved.
Governance
©2016 Apigee Corp. All Rights Reserved. 19
©2016 Apigee Corp. All Rights Reserved.
Flow Hook Location Description
Pre-proxy Flow Hook BEFORE a proxy
endpoint executes
Pre-target Flow Hook BEFORE a target
endpoint executes
Post-target Flow Hook AFTER the target
response executes
Post-proxy Flow Hook AFTER the proxy
endpoint and right
before the response is
sent out to the client
Security is not voluntary!
20
With a flow hook, you attach a shared flow
so that it executes at the same place for all
API proxies deployed to a specific
environment
©2016 Apigee Corp. All Rights Reserved. 21
LIVE
DEMO
©2016 Apigee Corp. All Rights Reserved.
Multi-Dimensional Threat Protection
©2016 Apigee Corp. All Rights Reserved. 22
©2016 Apigee Corp. All Rights Reserved.
BOT Detection
©2016 Apigee Corp. All Rights Reserved. 23
©2016 Apigee Corp. All Rights Reserved. 24
Multi-Dimensional Threat Protection
/api
BOTs
Backend Systems
Block
©2016 Apigee Corp. All Rights Reserved.
API threats faced by customers today
• Threats are Adaptive – Blend with human behavior
• Bots can probe for API security weakness
• Competitors can scrape your price data
• Bots can be programmed for Bruteforce attacks (DDoS)
• Bots can abuse guest accounts
• Bot traffic skews analytics and KPIs
• Bots create performance overhead on Web Operations
• Bots can use your API keys to access private APIs
25
©2016 Apigee Corp. All Rights Reserved.
What is Apigee Sense?
• An adaptive API security product to
prevent sophisticated bot attacks
• Detects threat patterns at the API
layer, including bot attacks
• Enables you to take actions on bots
you find
26
©2016 Apigee Corp. All Rights Reserved.
Apigee Sense: Adaptive Threat Protection
• Deep Data Analysis
– Dashboard for learning/reporting
– Threat Alerts (Periodic summary
reports)
• Mitigation Actions
– Block, Tag, Limit, Divert
27
©2016 Apigee Corp. All Rights Reserved.
Closed Loop Protection – Analyze, Detect, Protect
29
API
clients
Target
Services
AP
I
Dashboard
Machine
Learning
Models and
Rules
Action
(Block/Throttle/Alert)
Blacklist
Your Traffic
System-wide
Purchased
©2016 Apigee Corp. All Rights Reserved. 30
LIVE
DEMO
©2016 Apigee Corp. All Rights Reserved.
Proof of Work
©2016 Apigee Corp. All Rights Reserved. 31
©2016 Apigee Corp. All Rights Reserved. 32
Multi-Dimensional Threat Protection
/api
Spammers Backend Systems
Proof of Work
§
Throttle
©2016 Apigee Corp. All Rights Reserved.
What is Proof of work?
• A Proof of Work algorithm is an algorithm that takes a lot of computational power to
generate, and provides a quick way to ensure that the work was actually done
• BitCoin (blockchain process) uses an algorithm called “HashCash”. The effort in
HashCash isn’t always constant effort
• Merkle Trees is An (Almost) Constant-Effort Solution-Verification Proof-of-Work
Protocol
• This makes it computationally expensive for unwanted traffic (such as bot attacks) to
hit the API while ensuring that there is minimal impact on legitimate API clients
33
©2016 Apigee Corp. All Rights Reserved. 34
LIVE
DEMO
©2016 Apigee Corp. All Rights Reserved.
Combine Proof of Work with Apigee Sense
35
©2016 Apigee Corp. All Rights Reserved.
Extend OAuth
©2016 Apigee Corp. All Rights Reserved. 36
©2016 Apigee Corp. All Rights Reserved.
Sometimes OAuth 2.0 isn’t good enough…
37
©2016 Apigee Corp. All Rights Reserved.
• Provides strong client authentication
• This specification enables OAuth 2.0
implementations to apply Token Binding
to Access Tokens and Refresh Tokens.
• This cryptographically binds these
tokens to the TLS connections over
which they are intended to be used
• This use of Token Binding protects these
tokens from man-in-the-middle and
token export and replay attacks
OAuth 2.0 Token Binding
38
Browser/
Client
Apigee
Edge
GET /api HTTP/1.1
Host: apigee.com
Sec-Token-Binding: {nonce}signed
©2016 Apigee Corp. All Rights Reserved. 39
LIVE
DEMO
©2016 Apigee Corp. All Rights Reserved.
• This specification defines how to declare
in a JSON Web Token (JWT) that the
presenter of the JWT possesses a
particular proof-of-possession key and
that the recipient can cryptographically
confirm proof-of-possession of the key
by the presenter.
• Being able to prove possession of a key
is also sometimes described as the
presenter being a holder-of-key
Proof of Key for JWT
40
Browser/
Client
Relying
Party
GET /? {id=bob&key=K2} HTTP/1.1
Host: rp.com
Sec-Token-Binding: {nonce}signed
302 Found
Location: rp.com?{id=bob&key=K2}
Identity
Provider
Browser/
Client
Relying
Party
GET /issue-token HTTP/1.1
Host: idp.com
Sec-Token-Binding: {nonce}signed K1 &
{nonce}signed K2
Identity
Provider
TLS
THANK YOU
APPENDIX
©2016 Apigee Corp. All Rights Reserved.
Icon Library
43

Mais conteúdo relacionado

Mais procurados

Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...
Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...
Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...
Apigee | Google Cloud
 

Mais procurados (20)

Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...
Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...
Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...
 
Adapt or Die Sydney - 5 Things Developers Should Know About Serverless
Adapt or Die Sydney - 5 Things Developers Should Know About ServerlessAdapt or Die Sydney - 5 Things Developers Should Know About Serverless
Adapt or Die Sydney - 5 Things Developers Should Know About Serverless
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management Market
 
Apigee Edge Product Demo
Apigee Edge Product DemoApigee Edge Product Demo
Apigee Edge Product Demo
 
Adapt or Die DevJam: San Francisco, Sept 27 2016
Adapt or Die DevJam: San Francisco, Sept 27 2016Adapt or Die DevJam: San Francisco, Sept 27 2016
Adapt or Die DevJam: San Francisco, Sept 27 2016
 
Apigee Edge: Intro to Microgateway
Apigee Edge: Intro to MicrogatewayApigee Edge: Intro to Microgateway
Apigee Edge: Intro to Microgateway
 
Pitney Bowes at a glance
Pitney Bowes at a glancePitney Bowes at a glance
Pitney Bowes at a glance
 
Apigee Edge Overview and Roadmap
Apigee Edge Overview and RoadmapApigee Edge Overview and Roadmap
Apigee Edge Overview and Roadmap
 
London adapt or-die opening keynote chet kapoor
London adapt or-die opening keynote chet kapoorLondon adapt or-die opening keynote chet kapoor
London adapt or-die opening keynote chet kapoor
 
2019 devoxx - apis, microservices, et le service mesh
2019 devoxx - apis, microservices, et le service mesh2019 devoxx - apis, microservices, et le service mesh
2019 devoxx - apis, microservices, et le service mesh
 
Modernize Service-Oriented Architecture with APIs
Modernize Service-Oriented Architecture with APIsModernize Service-Oriented Architecture with APIs
Modernize Service-Oriented Architecture with APIs
 
We Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge ArchitectureWe Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge Architecture
 
Apigee Products Overview
Apigee Products OverviewApigee Products Overview
Apigee Products Overview
 
Digital Transformation: How leaders meet modern customer expectations
Digital Transformation: How leaders meet modern customer expectationsDigital Transformation: How leaders meet modern customer expectations
Digital Transformation: How leaders meet modern customer expectations
 
Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs
 
Managing Sensitive Information in an API and Microservices World
Managing Sensitive Information in an API and Microservices WorldManaging Sensitive Information in an API and Microservices World
Managing Sensitive Information in an API and Microservices World
 
How to Manage Microservices and APIs with Apigee and Istio
How to Manage Microservices and APIs with Apigee and IstioHow to Manage Microservices and APIs with Apigee and Istio
How to Manage Microservices and APIs with Apigee and Istio
 
I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform
I Love APIs 2015: Implementing an API Tier to Enable a New Mobile PlatformI Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform
I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform
 
What is APIGEE? What are the benefits of APIGEE?
What is APIGEE? What are the benefits of APIGEE?What is APIGEE? What are the benefits of APIGEE?
What is APIGEE? What are the benefits of APIGEE?
 
API Management and Kubernetes
API Management and KubernetesAPI Management and Kubernetes
API Management and Kubernetes
 

Destaque

Destaque (16)

London Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD StoryLondon Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet Kapoor
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg Brail
 
London Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynoteLondon Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynote
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant Jhingran
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!
 
London Adapt or Die: Opening Keynote with Chet Kapoor
London Adapt or Die: Opening Keynote with Chet KapoorLondon Adapt or Die: Opening Keynote with Chet Kapoor
London Adapt or Die: Opening Keynote with Chet Kapoor
 
API Governance in the Enterprise
API Governance in the EnterpriseAPI Governance in the Enterprise
API Governance in the Enterprise
 
Adapt or Die: A Microservices Story at Google
Adapt or Die: A Microservices Story at GoogleAdapt or Die: A Microservices Story at Google
Adapt or Die: A Microservices Story at Google
 
Adapt or Die: Serverless Microservices
Adapt or Die: Serverless MicroservicesAdapt or Die: Serverless Microservices
Adapt or Die: Serverless Microservices
 
Cloud Deployments Done Right: Why APIs are Key
Cloud Deployments Done Right: Why APIs are KeyCloud Deployments Done Right: Why APIs are Key
Cloud Deployments Done Right: Why APIs are Key
 
Becoming the Uncarrier: T-Mobile's Digital Journey
Becoming the Uncarrier: T-Mobile's Digital JourneyBecoming the Uncarrier: T-Mobile's Digital Journey
Becoming the Uncarrier: T-Mobile's Digital Journey
 
Platforms, Cloud-Native Architectures, and APIs: Chicago Adapt or Die Keynote
Platforms, Cloud-Native Architectures, and APIs: Chicago Adapt or Die KeynotePlatforms, Cloud-Native Architectures, and APIs: Chicago Adapt or Die Keynote
Platforms, Cloud-Native Architectures, and APIs: Chicago Adapt or Die Keynote
 
L.L.Bean’s API Journey: Digital Commerce Done Right
L.L.Bean’s API Journey: Digital Commerce Done RightL.L.Bean’s API Journey: Digital Commerce Done Right
L.L.Bean’s API Journey: Digital Commerce Done Right
 
Mindbody: A Digital Transformation Story
Mindbody: A Digital Transformation StoryMindbody: A Digital Transformation Story
Mindbody: A Digital Transformation Story
 
Are ESBs Relevant in the Age of Microservices?
Are ESBs Relevant in the Age of Microservices?Are ESBs Relevant in the Age of Microservices?
Are ESBs Relevant in the Age of Microservices?
 

Semelhante a London Adapt or Die: Securing your APIs the Right Way!

Semelhante a London Adapt or Die: Securing your APIs the Right Way! (20)

Getting the most from your API management platform: A case study
Getting the most from your API management platform: A case studyGetting the most from your API management platform: A case study
Getting the most from your API management platform: A case study
 
APIs: The New Security Layer
APIs: The New Security LayerAPIs: The New Security Layer
APIs: The New Security Layer
 
Bringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered BackendsBringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered Backends
 
Top API Security Issues Found During POCs
Top API Security Issues Found During POCsTop API Security Issues Found During POCs
Top API Security Issues Found During POCs
 
API Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIsAPI Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIs
 
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
 
OWASP API Security Top 10 - Austin DevSecOps Days
OWASP API Security Top 10 - Austin DevSecOps DaysOWASP API Security Top 10 - Austin DevSecOps Days
OWASP API Security Top 10 - Austin DevSecOps Days
 
WEBINAR: OWASP API Security Top 10
WEBINAR: OWASP API Security Top 10WEBINAR: OWASP API Security Top 10
WEBINAR: OWASP API Security Top 10
 
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
 
Oracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons LearntOracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons Learnt
 
Enhancing your Security APIs
Enhancing your Security APIsEnhancing your Security APIs
Enhancing your Security APIs
 
OWASP API Security Top 10 Examples
OWASP API Security Top 10 ExamplesOWASP API Security Top 10 Examples
OWASP API Security Top 10 Examples
 
APIs in the Enterprise - Lessons Learned
APIs in the Enterprise - Lessons Learned APIs in the Enterprise - Lessons Learned
APIs in the Enterprise - Lessons Learned
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide
 
API, Integration, and SOA Convergence
API, Integration, and SOA ConvergenceAPI, Integration, and SOA Convergence
API, Integration, and SOA Convergence
 
2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards
 
API SECURITY
API SECURITYAPI SECURITY
API SECURITY
 
What Hackers Don’t Want You To Know: How to Maximize Your API Security
What Hackers Don’t Want You To Know: How to Maximize Your API SecurityWhat Hackers Don’t Want You To Know: How to Maximize Your API Security
What Hackers Don’t Want You To Know: How to Maximize Your API Security
 
Peeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API SecurityPeeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API Security
 
APIsecure 2023 - Discovery is the Starting Point for Defending APIs, Giora En...
APIsecure 2023 - Discovery is the Starting Point for Defending APIs, Giora En...APIsecure 2023 - Discovery is the Starting Point for Defending APIs, Giora En...
APIsecure 2023 - Discovery is the Starting Point for Defending APIs, Giora En...
 

Mais de Apigee | Google Cloud

Mais de Apigee | Google Cloud (7)

How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Ticketmaster at a glance
Ticketmaster at a glanceTicketmaster at a glance
Ticketmaster at a glance
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First World
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
Walgreens at a glance
Walgreens at a glanceWalgreens at a glance
Walgreens at a glance
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

London Adapt or Die: Securing your APIs the Right Way!

  • 1. ©2016 Apigee Corp. All Rights Reserved. Securing APIs the Right Way Nandan Sridhar
  • 2. ©2016 Apigee Corp. All Rights Reserved. The views expressed in this presentation are those of the presenter, and not necessarily those of Apigee Corporation. 2
  • 3. ©2016 Apigee Corp. All Rights Reserved. All security presentations begin with some scary stories… 3
  • 4. ©2016 Apigee Corp. All Rights Reserved. Snapchat 4 • No rate limit on request to get friends by phone number • Hard-coded encryption key • Weak cipher • http://gibsonsec.org/snapchat/
  • 5. ©2016 Apigee Corp. All Rights Reserved. Nissan Leaf 5 • http://www.troyhunt.com/2016/02/controlling-vehicle-features-of-nissan.html • No authentication on some APIs – Climate control, battery status – Only VIN number required • User ID leaked by some of those APIs
  • 6. ©2016 Apigee Corp. All Rights Reserved. Some API Security Breaches 6©2016 Apigee Corp. All rights reserved. Breach Reason Source Buffer Compromised third-party admin password; OAuth secret in GitHub ProgrammableWeb Multiple Kardashian Apps No authentication or authorization Wired MoonPig No authentication or authorization www.ifc0nfig.com Facebook Graph API Users can delete other users’ photos; Improper authorization check ProgrammableWeb IRS GetTranscript Application Password reset mechanism relied on personal data IRS Tesla Model S Six-character password that’s easily guessable Security Affairs, Elsewhere
  • 7. ©2016 Apigee Corp. All Rights Reserved. …they don’t necessarily apply to you. 7
  • 8. ©2016 Apigee Corp. All Rights Reserved. Enterprises & API Security • Large enterprises start with API Security in one of two ways: – They have an existing web architecture (web servers, cookie based, etc.). Build on top of it; build something that works with existing security – “Wikitecture”: They start with Wikipedia, look at the latest trends, specs in the space. Most settle on OAuth. 8 Neither approach is entirely wrong!
  • 9. ©2016 Apigee Corp. All Rights Reserved. Use Cases Broadly speaking we can classify (for the purposes of security) APIs into two categories: • Internal APIs – Application-to-application communication – Traffic never leaves your data center • External APIs – Any internet facing API 9
  • 10. ©2016 Apigee Corp. All Rights Reserved. Layers Security will always require multiple layers, all working in conjunction to provide sufficient security. We will focus on the security that can be implemented in the API Management Layer (the API Gateway) 10
  • 11. ©2016 Apigee Corp. All Rights Reserved. Security is embedded into Apigee API Management 11 Back-end RBAC management IDM Integration Global Policies User Provisioning AD / LDAP Groups Quota/Spike Arrest SQL threat protection JSON bomb protection IP based restrictions Bot Detection Data Privacy Two way TLS API key OAuth2 Threat Protection Identity Mgmt & Governance Manageme nt Server Portal Analytics API MANAGEMENT Data Privacy Two-way TLS Southbound VPN IP Access Control Logging & Auditing Data Privacy Org Boundaries Encryption SOC 2, PCI-DSS, HIPAA Access Control OAuth2 API Key Verification IP Access Control Logging & Auditing Apps
  • 12. ©2016 Apigee Corp. All Rights Reserved. Let’s get basics right first • Don’t underestimate the value of mutual TLS • IP Whitelist/Blacklist • Analytics & Logging • Validate messages (at least in the test environments) – JSON/XML Schemas – Open API Specs • Pass context around, use a standard – JWT (RFC 7519) – JWT can be signed (JWS) or encrypted (JWE) – Great support for libraries (JavaScript, Java, .Net etc.) 12
  • 13. ©2016 Apigee Corp. All Rights Reserved. External APIs need more care 13
  • 14. ©2016 Apigee Corp. All Rights Reserved. Don’t JWTs Fix Everything? Signed tokens will not work for everyone: • Tokens cannot be revoked before their expiration time without a central store of revoked tokens. (However there may be a smaller number of these) • JWT based signed tokens are very large - sometimes larger than the API payload • Custom attributes must go in the token (making it larger) • Sometimes people have many scopes • What if some custom attributes are very sensitive and should not be there at all, even if encrypted? 14
  • 15. ©2016 Apigee Corp. All Rights Reserved. OAuth 2.0 – most popular; a good place to start • Application Authorization is a fundamental part of API security – Best way to stop runaway applications – Only options for certain types of apps (anonymous API access) – Requirement for all forms of OAuth • Best practices – Use different credentials for each version of each app – Makes it easier to pull a bad version – Hide the app credentials as best you can – Realize that they still can be stolen – Have an approval process for apps 15
  • 16. ©2016 Apigee Corp. All Rights Reserved. Prevent Excessive Traffic • Protect APIs that are vulnerable to brute force – Validating password – Validating anything – Anything where the only ID is in a small space • Protect from runaway applications – Denial of service is also an attack – Excessive usage may mean data is being harvested – Not always an attack – developers make mistakes 16 /api Good Guys Backend Systems Allow
  • 17. ©2016 Apigee Corp. All Rights Reserved. Prevent Content Attacks • Accepting JSON over the Internet? – Excessive identifier length – Excessive nesting – Large arrays and elements • Accepting XML over the Internet? – All that and more • Are you sure there can’t be SQL injection? – Regular expression checks 17
  • 18. ©2016 Apigee Corp. All Rights Reserved. Watch for trouble • Monitor the API – Usage patterns, anomalies – Usage patterns by application – Latency – Error rate • Monitor the world too – Unusual tweets? – Other social media? 18
  • 19. ©2016 Apigee Corp. All Rights Reserved. Governance ©2016 Apigee Corp. All Rights Reserved. 19
  • 20. ©2016 Apigee Corp. All Rights Reserved. Flow Hook Location Description Pre-proxy Flow Hook BEFORE a proxy endpoint executes Pre-target Flow Hook BEFORE a target endpoint executes Post-target Flow Hook AFTER the target response executes Post-proxy Flow Hook AFTER the proxy endpoint and right before the response is sent out to the client Security is not voluntary! 20 With a flow hook, you attach a shared flow so that it executes at the same place for all API proxies deployed to a specific environment
  • 21. ©2016 Apigee Corp. All Rights Reserved. 21 LIVE DEMO
  • 22. ©2016 Apigee Corp. All Rights Reserved. Multi-Dimensional Threat Protection ©2016 Apigee Corp. All Rights Reserved. 22
  • 23. ©2016 Apigee Corp. All Rights Reserved. BOT Detection ©2016 Apigee Corp. All Rights Reserved. 23
  • 24. ©2016 Apigee Corp. All Rights Reserved. 24 Multi-Dimensional Threat Protection /api BOTs Backend Systems Block
  • 25. ©2016 Apigee Corp. All Rights Reserved. API threats faced by customers today • Threats are Adaptive – Blend with human behavior • Bots can probe for API security weakness • Competitors can scrape your price data • Bots can be programmed for Bruteforce attacks (DDoS) • Bots can abuse guest accounts • Bot traffic skews analytics and KPIs • Bots create performance overhead on Web Operations • Bots can use your API keys to access private APIs 25
  • 26. ©2016 Apigee Corp. All Rights Reserved. What is Apigee Sense? • An adaptive API security product to prevent sophisticated bot attacks • Detects threat patterns at the API layer, including bot attacks • Enables you to take actions on bots you find 26
  • 27. ©2016 Apigee Corp. All Rights Reserved. Apigee Sense: Adaptive Threat Protection • Deep Data Analysis – Dashboard for learning/reporting – Threat Alerts (Periodic summary reports) • Mitigation Actions – Block, Tag, Limit, Divert 27
  • 28. ©2016 Apigee Corp. All Rights Reserved. Closed Loop Protection – Analyze, Detect, Protect 29 API clients Target Services AP I Dashboard Machine Learning Models and Rules Action (Block/Throttle/Alert) Blacklist Your Traffic System-wide Purchased
  • 29. ©2016 Apigee Corp. All Rights Reserved. 30 LIVE DEMO
  • 30. ©2016 Apigee Corp. All Rights Reserved. Proof of Work ©2016 Apigee Corp. All Rights Reserved. 31
  • 31. ©2016 Apigee Corp. All Rights Reserved. 32 Multi-Dimensional Threat Protection /api Spammers Backend Systems Proof of Work § Throttle
  • 32. ©2016 Apigee Corp. All Rights Reserved. What is Proof of work? • A Proof of Work algorithm is an algorithm that takes a lot of computational power to generate, and provides a quick way to ensure that the work was actually done • BitCoin (blockchain process) uses an algorithm called “HashCash”. The effort in HashCash isn’t always constant effort • Merkle Trees is An (Almost) Constant-Effort Solution-Verification Proof-of-Work Protocol • This makes it computationally expensive for unwanted traffic (such as bot attacks) to hit the API while ensuring that there is minimal impact on legitimate API clients 33
  • 33. ©2016 Apigee Corp. All Rights Reserved. 34 LIVE DEMO
  • 34. ©2016 Apigee Corp. All Rights Reserved. Combine Proof of Work with Apigee Sense 35
  • 35. ©2016 Apigee Corp. All Rights Reserved. Extend OAuth ©2016 Apigee Corp. All Rights Reserved. 36
  • 36. ©2016 Apigee Corp. All Rights Reserved. Sometimes OAuth 2.0 isn’t good enough… 37
  • 37. ©2016 Apigee Corp. All Rights Reserved. • Provides strong client authentication • This specification enables OAuth 2.0 implementations to apply Token Binding to Access Tokens and Refresh Tokens. • This cryptographically binds these tokens to the TLS connections over which they are intended to be used • This use of Token Binding protects these tokens from man-in-the-middle and token export and replay attacks OAuth 2.0 Token Binding 38 Browser/ Client Apigee Edge GET /api HTTP/1.1 Host: apigee.com Sec-Token-Binding: {nonce}signed
  • 38. ©2016 Apigee Corp. All Rights Reserved. 39 LIVE DEMO
  • 39. ©2016 Apigee Corp. All Rights Reserved. • This specification defines how to declare in a JSON Web Token (JWT) that the presenter of the JWT possesses a particular proof-of-possession key and that the recipient can cryptographically confirm proof-of-possession of the key by the presenter. • Being able to prove possession of a key is also sometimes described as the presenter being a holder-of-key Proof of Key for JWT 40 Browser/ Client Relying Party GET /? {id=bob&key=K2} HTTP/1.1 Host: rp.com Sec-Token-Binding: {nonce}signed 302 Found Location: rp.com?{id=bob&key=K2} Identity Provider Browser/ Client Relying Party GET /issue-token HTTP/1.1 Host: idp.com Sec-Token-Binding: {nonce}signed K1 & {nonce}signed K2 Identity Provider TLS
  • 42. ©2016 Apigee Corp. All Rights Reserved. Icon Library 43