asfws 2012 - oauth : un protocole d’autorisation qui authentifie ? par maxime...
DESCRIPTION
“Sign-in using your facebook, google, linked-in or twitter account…” Porté notamment par les grands acteurs des réseaux sociaux, Oauth est devenu un standard difficilement contournable dans le paysage de la fédération d’identité. Authentifier c’est s’assurer qu’une entité est bien celle qu’elle prétend être. Oauth, quant à lui, se définit comme un “framework” d’autorisation permettant à des applications d’accéder aux données d’un utilisateur en lui demandant sa permission. Pourtant un usage important (Sign-in) semble être l’authentification… Simple question de sémantique ? Ou réelle subtilité, qui mal comprise, pourrait nous conduire à de mauvaises implémentations ? En ayant a cœur de répondre à cette question, cette présentation propose de regarder “sous le capot” de ce protocole. De Oauth 1.0 a Oauth 2.0 comment est-ce que cela fonctionne ? est-ce vrai qu’un token d’accès Oauth peut être réutilisé pour “usurper une identité” ? Et par rapport à SAML & OpenId : est-ce différent ou complémentaire ?TRANSCRIPT
![Page 1: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/1.jpg)
Application Security Forum - 2012 Western Switzerland
7-8 novembre 2012 - Y-Parc / Yverdon-les-Bains https://www.appsec-forum.ch
Oauth : un protocole d'autorisation qui authentifie ?
Maxime Féroul
Directeur Technique / KYOS IT SECURITY
![Page 2: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/2.jpg)
# who -m
Ingénieur Informatique & Télécom (ESIGETEL / France)
15 ans d'expérience : web-hosting & sécurité
Co-fondateur de Kyos IT Security (2002) : 10 ans ;)
– Pen-testing & intégration & IAM
– Recherche EU : SEINIT, DEMONS,...
– Spacecom : le wifi est correct ?
Domaines de prédilection : en ce moment J2ee & IAM
Ambition : Une vision globale au prix de moins de
2
![Page 3: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/3.jpg)
Agenda
Contexte : Social Login
Oauth 2.0 : Sous le capot
Implicit Flow : ou Implicit Flaw ?
Mitigation : La bonne implémentation
3
![Page 4: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/4.jpg)
Perturbation atmosphérique...
4
Poursuite de la décentralisation des SI
Utilisation de plateformes “tierces”, en dehors de son domaine de sécurité
Nouveaux défis pour le contrôle d'accès
Identités Multiples, BYOD, “Information and
user centric”, ...
![Page 5: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/5.jpg)
SIMPLICITÉ UTILISATEUR,
FACILITÉ DE MISE EN OEUVRE
& SÉCURITÉ
...et toujours le même “Graal“
![Page 6: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/6.jpg)
Emergence du “Social Login“
6
Utiliser les services d'authentification d'une plateforme de réseau social
![Page 7: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/7.jpg)
Social Login – Pourquoi ?
Pour l'utilisateur
– Moins de login & mot de passe
– Meilleure gestion de ses identités
• Facebook → sites perso., linkedin → sites pro., …
• Meilleur « contrôle » : révoquer les applications
![Page 8: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/8.jpg)
Social Login – Pourquoi ?
Pour le fournisseur de service
– Enregistrement simplifié
– Information plus fiable
– Plus d'information !
![Page 9: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/9.jpg)
Social Login – Comment ?
Etablir un « lien de confiance », fédérer les identités
Déléguer l'authentification et l'autorisation
Echanger des informations sur l'identité
![Page 10: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/10.jpg)
Oauth 2.0
UMA
Standards : Maelström ?
SOAP, XML
Framework / service d'identité
Framework / message Web Service
Global & très modulaire
Connotation “Microsoft & IBM”
WS-Security, WS-Federation, WS-Trust,...
Web Centric API Délégation de l'autorisation
User Centric REST,
JSON
Authentification, SSO, Federation
Autorisation
SAML assertion
Profile, protocol, bindings,...
“couche identité” au dessus de OAuth 2.0
Connotation “Standard Entreprise”
Connotation “web / end-user”
Authentification, session, attributs d'identité,...
![Page 11: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/11.jpg)
Oauth 2.0 – Emergence
REST, Simplicité, “designed for the web...”
Facebook, Google, Salesforce,...
![Page 12: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/12.jpg)
Agenda
Contexte : Social Login
Oauth 2.0 : Sous le capot
Implicit Flow : ou Implicit Flaw ?
Mitigation : La bonne implémentation
12
![Page 13: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/13.jpg)
Password anti-pattern
13
Bonjour BLOG, j'aimerais aussi que tu publies mes “posts” sur Facebook ?
Pas de problème, donne moi ton login et ton mot de passe Facebook, je m'y connecterais en ton nom pour mettre à jour ton profil...
Tu m'excuses mais j'ai moyennement confiance en toi BLOG, tu ne peux pas faire autrement que stocker mes “crédentiels” ?
![Page 14: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/14.jpg)
Oauth 2.0 – Framework d'autorisation
14
Permettre à des applications et des fournisseurs de services d’accéder à des données d’un utilisateur en lui demandant sa permission.
![Page 15: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/15.jpg)
Oauth 2.0 – Rôles
Resource Owner
Client Authorization Server
Un internaute Utilise un blog
Resource Server
En s'authentifiant via Facebook et pour également publier ses « posts » sur son profil
Par exemple :
![Page 16: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/16.jpg)
Oauth 2.0 – Principe
16
Client
Resource Server
Authorization Server
S'authentifie et autorise l'application (client)
Délivre le token d'accès Accède au
service 1.1.
2.2.
3.3.
Accède à la ressource protégée
4.4.
Délègue l'autorisation
![Page 17: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/17.jpg)
Oauth 2.0 – Spécification
17
Client type & profile
– Confidential, public & WebApp, user agent, native
Endpoints – Authorization, Token, Redirection
Plusieurs types de « jeton d'autorisation » – Authorization Code, Implicit, Resource Owner Password
Credentials, Client Credentials
– Des requêtes et réponses pour chaque type
![Page 18: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/18.jpg)
Oauth 2.0 – Question de départ
Ok pour le password anti-pattern et l'autorisation – Mais alors quel rapport avec le social login ?
– Comment “authentifier” ?
Authentifier c'est obtenir des attributs d'identité et prouver/valider qu'ils sont justes
18
Oauth : un protocole d'autorisation qui authentifie ?
Oauth permet d'accéder à des données d'identité !
![Page 19: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/19.jpg)
Oauth 2.0 – Comment authentifier ?
19
1.) BLOG demande à BORIS l'autorisation d'aller récupérer chez Facebook les données relatives à son identité pour l'authentifier.
2.) BORIS s'authentifie chez Facebook et autorise BLOG à lire ses données d'identité.
Nom Prénom Email Login
Profil Boris
![Page 20: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/20.jpg)
Agenda
Contexte : Social Login
Oauth : Sous le capot
Implicit Flow : ou Implicit Flaw ?
Mitigation : La bonne implémentation
20
![Page 21: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/21.jpg)
Oauth 2.0 – Implicit Flow
Délivrance « directe » du token d'accès
Moins d'échanges
Application mobile (native)
Application JavaScript (user-agent)
21
RECHERCHE DE LA
SIMPLICITÉ
![Page 22: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/22.jpg)
Exemple – Authentification Facebook 22
Sign in via Facebook
Redirect vers Facebook OAuth Implicit request AppId, redirectUri(blog.jsp)
Authentification
+ Autorisation de AppId
OAuth Implicit response Redirect vers redirectUri(blog.jsp) +AccessToken(xxxx)
Get /blog.jsp?AToken=xxxx
Get /graphAPI?AToken=xxxx
JSON object userId=Boris
Welcome Boris !
![Page 23: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/23.jpg)
Access Token – Attention ! 23
« ...This specification does not provide any methods for the
resource server to ensure that
an access token presented to
it by a given client was issued to that client by the
authorization server. »
Source : draft-ietf-oauth-v2-31
![Page 24: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/24.jpg)
Implicit Flow – Usurpation 24
Auth.+ Auto. AccessToken
Get /ninjagame.jsp?AToken=ABXYZ
Get /graphAPI?AToken=ABXYZ
userId=Boris
Welcome on NinjaGame Boris !
Réutilisation du token !
Get /graphAPI?AToken=ABXYZ
Welcome Boris !
Get /blog.jsp?AToken=ABXYZ
userId=Boris
![Page 25: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/25.jpg)
La « spec. » nous avais prévenu... 25
Source : draft-ietf-oauth-v2-31
«... Authenticating Resource Owners to clients is out of scope for this specification.
Any specification that uses the authorization process as a form of delegated end-user authentication to
the client (e.g. third-party sign-in service) MUST NOT
use the implicit flow without additional security mechanisms such as audience restricting the access
token that enable the client to determine if the access token was issued for its use. »
![Page 26: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/26.jpg)
Est ce que cela nous concerne ? 26
Oui si nous implémentons “nous-même” ou sans les framework proposés
N'est ce pas plutôt un « problème » pour facebook, google, et consorts ?
Oui si nous vérifions des implémentations
Oui pour notre culture et une meilleure compréhension d'Oauth ;)
![Page 27: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/27.jpg)
Agenda
Contexte : Social Login
Oauth : Sous le capot
Implicit Flow : ou Implicit Flaw ?
Mitigation : La bonne implémentation
27
![Page 28: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/28.jpg)
Mitigation – Implicit Flow
Restreindre l'audience / valider le token d'accès avant d'authentifier
– Signed request (Facebook JavaScript SDK)
– Service de validation du token
![Page 29: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/29.jpg)
Mitigation – Server Side Flow 29
Sign in via Facebook
Redirect vers Facebook OAuth Authorization request AppId, redirectUri(blog.jsp)
Authentification + Autorisation de AppId OAuth Authorization response
Redirect vers redirectUri(blog.jsp) +Code(xxxx)
Get /blog.jsp?Code=xxxx
Get /graphAPI?AToken=yyyy
JSON object userId=Boris
Welcome Boris !
OAuth Access Token request AppId, Code, redirectUri(blog.jsp)
AccessToken=yyyy Lié à l'AppId donc invalide
pour une autre app !
![Page 30: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/30.jpg)
Mitigation – OpenId Connect 30
OAUTH 2.0 Layer
IDENTITY Layer
UserInfo endpoint
– Fournisseur d'information d'identité
ID token objects – Informations sur les évenements
d'authentification (i.e audience, contexte, temps,...)
Une extension de Oauth 2.0
![Page 31: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/31.jpg)
Conclusion
Un protocole d'autorisation ...
… mais qui peut servir à authentifier ...
… à condition de l'implémenter correctement.
31
Les mécanismes de sécurité existent, il faut veiller à les utiliser et à les vérifier.
… au prix d'un peu de compléxité ...
« Il n'y a pas de simplicité véritable, il n'y a que des simplifications » Léon Paul Farge
![Page 32: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/32.jpg)
Questions?
32
Principales Sources http://www.thread-safe.com/2012/01/problem-with-oauth-for-authentication.html
by John Bradley
http://www.independentid.com/2011/04/oauth-does-it-authenticate-wellyes-and.html by Phil Hunt
http://vennofidentity.org/ by Eve Maler
http://oauth.net/2/
http://tools.ietf.org/html/draft-ietf-oauth-v2-31
http://openid.net/connect/
https://developers.facebook.com/docs/concepts/login/
https://developers.google.com/accounts/docs/OAuth2
![Page 33: ASFWS 2012 - OAuth : un protocole d’autorisation qui authentifie ? par Maxime Feroulcole_qui_authentifie](https://reader033.vdocument.in/reader033/viewer/2022051211/555a86e6d8b42a98568b5162/html5/thumbnails/33.jpg)
Merci/Thank you!
Contact:
http://www.kyos.ch
Slides:
http://slideshare.net/ASF-WS/presentations
33