SlideShare una empresa de Scribd logo
1 de 43
Descargar para leer sin conexión
Protecting Your APIs Against Attack and Hijack
K. Scott Morrison
CTO
Layer 7 Technologies
Webinar Housekeeping
Questions
-Chat any questions you have and we’ll answer them at the
end of this webinar

Twitter
- Today’s event hashtag: #L7webinar

Follow us on Twitter:
- @layer7
- @kscottmorrison




                                                Layer 7 Confidential
Here Is What This Talk Is About:
 The new API threat
   Why is this a source of concern?
 Are APIs just like the Web? Or are they
  different?
   Look at three important areas:
     1. Parameterization
     2. Identity
     3. Cryptography
 How to apply the lessons of this talk
What is an API?



                                           API
                                          Server




   Mobile App

                                       An API is a
                                       RESTful service
                Web Client

                             Web App
For Example:


 GET http://services.layer7.com/staff/Scott
For Example:
           http://services.layer7.com/staff/Scott




{
    "firstName": ”Scott       ",
    "lastName" : ”Morrison",
    ”title"    : “CTO”,
    "address" :
    {
        "streetAddress": ”405-1100 Melville",
        "city"      : ”Vancouver",
        ”prov"       : ”BC",
        "postalCode" : ”V6E 4A6"
    },
    "phoneNumber":
    [
        {
          "type" : ”office",
          "number": ”605 681-9377"
        },
        {
          "type" : ”home",
          "number": ”604 555-4567"
        }
    ]
}
This is a Technological Sea Change
                        Old              New
    Transport           HTTP             HTTP
    Data                XML              JSON
    Authentication      Basic, X.509,    OAuth
                        Kerberos, SAML
    Confidentiality &   WS-Security      SSL
    Integrity
Where Simple Won

SOAP + WS-*        RESTful APIs
• Complex          • Simple
• Highly           • Informal
  standardized     • Grassroots
• Vendor driven    • Frictionless
• Barriers
“Sounds great. So what’s
     the problem?”
The Real Problem Is This:


         API Development !=
          Web Development

                  In Particular:
                    We need to be wary of bad
                    web development practices
                       migrating to APIs…
Problem Area #1: API Parameterization
 In the traditional web world, parameterization
  was limited and indirect
    Subject to the capabilities of URLs and forms
 APIs in contrast and offer much more explicit
  parameterization
    The full power of RESTful design: GET, POST, PUT,
     DELETE
       (And don’t stop there… what about effects of HEAD, etc)?
 This is a greater potential attack surface
    Injection, bounds, correlation, and so on
Good Web Apps Constrain

                                             Database


                                         Objects
                             App
                            Server       Pages



                   HTTP
                   Server
                                     Constraint
                                      Space



      Web Client
APIs Are A More Direct Conduit
 Often:
 • Self-documenting
 • Closely mapped to object space               Database



                                        App
                                       Server    Objects



                              HTTP
                              Server




             App
Consider Attack Surface
Script Insertion is Just One Potential
Exploit                              2. Server fails to
                                   perform FIEO: Filter
                                                        Input, Escape Output
                    3. Browser loads
                                                        Web App Server
                       content with
                                                        (browser+APIs)
                    embedded script

                                                 API


                                        <SCRIPT …>
                                                       1. API injects
                                                          script in

  Victim: Web
    Browser
     Client


                             Attacker
SQL Injection is Another
            Exploits of a Mom




                                Source: https://xkcd.com/327/
Mitigation Strategy
 Rigorous validation of user supplied input
   Stronger typing
   Sets and ranges
   Avoid auto-generated schemas that make everything
    a string
 Use schema validation
   XML Schema, RELAX-NG, Schematron
      Please no DTDs!
   JSON schema validation
   WADL’s second coming
Mitigation Strategy (cont.)
 Regex scanning for signatures
 Tune scanning for the API
   Sometimes SELECT is OK
 Virus scanning of attachments
   Don’t forget B64’d message content
 Library, service, or gateway solutions
   Decoupled security
   What are the tradeoffs?
Mitigation Strategy
 Whitelist tags if you can (i.e. where the validation
  space is small and concise)
    Not always practical
    (Note that I’m referring to whitelisting tags not IPs.)
 Blacklist dangerous tags like <SCRIPT>
 Always perform FIEO (Filter Input, Escape
  Output)
 Learn more: http://xssed.com
Problem Area #2: Identity
 We had it surprisingly good in the Web world
   Browser session usually tied to human
   Dealing with one identity is not so tough
      Security tokens abound, but solutions are mature
         – Username/pass, x.509 certs, multi-factor, Kerberos, SAML, etc
   APIs rapidly becoming more difficult
      Non-human entities
      Multiple layers of relevant identities
         – Me, my attributes, my phone, my developer, my provider…
API Keys
 “An application programing interface key (API key) is a
   code generated by websites that allow users to access
their application programming interface. API keys are used
    to track how the API is being used in order to prevent
        malicious use or abuse of the terms of service.
