SlideShare a Scribd company logo
Secure APIs for
Finance
Lessons from API security successes and failures
Greg Brail
Apigee
May 2016
Agenda
What Happens to Insecure APIs
API Security Fundamentals
Why APIs are less risky
The Result: Effective API Security
No API Security
Bad things happen
I have an API!
©2015 Apigee Corp. All Rights Reserved.
But I Don’t Have an API!
Of Course You Have an API!
6
Wired, 9/22/15
www.ifc0nfig.com, 1/5/15
troyhunt.com, 2/24/16
Everything with a URI has an API
Some API Security Breaches
Breach Reason Source
Buffer Compromised third-party admin password;
OAuth secret in GitHub
ProgrammableWeb
Snapchat No authentication; no rate limit Gibson Security
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
Instagram Malicious app was stealing passwords; no
approval process
Daily Dot
Nissan Leaf VIN number only security credential on API Troy Hunt
Tesla Model S Six-character password that’s easily guessable Security Affairs,
Elsewhere
Nissan Leaf
•  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
•  No rate limit on request to get friends by phone number
•  Hard-coded encryption key
•  Weak cipher
•  http://gibsonsec.org/snapchat/
Snapchat
Mobile Banking Apps
•  Security researcher Ariel Sanchez examined 20 iOS
banking apps from banks around the world
•  More than 30% used non-TLS-encrypted links for
at least part of the app
•  Down from 90% two years ago
•  Demonstrated JavaScript interception of some
apps’ “login” page to gather passwords
10
Ariel Sanchez, blog.ioactive.com
A South Asian Bank
•  Security researcher Sathya Prakash tested the security of the app
he used for one of his bank accounts
•  Found many major flaws and one huge one
•  All validation of account numbers for funds transfers was performed
in the mobile app only – not on the server
11
SWIFT
•  Over $900 million in fraudulent transfer requests due to compromise at a member bank
•  Became $81 million due to a typo
BAE Systems Applied Intelligence
APIs for Finance
Applying security lessons
APIs for Controlled
Access
•  APIs provide a controlled way for third parties to access a
service
•  Not having an API means that third parties will find another
way
•  That’s why JPMC is considering this:
Federated Security is a Must
Systems like OAuth and OpenID exist for
the purpose of managing secure access
without sharing passwords
-- JPMorgan Chase, 2015 letter to shareholders
Trusted Endpoints Aren’t
•  API security must assume untrusted endpoints
•  User authentication
•  Fraud detection
•  Application-level authentication
Fundamental API
Security
What every developer should know
©2015 Apigee Corp. All Rights Reserved.
You Have an API
What You Need to Do
•  Prevent unauthorized applications
•  Prevent unauthorized users
•  Prevent excessive traffic
•  Prevent content attacks
•  Watch for trouble
•  React to trouble
What Do Apigee Customers Do?
74%
OAuth
78%
Spike
Arrest
72%
Threat
Protection
What do Others Do?
•  A wide variety of solutions out there
•  87% percent have “API management”
•  83% are “concerned” about API security
Prevent Unauthorized Applications
•  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
Prevent Unauthorized Users
•  Authenticate all end users for critical apps
•  Only way to keep security credentials outside the app
•  Use OAuth carefully
•  Use caution around “password” grant type
•  Only as good as identity management
•  For instance, dodgy password reset practices
•  Can you get identity a service?
Don’t Make It Up
•  OAuth 1.0: Bug
•  OAuth 1.0a: Better
•  OAuth 2.0 authorization code grant type: Attack identified
•  RFC 7636 (PKCE) fixes it
•  Would you have discovered this on your own?
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
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
Watch for Trouble
•  Monitor the API
•  Usage patterns
•  Usage patterns by application
•  Latency
•  Error rate
•  Monitor the world too
•  Unusual tweets?
•  Other social media?
Example: Bot Detection
•  Traffic comes from unusual places:
•  iPads in Amazon data centers
•  US-only retailers with many “customers” in Eastern
Europe
•  Or unusual patterns:
•  Sequential scans of identifiers
•  API traffic faster than a human can generate
•  Identify suspected “bots”
•  Heuristics, machine learning
•  Block them by IP or otherwise
React to Trouble
•  Do you have application-level authentication?
•  Revoke app credentials
•  Change rate limit
•  Redirect app to another URL
•  No application-level authentication?
•  Insert additional logic
•  Worst cast: shut down the API until it’s
fixed
API Management Can Help
Effective API
Security
API == Contract == Security
An API is a Contract
What is an API, really?
The “API Stack” is Small
•  Simple
•  Ubiquitous
•  Widely-understood
•  Universally implemented
API Contracts are Simple
•  Since API technology is simple,
•  So is the contract:
•  URIs
•  JSON schemas
•  Query parameters
•  Authentication
•  Simpler contracts are:
•  simpler to validate
•  simpler to test
•  simpler to prove
Simpler Means More Secure
•  Don’t agree? Let’s look at web apps:
•  Cross-site scripting
•  Insecure URIs in links
•  Cross-site request forgery
•  Insecure redirects
•  Insecure third-party pages
•  Insecure and malicious JavaScript
Simpler is Better
•  Well-known URI pattern
•  Documented schemas
•  Well-known authentication model
•  Well-known authorization model
•  One way to secure all API calls
•  Totally dynamic URI pattern is harder to
test
•  Specified inputs and outputs can be
tested
•  Haphazard authentication hard to test
•  Haphazard authorization hard to test
•  Multiple implementations hard to test
Summing it Up
APIs are essentail for security’
Security is essential to APIs’
APIs risk is well-understood.
Conclusion
•  We saw lots of places where APIs were compromised
•  Many of these had nothing to do with an “API”
•  Biggest vulnerability is having an API and not realizing it
•  Everything with a URL has an API
•  Well-defined APIs can be secured
•  Lots of widely-known techniques and technology
•  A properly-secured API is verifiable
•  Use it!
Thank You