API keys are based on the UUID system to ensure they will
                be unique to each user.”



(Source: wikipedia http://en.wikipedia.org/wiki/Application_programming_interface_key )
For Example:


   GET http://example.layer7.com/services/staff
      ?APIKey=15458617-7813-4a37-94ac-a8e6da6f6405




                                              Seriously? WTF.
How Does An API Key Map To Identity?



               A person?

                                           A   Or an app?




       15458617-7813-4a37-94ac-a8e6da6f6405

                               It is entirely inconsistent
The Identity Profile
Increasingly we need to move toward large
number of claims (multiple identity profile)

• appID                 • User attributes
• userID                   •   Roles
                           •   Geo location
• deviceID
                           •   IP
                           •   User agent
                           •   Time of day
                           •   etc
Where Did API Keys Come From?
 API keys came from Google APIs like maps, early
  Yahoo APIs, early Twitter APIs etc.
   Originally meant for loose, non-authoritative tracking
   Rate limits, approximate usage profiling
 Google geocoding v3.0 API deprecates API keys
   Uses IP instead to track and throttle
   This has its own set of problems
      IP address spoofing
      Problems with legitimate clients like cloud servers
 Google Premier uses a public client_id and
  requires signed URLs
   (Strips domain leaving only path and query parameters)
The Problem with API Keys: It’s a kind
of like ad-hoc session tracking

 This is a web developer cultural issue
   On the web, session tokens are rarely secured
      Step 1: Sign in with SSL
      Steps 2 to n: Track session using cookie without SSL
 There are two bad things going on here:
  1. No protection of security token
  2. No binding of token to message content

             These two things are very related


 In 2012, this is a huge problem…
One Word: Firesheep




                                          In the post Firesheep world, unprotected session
                                                       tracking should never be tolerated…
Source: http://codebutler.com/firesheep
Bottom Line: The API Key Was Never Meant To
Be Authoritative

 Strange hybrid of HTTP’s USER-AGENT and
  session continuity
 OK only for general tracking
 Anything that matters should use real security
  tokens
   Anywhere where identity is important:
        APIs that provide access to sensitive data
        APIs that change things that matter
        APIs that charge for use
        etc.
Twitter (kind of) Gets It
Will OAuth survive adolescence?
 Complexity and confusion
 Interop is a nightmare right now
 Enterprise token management
    Beyond the timeout
    Lifecycle, revocation, distribution, etc.
    Talk, but not a lot of action
 SSL everywhere
    Protect bearer tokens
 Phishing vulnerabilities
    Server authentication and loss of trust in the CA
     infrastructure
Mitigation
 Protect the tokens!
                                          Important!
 HTTPS everywhere
   This is another web design cultural issue
   It’s just not that expensive any more
 Need HTTP Strict Transport Security (HSTS) for
  APIs
   http://en.wikipedia.org/wiki/HTTP_Strict_Transport_S
    ecurity
Problem Area #3: Cryptography and PKI
 Cryptography is reasonably mature on the web
   Surprisingly limited use patterns
   SSL/TLS
   Very little tough PKI (like client-side)
 So what’s wrong with APIs?
It’s Like We Forgot Everything We Knew
 Emailing keys
   API, shared secrets, etc.
 Bad storage schemes
   Security through obscurity
   Toy ciphers
 No life cycle management
     Limits on use
     Time limits
     Revocation
     Audit
The Issues
 Key management
   Especially across farms
 Nobody takes web PKI seriously
   CRLs and OCSP aren’t much good in the browser
    world
      Fail open—seriously
 CA trust breakdown
   Comodo fraud in March 2011
The Issues (cont.)
 Cipher suite restrictions
    Avoiding downgrades
 Client-side certificate authentication is hard
 The alternatives for parameter confidentiality
  and/or integrity are hard:
    XML encryption is still there
       Not for the faint of heart
    OAuth 1.0 gave you parameter signing
       Only optional in 2.0
    JWT signing and encryption emerging
Mitigations
 Use real PKI
   I know it’s painful
 Use HSMs to protect keys that really matter
 Otherwise use real key material protection
  schemes
   PKCS #12, etc
   Libraries abound
Mitigations
 You must do CRLs and OCSP for APIs
 Google maintains a certificate registry:
  http://googleonlinesecurity.blogspot.com/2011/04
  /improving-ssl-certificate-security.html
 Google safe browsing API:
  http://code.google.com/apis/safebrowsing/devel
  opers_guide_v2.html
   Blacklist of phishing and malware sites
 DANE and DNSSEC
Where Does This All Leave Us?
 SOAP, the WS-* stack dealt with much of this
  very rigorously
   But it was just too hard.
 We need to learn from this, but make it easier to
  implement
 Here’s how…
How Do I Apply This Today?
 Use SSL for all API transactions
   Hides many sins
      Confidentiality, integrity, replay, binding token+message,
       server authentication, etc.
 Use real PKI
   Yes, it’s hard
   But you can’t skimp here
 Use OAuth & OpenID Connect for distributed
  authentication
 Use real frameworks, don’t reinvent
   They exist for most languages
   Consider gateways to encapsulate security
Solution: Layer 7 API Proxy                                                     API
Gateway Cluster at Edge of Network                                              Servers

 DMZ deployment                                      Firewall 2
 Hardware appliance, virtual appliance or
  software
                                         Firewall 1




                                                                       …
                                                                               Enterprise
                                                                                Network
                                                                   API Proxy
                                                                    Cluster




                   API Client
Solution: Layer 7 API Portal                                       API/Service
API Program Management                                                Servers

 Client-developer management
 Business-oriented API management
 DMZ deployment
 Virtual Appliance




                                                  …
                                                                     Enterprise
                                                                      Network


                                                  API Portal



                                                                 API
                                                               Managers




                                     Client App
                                     Developers
Upcoming Events
 Tech Talk Tuesday
 January 29th – 9am PST

 Bursting & Amazon Cloud Auto-scale
 http://layer7.com/live



 Valentines Special Webinar
 February 7th – 9am PST

 Be My API:
 How to Implement an API Strategy Everyone will Love
 http://events.layer7tech.com/myAPI
For further information:




          K. Scott Morrison
          Chief Technology Officer
          Layer 7 Technologies
          1100 Melville St, Suite 405
          Vancouver, B.C. V6E 4A6
          Canada
          (800) 681-9377

          smorrison@layer7tech.com
          http://www.layer7tech.com

Más contenido relacionado

La actualidad más candente

Best Practices in Building an API Security Ecosystem
Best Practices in Building an API Security EcosystemBest Practices in Building an API Security Ecosystem
Best Practices in Building an API Security EcosystemPrabath Siriwardena
 
Token Authentication for Java Applications
Token Authentication for Java ApplicationsToken Authentication for Java Applications
Token Authentication for Java ApplicationsStormpath
 
Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...
Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...
Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...CA API Management
 
API Security from the DevOps and CSO Perspectives (Webcast)
API Security from the DevOps and CSO Perspectives (Webcast)API Security from the DevOps and CSO Perspectives (Webcast)
API Security from the DevOps and CSO Perspectives (Webcast)Apigee | Google Cloud
 
Making Sense of API Access Control
Making Sense of API Access ControlMaking Sense of API Access Control
Making Sense of API Access ControlCA API Management
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportGaurav Sharma
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authenticationleahculver
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityMohammed Fazuluddin
 
Enterprise Access Control Patterns for Rest and Web APIs
Enterprise Access Control Patterns for Rest and Web APIsEnterprise Access Control Patterns for Rest and Web APIs
Enterprise Access Control Patterns for Rest and Web APIsCA API Management
 
Getting Started with API Security Testing
Getting Started with API Security TestingGetting Started with API Security Testing
Getting Started with API Security TestingSmartBear
 
Single-Page-Application & REST security
Single-Page-Application & REST securitySingle-Page-Application & REST security
Single-Page-Application & REST securityIgor Bossenko
 
Practical API Security - PyCon 2018
Practical API Security - PyCon 2018Practical API Security - PyCon 2018
Practical API Security - PyCon 2018Adam Englander
 
OWASP API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World42Crunch
 
Securing RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectSecuring RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectJonathan LeBlanc
 
Mohanraj - Securing Your Web Api With OAuth
Mohanraj - Securing Your Web Api With OAuthMohanraj - Securing Your Web Api With OAuth
Mohanraj - Securing Your Web Api With OAuthfossmy
 
Stateless authentication for microservices - GR8Conf 2015
Stateless authentication for microservices - GR8Conf 2015Stateless authentication for microservices - GR8Conf 2015
Stateless authentication for microservices - GR8Conf 2015Alvaro Sanchez-Mariscal
 
Build A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIBuild A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIStormpath
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide Isabelle Mauny
 
Testing REST Web Services
Testing REST Web ServicesTesting REST Web Services
Testing REST Web ServicesJan Algermissen
 
REST Service Authetication with TLS & JWTs
REST Service Authetication with TLS & JWTsREST Service Authetication with TLS & JWTs
REST Service Authetication with TLS & JWTsJon Todd
 

La actualidad más candente (20)

Best Practices in Building an API Security Ecosystem
Best Practices in Building an API Security EcosystemBest Practices in Building an API Security Ecosystem
Best Practices in Building an API Security Ecosystem
 
Token Authentication for Java Applications
Token Authentication for Java ApplicationsToken Authentication for Java Applications
Token Authentication for Java Applications
 
Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...
Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...
Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...
 
API Security from the DevOps and CSO Perspectives (Webcast)
API Security from the DevOps and CSO Perspectives (Webcast)API Security from the DevOps and CSO Perspectives (Webcast)
API Security from the DevOps and CSO Perspectives (Webcast)
 
Making Sense of API Access Control
Making Sense of API Access ControlMaking Sense of API Access Control
Making Sense of API Access Control
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authentication
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
 
Enterprise Access Control Patterns for Rest and Web APIs
Enterprise Access Control Patterns for Rest and Web APIsEnterprise Access Control Patterns for Rest and Web APIs
Enterprise Access Control Patterns for Rest and Web APIs
 
Getting Started with API Security Testing
Getting Started with API Security TestingGetting Started with API Security Testing
Getting Started with API Security Testing
 
Single-Page-Application & REST security
Single-Page-Application & REST securitySingle-Page-Application & REST security
Single-Page-Application & REST security
 
Practical API Security - PyCon 2018
Practical API Security - PyCon 2018Practical API Security - PyCon 2018
Practical API Security - PyCon 2018
 
OWASP API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World
 
Securing RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectSecuring RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID Connect
 
Mohanraj - Securing Your Web Api With OAuth
Mohanraj - Securing Your Web Api With OAuthMohanraj - Securing Your Web Api With OAuth
Mohanraj - Securing Your Web Api With OAuth
 
Stateless authentication for microservices - GR8Conf 2015
Stateless authentication for microservices - GR8Conf 2015Stateless authentication for microservices - GR8Conf 2015
Stateless authentication for microservices - GR8Conf 2015
 
Build A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIBuild A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON API
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide
 
Testing REST Web Services
Testing REST Web ServicesTesting REST Web Services
Testing REST Web Services
 
REST Service Authetication with TLS & JWTs
REST Service Authetication with TLS & JWTsREST Service Authetication with TLS & JWTs
REST Service Authetication with TLS & JWTs
 

Destacado

Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...CA API Management
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Stormpath
 
Best Practices for API Security
Best Practices for API SecurityBest Practices for API Security
Best Practices for API SecurityMuleSoft
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2Aaron Parecki
 
Protecting Web Services from DDOS Attack
Protecting Web Services from DDOS AttackProtecting Web Services from DDOS Attack
Protecting Web Services from DDOS AttackPonraj
 
Json web token api authorization
Json web token api authorizationJson web token api authorization
Json web token api authorizationGiulio De Donato
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!Stormpath
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongDerek Perkins
 
JavaOne2013: Securing Java in the Server Room - Tim Ellison
JavaOne2013: Securing Java in the Server Room - Tim EllisonJavaOne2013: Securing Java in the Server Room - Tim Ellison
JavaOne2013: Securing Java in the Server Room - Tim EllisonChris Bailey
 
Cloud Platform Qualification Training Intro - LinkedIn
Cloud Platform Qualification Training Intro - LinkedInCloud Platform Qualification Training Intro - LinkedIn
Cloud Platform Qualification Training Intro - LinkedInDidier Girard
 
Rest security in mule
Rest security in muleRest security in mule
Rest security in muleSon Nguyen
 
Performance is a feature! - London .NET User Group
Performance is a feature! - London .NET User GroupPerformance is a feature! - London .NET User Group
Performance is a feature! - London .NET User GroupMatt Warren
 
API Copyrights: New Considerations for Building or Using APIs
API Copyrights: New Considerations for Building or Using APIsAPI Copyrights: New Considerations for Building or Using APIs
API Copyrights: New Considerations for Building or Using APIsApigee | Google Cloud
 
Using APIs to Program Disparate IoT Devices
Using APIs to Program Disparate IoT DevicesUsing APIs to Program Disparate IoT Devices
Using APIs to Program Disparate IoT DevicesApigee | Google Cloud
 
Tuning IBMs Generational GC
Tuning IBMs Generational GCTuning IBMs Generational GC
Tuning IBMs Generational GCChris Bailey
 
PHP, Java EE & .NET Comparison
PHP, Java EE & .NET ComparisonPHP, Java EE & .NET Comparison
PHP, Java EE & .NET ComparisonHaim Michael
 
The API Tempest
The API TempestThe API Tempest
The API TempestSam Ramji
 

Destacado (20)

Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)
 
Best Practices for API Security
Best Practices for API SecurityBest Practices for API Security
Best Practices for API Security
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2
 
Protecting Web Services from DDOS Attack
Protecting Web Services from DDOS AttackProtecting Web Services from DDOS Attack
Protecting Web Services from DDOS Attack
 
Json web token api authorization
Json web token api authorizationJson web token api authorization
Json web token api authorization
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrong
 
RESTful API Design, Second Edition
RESTful API Design, Second EditionRESTful API Design, Second Edition
RESTful API Design, Second Edition
 
JavaOne2013: Securing Java in the Server Room - Tim Ellison
JavaOne2013: Securing Java in the Server Room - Tim EllisonJavaOne2013: Securing Java in the Server Room - Tim Ellison
JavaOne2013: Securing Java in the Server Room - Tim Ellison
 
Cloud Platform Qualification Training Intro - LinkedIn
Cloud Platform Qualification Training Intro - LinkedInCloud Platform Qualification Training Intro - LinkedIn
Cloud Platform Qualification Training Intro - LinkedIn
 
Rest security in mule
Rest security in muleRest security in mule
Rest security in mule
 
Cyber Attack Analysis
Cyber Attack AnalysisCyber Attack Analysis
Cyber Attack Analysis
 
Performance is a feature! - London .NET User Group
Performance is a feature! - London .NET User GroupPerformance is a feature! - London .NET User Group
Performance is a feature! - London .NET User Group
 