More Related Content

PPTX
Mesh the Gears: Mastering the Economics of Digital Leverage
PPTX
Managing Sensitive Information in an API and Microservices World
PDF
Platforms, Cloud-Native Architectures, and APIs: Chicago Adapt or Die Keynote
PPTX
Building APIs with Apigee Edge and Microsoft Azure
PPTX
Cloud Deployments Done Right: Why APIs are Key
PPTX
Managing Sensitive Information in an API and Microservices World
PDF
Modernize Service-Oriented Architecture with APIs
PPTX
Monitoring Solutions for APIs
Mesh the Gears: Mastering the Economics of Digital Leverage
Managing Sensitive Information in an API and Microservices World
Platforms, Cloud-Native Architectures, and APIs: Chicago Adapt or Die Keynote
Building APIs with Apigee Edge and Microsoft Azure
Cloud Deployments Done Right: Why APIs are Key
Managing Sensitive Information in an API and Microservices World
Modernize Service-Oriented Architecture with APIs
Monitoring Solutions for APIs

What's hot (20)

PDF
How to Achieve Agile API Security
PDF
API-first, going beyond SOA, ESB & Integration
PPTX
The Four Transformative Forces of the API Management Market
PDF
Is Microservices SOA Done Right?
PDF
Demo: New open banking platform
PDF
APIs in the Enterprise - Lessons Learned
PPTX
Apigee Edge Overview and Roadmap
PPTX
API Security Lifecycle
PDF
Data Driven Security
PDF
I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform
PPTX
Adapt or Die Sydney - API Security
PPTX
The Internet of Things and Developers: What the Enterprise Needs to Know
PDF
Bringing Partners, Teams & Systems Together through APIs
PDF
Bringing Partners, Teams and Systems Together through APIs
PPTX
Apigee Edge Product Demo
PDF
Bringing API Management to AWS Powered Backends
PDF
London Adapt or Die: Opening Keynot
PDF
Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...
PPTX
Unlocking Value From the Internet of Things (IoT) with APIs
PPTX
Adapt or Die DevJam: San Francisco, Sept 27 2016
How to Achieve Agile API Security
API-first, going beyond SOA, ESB & Integration
The Four Transformative Forces of the API Management Market
Is Microservices SOA Done Right?
Demo: New open banking platform
APIs in the Enterprise - Lessons Learned
Apigee Edge Overview and Roadmap
API Security Lifecycle
Data Driven Security
I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform
Adapt or Die Sydney - API Security
The Internet of Things and Developers: What the Enterprise Needs to Know
Bringing Partners, Teams & Systems Together through APIs
Bringing Partners, Teams and Systems Together through APIs
Apigee Edge Product Demo
Bringing API Management to AWS Powered Backends
London Adapt or Die: Opening Keynot
Apigee and Accenture Webcast - Accenture Technology Vision 2013 - An API Cent...
Unlocking Value From the Internet of Things (IoT) with APIs
Adapt or Die DevJam: San Francisco, Sept 27 2016
Ad

Viewers also liked (20)