API Copyrights: New Considerations for Building or Using APIs
API Copyrights: New Considerations for Building or Using APIsAPI Copyrights: New Considerations for Building or Using APIs
API Copyrights: New Considerations for Building or Using APIs
 
Using APIs to Program Disparate IoT Devices
Using APIs to Program Disparate IoT DevicesUsing APIs to Program Disparate IoT Devices
Using APIs to Program Disparate IoT Devices
 
Tuning IBMs Generational GC
Tuning IBMs Generational GCTuning IBMs Generational GC
Tuning IBMs Generational GC
 
PHP, Java EE & .NET Comparison
PHP, Java EE & .NET ComparisonPHP, Java EE & .NET Comparison
PHP, Java EE & .NET Comparison
 
The API Tempest
The API TempestThe API Tempest
The API Tempest
 

Similar a Protecting Your APIs Against Attack & Hijack

API Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfAPI Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfVishwas N
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdfVishwas N
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdfVishwasN6
 
CIS14: Best Practices You Must Apply to Secure Your APIs
CIS14: Best Practices You Must Apply to Secure Your APIsCIS14: Best Practices You Must Apply to Secure Your APIs
CIS14: Best Practices You Must Apply to Secure Your APIsCloudIDSummit
 
A great api is hard to find
A great api is hard to findA great api is hard to find
A great api is hard to findDan Diephouse
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez YalonAdar Weidman
 
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...apidays
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development PresentationTurnToTech
 
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAjin Abraham
 
OWASPAPISecurity
OWASPAPISecurityOWASPAPISecurity
OWASPAPISecurityJie Liau
 
apidays Australia 2023 - API Security Breach Analysis & Empowering Devs to M...
apidays Australia  2023 - API Security Breach Analysis & Empowering Devs to M...apidays Australia  2023 - API Security Breach Analysis & Empowering Devs to M...
apidays Australia 2023 - API Security Breach Analysis & Empowering Devs to M...apidays
 
API Security and Management Best Practices
API Security and Management Best PracticesAPI Security and Management Best Practices
API Security and Management Best PracticesCA API Management
 
Vices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
Vices & Devices - How IoT & Insecure APIs Became the New Cyber BattlefrontVices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
Vices & Devices - How IoT & Insecure APIs Became the New Cyber BattlefrontOry Segal
 
O Dell Secure360 Presentation5 12 10b
O Dell Secure360 Presentation5 12 10bO Dell Secure360 Presentation5 12 10b
O Dell Secure360 Presentation5 12 10bBruce O'Dell
 
Decoupled cms sunshinephp 2014
Decoupled cms sunshinephp 2014Decoupled cms sunshinephp 2014
Decoupled cms sunshinephp 2014Lukas Smith
 
What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...Kim Clark
 
Reaching 1 Million APIs and what to do when we get there
Reaching 1 Million APIs and what to do when we get thereReaching 1 Million APIs and what to do when we get there
Reaching 1 Million APIs and what to do when we get there3scale
 
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...Ajin Abraham
 

Similar a Protecting Your APIs Against Attack & Hijack (20)

API SECURITY
API SECURITYAPI SECURITY
API SECURITY
 
API Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfAPI Testing and Hacking (1).pdf
API Testing and Hacking (1).pdf
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdf
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdf
 
CIS14: Best Practices You Must Apply to Secure Your APIs
CIS14: Best Practices You Must Apply to Secure Your APIsCIS14: Best Practices You Must Apply to Secure Your APIs
CIS14: Best Practices You Must Apply to Secure Your APIs
 
A great api is hard to find
A great api is hard to findA great api is hard to find
A great api is hard to find
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
 
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
 
mobsf.pdf
mobsf.pdfmobsf.pdf
mobsf.pdf
 
OWASPAPISecurity
OWASPAPISecurityOWASPAPISecurity
OWASPAPISecurity
 
apidays Australia 2023 - API Security Breach Analysis & Empowering Devs to M...
apidays Australia  2023 - API Security Breach Analysis & Empowering Devs to M...apidays Australia  2023 - API Security Breach Analysis & Empowering Devs to M...
apidays Australia 2023 - API Security Breach Analysis & Empowering Devs to M...
 
API Security and Management Best Practices
API Security and Management Best PracticesAPI Security and Management Best Practices
API Security and Management Best Practices
 
Vices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
Vices & Devices - How IoT & Insecure APIs Became the New Cyber BattlefrontVices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
Vices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
 
O Dell Secure360 Presentation5 12 10b
O Dell Secure360 Presentation5 12 10bO Dell Secure360 Presentation5 12 10b
O Dell Secure360 Presentation5 12 10b
 