PDF
Banking and Mobile Identity
PPT
CPI Summit Europe Presentation
PPTX
What's better than Microservices? Serverless Microservices
PDF
Enough talking - it's time to start doing
PPTX
Putting order to your API ecosystem
PPTX
HXR 2016: Free the Data Access & Integration -Aashima Gupta, Apigee
PPTX
Are Your Microservices Naked and Afraid?
PDF
Orchestrating microservices like a ninja
PDF
EMF-REST: Generation of RESTful APIs from Models
PDF
How to (almost certainly) fail: Building vs. buying your API infrastructure
PDF
Ultimate Guide to 30+ API Documentation Solutions
PPTX
The Business of APIs: Your 100-Day API Business Plan
PPTX
APIs: The New Security Layer
PPTX
London adapt or-die opening keynote chet kapoor
PPTX
L.L.Bean’s API Journey: Digital Commerce Done Right
PPTX
API Best Practices
PPTX
Adapt or Die: A Microservices Story at Google
PDF
gRPC: The Story of Microservices at Square
PDF
Are ESBs Relevant in the Age of Microservices?
PPTX
Adapt or Die: Serverless Microservices
Banking and Mobile Identity
CPI Summit Europe Presentation
What's better than Microservices? Serverless Microservices
Enough talking - it's time to start doing
Putting order to your API ecosystem
HXR 2016: Free the Data Access & Integration -Aashima Gupta, Apigee
Are Your Microservices Naked and Afraid?
Orchestrating microservices like a ninja
EMF-REST: Generation of RESTful APIs from Models
How to (almost certainly) fail: Building vs. buying your API infrastructure
Ultimate Guide to 30+ API Documentation Solutions
The Business of APIs: Your 100-Day API Business Plan
APIs: The New Security Layer
London adapt or-die opening keynote chet kapoor
L.L.Bean’s API Journey: Digital Commerce Done Right
API Best Practices
Adapt or Die: A Microservices Story at Google
gRPC: The Story of Microservices at Square
Are ESBs Relevant in the Age of Microservices?
Adapt or Die: Serverless Microservices
Ad

Similar to Enhancing your Security APIs (20)

PPTX
2022 APIsecure_Hackers with Valid Credentials
PPTX
Layered API Security: What Hackers Don't Want You To Know
PDF
APIsecure 2023 - Discovery is the Starting Point for Defending APIs, Giora En...
PDF
[WSO2 Integration Summit San Francisco 2019] Protecting API Infrastructures —...
PPTX
What Hackers Don’t Want You To Know: How to Maximize Your API Security
PPTX
apidays Paris 2024 - Do not Live in the Shadow (APIs) - Teresa Pereira, Sieme...
PPTX
London Adapt or Die: Securing your APIs the Right Way!
PPTX
apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...
PDF
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
PDF
APIdays Paris 2019 - API Gateway & Identity Providers, a Match Made in Micros...
PPTX
What Hackers Don’t Want You To Know: How to Maximize Your API Security
PPTX
Combining Healthcare Standards with Other RESTful APIs
PPTX
API Strategy Introduction
PDF
Api security-present
PDF
API Security Best Practices and Guidelines
PDF
APIdays London 2019 - Why the Financial Industry Needs Intelligent API Securi...
PDF
Peeling the Onion: Making Sense of the Layers of API Security
PDF
APISecurity_OWASP_MitigationGuide
PPTX
The Science of APIs in a Mobile World:Security, Control and Quality
PPTX
How-to-Secure-APIs-to-Defend-Against-Emerging-Cyber-Threats-to-Digital-Web-As...
2022 APIsecure_Hackers with Valid Credentials
Layered API Security: What Hackers Don't Want You To Know
APIsecure 2023 - Discovery is the Starting Point for Defending APIs, Giora En...
[WSO2 Integration Summit San Francisco 2019] Protecting API Infrastructures —...
What Hackers Don’t Want You To Know: How to Maximize Your API Security
apidays Paris 2024 - Do not Live in the Shadow (APIs) - Teresa Pereira, Sieme...
London Adapt or Die: Securing your APIs the Right Way!
apidays LIVE Singapore 2021 - Novel approaches in API security by Dr Tal Stei...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
APIdays Paris 2019 - API Gateway & Identity Providers, a Match Made in Micros...
What Hackers Don’t Want You To Know: How to Maximize Your API Security
Combining Healthcare Standards with Other RESTful APIs
API Strategy Introduction
Api security-present
API Security Best Practices and Guidelines
APIdays London 2019 - Why the Financial Industry Needs Intelligent API Securi...
Peeling the Onion: Making Sense of the Layers of API Security
APISecurity_OWASP_MitigationGuide
The Science of APIs in a Mobile World:Security, Control and Quality
How-to-Secure-APIs-to-Defend-Against-Emerging-Cyber-Threats-to-Digital-Web-As...