Decoupled cms sunshinephp 2014
Decoupled cms sunshinephp 2014Decoupled cms sunshinephp 2014
Decoupled cms sunshinephp 2014
 
What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...
 
Reaching 1 Million APIs and what to do when we get there
Reaching 1 Million APIs and what to do when we get thereReaching 1 Million APIs and what to do when we get there
Reaching 1 Million APIs and what to do when we get there
 
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
 

Más de CA API Management

Api architectures for the modern enterprise
Api architectures for the modern enterpriseApi architectures for the modern enterprise
Api architectures for the modern enterpriseCA API Management
 
Mastering Digital Channels with APIs
Mastering Digital Channels with APIsMastering Digital Channels with APIs
Mastering Digital Channels with APIsCA API Management
 
Takeaways from API Security Breaches Webinar
Takeaways from API Security Breaches WebinarTakeaways from API Security Breaches Webinar
Takeaways from API Security Breaches WebinarCA API Management
 
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...CA API Management
 
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...CA API Management
 
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...CA API Management
 
API Monetization: Unlock the Value of Your Data
API Monetization: Unlock the Value of Your DataAPI Monetization: Unlock the Value of Your Data
API Monetization: Unlock the Value of Your DataCA API Management
 
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...CA API Management
 
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...CA API Management
 
Enabling the Multi-Device Universe
Enabling the Multi-Device UniverseEnabling the Multi-Device Universe
Enabling the Multi-Device UniverseCA API Management
 
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...CA API Management
 
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...CA API Management
 
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...CA API Management
 
Adapting to Digital Change: Use APIs to Delight Customers & Win
Adapting to Digital Change: Use APIs to Delight Customers & WinAdapting to Digital Change: Use APIs to Delight Customers & Win
Adapting to Digital Change: Use APIs to Delight Customers & WinCA API Management
 
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...CA API Management
 
5 steps end to end security consumer apps
5 steps end to end security consumer apps5 steps end to end security consumer apps
5 steps end to end security consumer appsCA API Management
 
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...CA API Management
 
Gartner AADI Summit Sydney 2014 Implementing the Layer 7 API Management Pla...
Gartner AADI Summit Sydney 2014   Implementing the Layer 7 API Management Pla...Gartner AADI Summit Sydney 2014   Implementing the Layer 7 API Management Pla...
Gartner AADI Summit Sydney 2014 Implementing the Layer 7 API Management Pla...CA API Management
 
Using APIs to Create an Omni-Channel Retail Experience
Using APIs to Create an Omni-Channel Retail ExperienceUsing APIs to Create an Omni-Channel Retail Experience
Using APIs to Create an Omni-Channel Retail ExperienceCA API Management
 
Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...
 Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ... Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...
Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...CA API Management
 

Más de CA API Management (20)

Api architectures for the modern enterprise
Api architectures for the modern enterpriseApi architectures for the modern enterprise
Api architectures for the modern enterprise
 
Mastering Digital Channels with APIs
Mastering Digital Channels with APIsMastering Digital Channels with APIs
Mastering Digital Channels with APIs
 
Takeaways from API Security Breaches Webinar
Takeaways from API Security Breaches WebinarTakeaways from API Security Breaches Webinar
Takeaways from API Security Breaches Webinar
 
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
 
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...
 
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
 
API Monetization: Unlock the Value of Your Data
API Monetization: Unlock the Value of Your DataAPI Monetization: Unlock the Value of Your Data
API Monetization: Unlock the Value of Your Data
 
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...
 
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...
 
Enabling the Multi-Device Universe
Enabling the Multi-Device UniverseEnabling the Multi-Device Universe
Enabling the Multi-Device Universe
 
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...
 
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...
 
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...
 
Adapting to Digital Change: Use APIs to Delight Customers & Win
Adapting to Digital Change: Use APIs to Delight Customers & WinAdapting to Digital Change: Use APIs to Delight Customers & Win
Adapting to Digital Change: Use APIs to Delight Customers & Win
 
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...
 
5 steps end to end security consumer apps
5 steps end to end security consumer apps5 steps end to end security consumer apps
5 steps end to end security consumer apps
 
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...
 
Gartner AADI Summit Sydney 2014 Implementing the Layer 7 API Management Pla...
Gartner AADI Summit Sydney 2014   Implementing the Layer 7 API Management Pla...Gartner AADI Summit Sydney 2014   Implementing the Layer 7 API Management Pla...
Gartner AADI Summit Sydney 2014 Implementing the Layer 7 API Management Pla...
 
Using APIs to Create an Omni-Channel Retail Experience
Using APIs to Create an Omni-Channel Retail ExperienceUsing APIs to Create an Omni-Channel Retail Experience
Using APIs to Create an Omni-Channel Retail Experience
 
Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...
 Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ... Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...
Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...
 