More from Apigee | Google Cloud (20)

PDF
How Secure Are Your APIs?
PDF
Magazine Luiza at a glance (1)
PPTX
Monetization: Unlock More Value from Your APIs
PDF
Apigee Demo: API Platform Overview
PDF
Ticketmaster at a glance
PDF
AccuWeather: Recasting API Experiences in a Developer-First World
PDF
Which Application Modernization Pattern Is Right For You?
PPTX
Apigee Product Roadmap Part 2
PDF
Walgreens at a glance
PDF
Apigee Edge: Intro to Microgateway
PDF
Managing the Complexity of Microservices Deployments
PDF
Pitney Bowes at a glance
PPTX
Microservices Done Right: Key Ingredients for Microservices Success
PDF
Adapt or Die: Opening Keynote with Chet Kapoor
PDF
Adapt or Die: Keynote with Greg Brail
PDF
Adapt or Die: Keynote with Anant Jhingran
PDF
London Adapt or Die: Lunch keynote
PDF
London Adapt or Die: Closing Keynote — Adapt Now!
PPTX
London Adapt or Die: Opening Keynote with Chet Kapoor
PPTX
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
How Secure Are Your APIs?
Magazine Luiza at a glance (1)
Monetization: Unlock More Value from Your APIs
Apigee Demo: API Platform Overview
Ticketmaster at a glance
AccuWeather: Recasting API Experiences in a Developer-First World
Which Application Modernization Pattern Is Right For You?
Apigee Product Roadmap Part 2
Walgreens at a glance
Apigee Edge: Intro to Microgateway
Managing the Complexity of Microservices Deployments
Pitney Bowes at a glance
Microservices Done Right: Key Ingredients for Microservices Success
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Anant Jhingran
London Adapt or Die: Lunch keynote
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Opening Keynote with Chet Kapoor
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story

Recently uploaded (20)

PDF
Architecture types and enterprise applications.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Tartificialntelligence_presentation.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Hybrid model detection and classification of lung cancer
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
Modernising the Digital Integration Hub
PPT
What is a Computer? Input Devices /output devices
PPTX
observCloud-Native Containerability and monitoring.pptx
PPTX
The various Industrial Revolutions .pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
August Patch Tuesday
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Architecture types and enterprise applications.pdf
Zenith AI: Advanced Artificial Intelligence
Tartificialntelligence_presentation.pptx
DP Operators-handbook-extract for the Mautical Institute
1 - Historical Antecedents, Social Consideration.pdf
A review of recent deep learning applications in wood surface defect identifi...
Assigned Numbers - 2025 - Bluetooth® Document
Hybrid model detection and classification of lung cancer
sustainability-14-14877-v2.pddhzftheheeeee
Modernising the Digital Integration Hub
What is a Computer? Input Devices /output devices
observCloud-Native Containerability and monitoring.pptx
The various Industrial Revolutions .pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
August Patch Tuesday
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
NewMind AI Weekly Chronicles – August ’25 Week III
Final SEM Unit 1 for mit wpu at pune .pptx
A contest of sentiment analysis: k-nearest neighbor versus neural network
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf

Enhancing your Security APIs

  • 1. Secure APIs for Finance Lessons from API security successes and failures Greg Brail Apigee May 2016
  • 2. Agenda What Happens to Insecure APIs API Security Fundamentals Why APIs are less risky The Result: Effective API Security
  • 3. No API Security Bad things happen
  • 4. I have an API!
  • 5. ©2015 Apigee Corp. All Rights Reserved. But I Don’t Have an API!
  • 6. Of Course You Have an API! 6 Wired, 9/22/15 www.ifc0nfig.com, 1/5/15 troyhunt.com, 2/24/16 Everything with a URI has an API
  • 7. Some API Security Breaches Breach Reason Source Buffer Compromised third-party admin password; OAuth secret in GitHub ProgrammableWeb Snapchat No authentication; no rate limit Gibson Security 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 Instagram Malicious app was stealing passwords; no approval process Daily Dot Nissan Leaf VIN number only security credential on API Troy Hunt Tesla Model S Six-character password that’s easily guessable Security Affairs, Elsewhere
  • 8. Nissan Leaf •  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
  • 9. •  No rate limit on request to get friends by phone number •  Hard-coded encryption key •  Weak cipher •  http://gibsonsec.org/snapchat/ Snapchat
  • 10. Mobile Banking Apps •  Security researcher Ariel Sanchez examined 20 iOS banking apps from banks around the world •  More than 30% used non-TLS-encrypted links for at least part of the app •  Down from 90% two years ago •  Demonstrated JavaScript interception of some apps’ “login” page to gather passwords 10 Ariel Sanchez, blog.ioactive.com
  • 11. A South Asian Bank •  Security researcher Sathya Prakash tested the security of the app he used for one of his bank accounts •  Found many major flaws and one huge one •  All validation of account numbers for funds transfers was performed in the mobile app only – not on the server 11
  • 12. SWIFT •  Over $900 million in fraudulent transfer requests due to compromise at a member bank •  Became $81 million due to a typo BAE Systems Applied Intelligence
  • 13. APIs for Finance Applying security lessons
  • 14. APIs for Controlled Access •  APIs provide a controlled way for third parties to access a service •  Not having an API means that third parties will find another way •  That’s why JPMC is considering this:
  • 15. Federated Security is a Must Systems like OAuth and OpenID exist for the purpose of managing secure access without sharing passwords -- JPMorgan Chase, 2015 letter to shareholders
  • 16. Trusted Endpoints Aren’t •  API security must assume untrusted endpoints •  User authentication •  Fraud detection •  Application-level authentication
  • 17. Fundamental API Security What every developer should know
  • 18. ©2015 Apigee Corp. All Rights Reserved. You Have an API
  • 19. What You Need to Do •  Prevent unauthorized applications •  Prevent unauthorized users •  Prevent excessive traffic •  Prevent content attacks •  Watch for trouble •  React to trouble
  • 20. What Do Apigee Customers Do? 74% OAuth 78% Spike Arrest 72% Threat Protection
  • 21. What do Others Do? •  A wide variety of solutions out there •  87% percent have “API management” •  83% are “concerned” about API security
  • 22. Prevent Unauthorized Applications •  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
  • 23. Prevent Unauthorized Users •  Authenticate all end users for critical apps •  Only way to keep security credentials outside the app •  Use OAuth carefully •  Use caution around “password” grant type •  Only as good as identity management •  For instance, dodgy password reset practices •  Can you get identity a service?
  • 24. Don’t Make It Up •  OAuth 1.0: Bug •  OAuth 1.0a: Better •  OAuth 2.0 authorization code grant type: Attack identified •  RFC 7636 (PKCE) fixes it •  Would you have discovered this on your own?
  • 25. 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
  • 26. 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
  • 27. Watch for Trouble •  Monitor the API •  Usage patterns •  Usage patterns by application •  Latency •  Error rate •  Monitor the world too •  Unusual tweets? •  Other social media?
  • 28. Example: Bot Detection •  Traffic comes from unusual places: •  iPads in Amazon data centers •  US-only retailers with many “customers” in Eastern Europe •  Or unusual patterns: •  Sequential scans of identifiers •  API traffic faster than a human can generate •  Identify suspected “bots” •  Heuristics, machine learning •  Block them by IP or otherwise
  • 29. React to Trouble •  Do you have application-level authentication? •  Revoke app credentials •  Change rate limit •  Redirect app to another URL •  No application-level authentication? •  Insert additional logic •  Worst cast: shut down the API until it’s fixed
  • 31. Effective API Security API == Contract == Security
  • 32. An API is a Contract What is an API, really?
  • 33. The “API Stack” is Small •  Simple •  Ubiquitous •  Widely-understood •  Universally implemented
  • 34. API Contracts are Simple •  Since API technology is simple, •  So is the contract: •  URIs •  JSON schemas •  Query parameters •  Authentication •  Simpler contracts are: •  simpler to validate •  simpler to test •  simpler to prove
  • 35. Simpler Means More Secure •  Don’t agree? Let’s look at web apps: •  Cross-site scripting •  Insecure URIs in links •  Cross-site request forgery •  Insecure redirects •  Insecure third-party pages •  Insecure and malicious JavaScript
  • 36. Simpler is Better •  Well-known URI pattern •  Documented schemas •  Well-known authentication model •  Well-known authorization model •  One way to secure all API calls •  Totally dynamic URI pattern is harder to test •  Specified inputs and outputs can be tested •  Haphazard authentication hard to test •  Haphazard authorization hard to test •  Multiple implementations hard to test
  • 37. Summing it Up APIs are essentail for security’ Security is essential to APIs’ APIs risk is well-understood.
  • 38. Conclusion •  We saw lots of places where APIs were compromised •  Many of these had nothing to do with an “API” •  Biggest vulnerability is having an API and not realizing it •  Everything with a URL has an API •  Well-defined APIs can be secured •  Lots of widely-known techniques and technology •  A properly-secured API is verifiable •  Use it!