Protecting Your APIs Against Attack & Hijack

  • 1. Protecting Your APIs Against Attack and Hijack K. Scott Morrison CTO Layer 7 Technologies
  • 2. Webinar Housekeeping Questions -Chat any questions you have and we’ll answer them at the end of this webinar Twitter - Today’s event hashtag: #L7webinar Follow us on Twitter: - @layer7 - @kscottmorrison Layer 7 Confidential
  • 3. Here Is What This Talk Is About:  The new API threat  Why is this a source of concern?  Are APIs just like the Web? Or are they different?  Look at three important areas: 1. Parameterization 2. Identity 3. Cryptography  How to apply the lessons of this talk
  • 4. What is an API? API Server Mobile App An API is a RESTful service Web Client Web App
  • 5. For Example: GET http://services.layer7.com/staff/Scott
  • 6. For Example: http://services.layer7.com/staff/Scott { "firstName": ”Scott ", "lastName" : ”Morrison", ”title" : “CTO”, "address" : { "streetAddress": ”405-1100 Melville", "city" : ”Vancouver", ”prov" : ”BC", "postalCode" : ”V6E 4A6" }, "phoneNumber": [ { "type" : ”office", "number": ”605 681-9377" }, { "type" : ”home", "number": ”604 555-4567" } ] }
  • 7. This is a Technological Sea Change Old New Transport HTTP HTTP Data XML JSON Authentication Basic, X.509, OAuth Kerberos, SAML Confidentiality & WS-Security SSL Integrity
  • 8. Where Simple Won SOAP + WS-* RESTful APIs • Complex • Simple • Highly • Informal standardized • Grassroots • Vendor driven • Frictionless • Barriers
  • 9. “Sounds great. So what’s the problem?”
  • 10. The Real Problem Is This: API Development != Web Development In Particular: We need to be wary of bad web development practices migrating to APIs…
  • 11. Problem Area #1: API Parameterization  In the traditional web world, parameterization was limited and indirect  Subject to the capabilities of URLs and forms  APIs in contrast and offer much more explicit parameterization  The full power of RESTful design: GET, POST, PUT, DELETE  (And don’t stop there… what about effects of HEAD, etc)?  This is a greater potential attack surface  Injection, bounds, correlation, and so on
  • 12. Good Web Apps Constrain Database Objects App Server Pages HTTP Server Constraint Space Web Client
  • 13. APIs Are A More Direct Conduit Often: • Self-documenting • Closely mapped to object space Database App Server Objects HTTP Server App
  • 15. Script Insertion is Just One Potential Exploit 2. Server fails to perform FIEO: Filter Input, Escape Output 3. Browser loads Web App Server content with (browser+APIs) embedded script API <SCRIPT …> 1. API injects script in Victim: Web Browser Client Attacker
  • 16. SQL Injection is Another Exploits of a Mom Source: https://xkcd.com/327/
  • 17. Mitigation Strategy  Rigorous validation of user supplied input  Stronger typing  Sets and ranges  Avoid auto-generated schemas that make everything a string  Use schema validation  XML Schema, RELAX-NG, Schematron  Please no DTDs!  JSON schema validation  WADL’s second coming
  • 18. Mitigation Strategy (cont.)  Regex scanning for signatures  Tune scanning for the API  Sometimes SELECT is OK  Virus scanning of attachments  Don’t forget B64’d message content  Library, service, or gateway solutions  Decoupled security  What are the tradeoffs?
  • 19. Mitigation Strategy  Whitelist tags if you can (i.e. where the validation space is small and concise)  Not always practical  (Note that I’m referring to whitelisting tags not IPs.)  Blacklist dangerous tags like <SCRIPT>  Always perform FIEO (Filter Input, Escape Output)  Learn more: http://xssed.com
  • 20. Problem Area #2: Identity  We had it surprisingly good in the Web world  Browser session usually tied to human  Dealing with one identity is not so tough  Security tokens abound, but solutions are mature – Username/pass, x.509 certs, multi-factor, Kerberos, SAML, etc  APIs rapidly becoming more difficult  Non-human entities  Multiple layers of relevant identities – Me, my attributes, my phone, my developer, my provider…
  • 21. API Keys “An application programing interface key (API key) is a code generated by websites that allow users to access their application programming interface. API keys are used to track how the API is being used in order to prevent malicious use or abuse of the terms of service. API keys are based on the UUID system to ensure they will be unique to each user.” (Source: wikipedia http://en.wikipedia.org/wiki/Application_programming_interface_key )
  • 22. For Example: GET http://example.layer7.com/services/staff ?APIKey=15458617-7813-4a37-94ac-a8e6da6f6405 Seriously? WTF.
  • 23. How Does An API Key Map To Identity? A person? A Or an app? 15458617-7813-4a37-94ac-a8e6da6f6405 It is entirely inconsistent
  • 24. The Identity Profile Increasingly we need to move toward large number of claims (multiple identity profile) • appID • User attributes • userID • Roles • Geo location • deviceID • IP • User agent • Time of day • etc
  • 25. Where Did API Keys Come From?  API keys came from Google APIs like maps, early Yahoo APIs, early Twitter APIs etc.  Originally meant for loose, non-authoritative tracking  Rate limits, approximate usage profiling  Google geocoding v3.0 API deprecates API keys  Uses IP instead to track and throttle  This has its own set of problems  IP address spoofing  Problems with legitimate clients like cloud servers  Google Premier uses a public client_id and requires signed URLs  (Strips domain leaving only path and query parameters)
  • 26. The Problem with API Keys: It’s a kind of like ad-hoc session tracking  This is a web developer cultural issue  On the web, session tokens are rarely secured  Step 1: Sign in with SSL  Steps 2 to n: Track session using cookie without SSL  There are two bad things going on here: 1. No protection of security token 2. No binding of token to message content These two things are very related  In 2012, this is a huge problem…
  • 27. One Word: Firesheep In the post Firesheep world, unprotected session tracking should never be tolerated… Source: http://codebutler.com/firesheep
  • 28. Bottom Line: The API Key Was Never Meant To Be Authoritative  Strange hybrid of HTTP’s USER-AGENT and session continuity  OK only for general tracking  Anything that matters should use real security tokens  Anywhere where identity is important:  APIs that provide access to sensitive data  APIs that change things that matter  APIs that charge for use  etc.
  • 29. Twitter (kind of) Gets It
  • 30. Will OAuth survive adolescence?  Complexity and confusion  Interop is a nightmare right now  Enterprise token management  Beyond the timeout  Lifecycle, revocation, distribution, etc.  Talk, but not a lot of action  SSL everywhere  Protect bearer tokens  Phishing vulnerabilities  Server authentication and loss of trust in the CA infrastructure
  • 31. Mitigation  Protect the tokens! Important!  HTTPS everywhere  This is another web design cultural issue  It’s just not that expensive any more  Need HTTP Strict Transport Security (HSTS) for APIs  http://en.wikipedia.org/wiki/HTTP_Strict_Transport_S ecurity
  • 32. Problem Area #3: Cryptography and PKI  Cryptography is reasonably mature on the web  Surprisingly limited use patterns  SSL/TLS  Very little tough PKI (like client-side)  So what’s wrong with APIs?
  • 33. It’s Like We Forgot Everything We Knew  Emailing keys  API, shared secrets, etc.  Bad storage schemes  Security through obscurity  Toy ciphers  No life cycle management  Limits on use  Time limits  Revocation  Audit
  • 34. The Issues  Key management  Especially across farms  Nobody takes web PKI seriously  CRLs and OCSP aren’t much good in the browser world  Fail open—seriously  CA trust breakdown  Comodo fraud in March 2011
  • 35. The Issues (cont.)  Cipher suite restrictions  Avoiding downgrades  Client-side certificate authentication is hard  The alternatives for parameter confidentiality and/or integrity are hard:  XML encryption is still there  Not for the faint of heart  OAuth 1.0 gave you parameter signing  Only optional in 2.0  JWT signing and encryption emerging
  • 36. Mitigations  Use real PKI  I know it’s painful  Use HSMs to protect keys that really matter  Otherwise use real key material protection schemes  PKCS #12, etc  Libraries abound
  • 37. Mitigations  You must do CRLs and OCSP for APIs  Google maintains a certificate registry: http://googleonlinesecurity.blogspot.com/2011/04 /improving-ssl-certificate-security.html  Google safe browsing API: http://code.google.com/apis/safebrowsing/devel opers_guide_v2.html  Blacklist of phishing and malware sites  DANE and DNSSEC
  • 38. Where Does This All Leave Us?  SOAP, the WS-* stack dealt with much of this very rigorously  But it was just too hard.  We need to learn from this, but make it easier to implement  Here’s how…
  • 39. How Do I Apply This Today?  Use SSL for all API transactions  Hides many sins  Confidentiality, integrity, replay, binding token+message, server authentication, etc.  Use real PKI  Yes, it’s hard  But you can’t skimp here  Use OAuth & OpenID Connect for distributed authentication  Use real frameworks, don’t reinvent  They exist for most languages  Consider gateways to encapsulate security
  • 40. Solution: Layer 7 API Proxy API Gateway Cluster at Edge of Network Servers  DMZ deployment Firewall 2  Hardware appliance, virtual appliance or software Firewall 1 … Enterprise Network API Proxy Cluster API Client
  • 41. Solution: Layer 7 API Portal API/Service API Program Management Servers  Client-developer management  Business-oriented API management  DMZ deployment  Virtual Appliance … Enterprise Network API Portal API Managers Client App Developers
  • 42. Upcoming Events Tech Talk Tuesday January 29th – 9am PST Bursting & Amazon Cloud Auto-scale http://layer7.com/live Valentines Special Webinar February 7th – 9am PST Be My API: How to Implement an API Strategy Everyone will Love http://events.layer7tech.com/myAPI
  • 43. For further information: K. Scott Morrison Chief Technology Officer Layer 7 Technologies 1100 Melville St, Suite 405 Vancouver, B.C. V6E 4A6 Canada (800) 681-9377 smorrison@layer7tech.com http://www.layer7tech.com