SlideShare uma empresa Scribd logo
1 de 45
Initiation à la sécurité des
Web Services (SOAP vs REST)

  Sylvain MARET
  Principal Consultant / MARET Consulting

  OpenID Switzerland & OWASP Switzerland
                                           Application Security Forum - 2012
                                                           Western Switzerland

                                       7-8 novembre 2012 - Y-Parc / Yverdon-les-Bains
                                       https://www.appsec-forum.ch
08.11.2012, Version 1.1 @smaret
2




Agenda
   Qu’est-ce qu’un Web Service ?
   SOAP
   REST
   Threat Modeling / ACME SA
   Réduction des risques
   Conclusion
   Questions
3




Bio
   18 years of experience in ICT Security
   Principal Consultant at MARET Consulting
   Expert at Engineer School of Yverdon
   Swiss French Area delegate at OpenID Switzerland
   Co-founder Geneva Application Security Forum
   OWASP Member
   Author of the blog: la Citadelle Electronique
   http://ch.linkedin.com/in/smaret or @smaret
   http://www.slideshare.net/smaret

 Chosen field
     – AppSec & Digital Identity Security
4




Agenda
    Qu’est-ce qu’un Web Service ?
    SOAP
    REST
    Threat Modeling / ACME SA
    Réduction des risques
    Conclusion
    Questions
5




Web Service: la base….
6




Web Service ?



                XML, JSON,   Provider
     Consumer     etc.
7




Un peu d’histoire

   1990 : DCE/RPC – Distributed Computing Environment
   1992 : CORBA – Common Object Request Broker Architecture
   1990-1993 : Microsoft’s DCOM -- Distributed Component Object Model
   1995: RMI – Monde Java

 Pour arriver à une standardisation (toujours en cours) des protocoles, outils,
  langages et interfaces

     – SOAP
     – REST
     – Etc.
                               Web Service
8




Agenda
    Qu’est-ce qu’un Web Service ?
    SOAP
    REST
    Threat Modeling / ACME SA
    Réduction des risques
    Conclusion
    Questions
9




SOAP vs REST ?
10




SOAP: Les ingrédients
11




SOAP: Démystification des technologies
 Langages
   – XML
   – WSDL : Descripteur du service
   – UDDI: Annuaire des services
 Protocoles
   – Transport: HTTP, HTTPS, SMTP, FTP, SMS, TFTP, SSH, etc. (TCP or UDP)
   – Message: Enveloppe SOAP
 Sécurité
   – WS-Security (Signature & Chiffrement)
 Autres éléments
   – AuthN: SAML, X509, Username & Password, Kerberos, HTTP Digest, etc.
12




Enveloppe SOAP

                       - SOAP : Simple Object Access Protocol

                       - Permet l’envoi de messages XML

                       - Agnostique au moyen de transport
                           - HTTP
                           - HTTPS
                           - FTP
                           - etc.




   Source= wikipédia
13




SOAP request




               SOAP response
14




UDDI
 Universal Description Discovery and Integration, connu
  aussi sous l'acronyme UDDI, est un annuaire de services
  fondé sur XML et plus particulièrement destiné aux
  services Web.
15




WSDL
 WSDL est une grammaire XML permettant
  de décrire un Service Web.

 Le WSDL sert à décrire :
    – le format de messages requis pour communiquer avec ce
      service
    – les méthodes que le client peut invoquer
    – la localisation du service
    – le protocole de communication (SOAP RPC ou SOAP orienté
      message)

http://fr.wikipedia.org/wiki/Web_Services_Description_Language
16




WSDL




http://predic8.com/wsdl-reading.htm
17




WSDL: exemple
18




SOAP: Démystification des protocoles
    Découverte                  UDDI



    Description                WSDL



      Message               SOAP / XML


                  HTTP, HTTPS, FTP, SFTP, SMS, SMTP
    Protocole
                            (TCP or UDP)


     Transport                   IP
19




Agenda
    Qu’est-ce qu’un Web Service ?
    SOAP
    REST
    Threat Modeling / ACME SA
    Réduction des risques
    Conclusion
    Questions
20




REST: Les ingrédients
21




REST: Démystification des technologies
 Langages
   – XML
   – JSON
   – XHTML, HTML, PDF... as data formats
 Protocoles
   – HTTP(s)  Utilisation d’une URL
   – Méthode de communication (GET, POST, PUT, DELETE)
 Sécurité
   – Sécurité du transport (SSL/TLS)
   – Sécurité des messages: HMAC & Doseta (Like XML Signature)
 Autres éléments
   – Oauth, API Keys
22




Représentation REST (exemple JSON)
23




Méthodes REST
24




REST: Démystification des protocoles
        Découverte                             ???


         Description                    WADL, Swagger ***


           Message                       XML, JSON, etc.


         Protocole                         HTTP, HTTPS


          Transport                          TCP/IP


*** Avant-gardiste mais peux utiliser
25
26




SOAP vs REST
27




Agenda
    Qu’est-ce qu’un Web Service ?
    SOAP
    REST
    Threat Modeling / ACME SA
    Réduction des risques
    Conclusion
    Questions
28




http://fr.wikipedia.org/wiki/Diagramme_de_flux_de_donn%C3%A9es
29
30




Modèle STRIDE




 https://www.owasp.org/index.php/Application_Threat_Modeling
31




Menaces selon le DFD Acme SA
 Threat 1
  – Interception des messages (Information disclosure)
  – Modification des messages (Tampering)
  – Usurpation d’identité (Spoofing)


 Threat 2
  – Attaque de l’application
     •   BoF
     •   Injection
     •   DoS & DDoS
     •   Etc
32




Agenda
    Qu’est-ce qu’un Web Service ?
    SOAP
    REST
    Threat Modeling / ACME SA
    Réduction des risques
    Conclusion
    Questions
33



ACME SA: Réduction
des risques ?

   Chiffrement du transport
   AuthN
   SSL Mutual AuthN / X509
   WAF / XML Gateway
   Intégrité et confidentialité des messages
   Secure Coding
34




Chiffrement du transport
                 SOAP / XML           REST
HTTPS                         HTTPS
SSL/TLS tunnel
SSH
IPSEC
Etc.
35




AuthN
              SOAP / XML                               REST
HTTP Basic, Digest,              HTTP Basic, Digest,
HTTP Header                      HTTP Header
Mutual SSL                       Mutual SSL
IP trust                         IP trust
WS Security user name password   Oauth
WS SAML Authentication token     API Keys
XML Signature
Kerberos
Etc.
36




SSL Mutual AuthN / X509 / PKI
               SOAP / XML                                    REST
SSL/TLS Mutual AuthN**                      SSL/TLS Mutual AuthN**




** Man in the middle not possible… (As I Know)
37




WAF / XML Gateway (Protection périmétrique)
               SOAP / XML                     REST
Reverse Proxy               Reverse Proxy
Contrôle requêtes HTTP      Contrôle requêtes HTTP
Rupture SSL/TLS             Rupture SSL/TLS
Black List                  Black List
White List                  White List
Validation WSDL
Signature & Verification
Encryption & Decryption
SAML
38




Intégrité et confidentialité des messages
                 SOAP / XML                        REST
XML Signature                 •(p.ex: HMAC, Doseta)
XML Encryption                • JSON Signature
                              • **




                                   ** Pas de chiffrement à ma connaissance
39




Code security
                 SOAP / XML                                          REST
- Data input validation                          - Data input validation
- Data output encoding                           - Data output encoding
- Pseudorandom data generation, high             - Pseudorandom data generation, high
entropy                                          entropy
- Strong / reliable data encryption algorithms   - Strong / reliable data encryption algorithms
- Data leakage prevention                        - Data leakage prevention
- Robust error & exception handling              - Robust error & exception handling
- Anti-automation and expiration measures        - Anti-automation and expiration measures

OWASP Application Security Verification Standard (ASVS):
https://www.owasp.org/index.php/ASVS
WASC web application weaknesses:
http://projects.webappsec.org/w/page/13246978/Threat%20Classification
40




REST & OAuth
41




Agenda
    Qu’est-ce qu’un Web Service ?
    SOAP
    REST
    Threat Modeling / ACME SA
    Réduction des risques
    Conclusion
    Questions
42




Conclusion
 SOAP:
    –   Implémenter les standards WS-* liés à la sécurité
    –   Mettre en place un filtrage applicatif (WAF, XML GW)
    –   Complexe à mettre en œuvre (PKI, Secure coding, Cryptography, etc.)
    –   Architecture à forte contrainte de sécurité


 REST
    – Mettre en place un filtrage applicatif (WAF, XML GW)
    – Implémentation rapide et facile  tendance
    – Architecture de type Cloud, Intranet, Social Login, etc.


 On attend avec impatience les standards sécu pour REST ???
   – Pragmatique: protection périmétrique, chiffrement et Secure Coding ???
43




Pour aller plus loin….
44




Questions?
45




Merci / Thank you!

Contact:
   sma@maret-consulting.ch
   @smaret
   http://www.maret-consulting.ch
   Slides:
      http://slideshare.net/ASF-WS/

Mais conteúdo relacionado

Mais procurados (10)

Soa & services web
Soa & services webSoa & services web
Soa & services web
 
Chp3 - Les Services Web
Chp3 - Les Services WebChp3 - Les Services Web
Chp3 - Les Services Web
 
Support Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFISupport Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFI
 
Sécurité des web services soap
Sécurité des web services soapSécurité des web services soap
Sécurité des web services soap
 
Architectures orientées services
Architectures orientées servicesArchitectures orientées services
Architectures orientées services
 
Fonctionnalités JBoss ESB
Fonctionnalités JBoss ESBFonctionnalités JBoss ESB
Fonctionnalités JBoss ESB
 
Services web soap-el-habib-nfaoui
Services web soap-el-habib-nfaouiServices web soap-el-habib-nfaoui
Services web soap-el-habib-nfaoui
 
Chap1 p1-introduction
Chap1 p1-introductionChap1 p1-introduction
Chap1 p1-introduction
 
Presentation SOAP
 Presentation SOAP Presentation SOAP
Presentation SOAP
 
Sécurisation des services WCF avec WS-Security
Sécurisation des services WCF avec WS-SecuritySécurisation des services WCF avec WS-Security
Sécurisation des services WCF avec WS-Security
 

Destaque

ASFWS 2012 - Node.js Security – Old vulnerabilities in new dresses par Sven V...
ASFWS 2012 - Node.js Security – Old vulnerabilities in new dresses par Sven V...ASFWS 2012 - Node.js Security – Old vulnerabilities in new dresses par Sven V...
ASFWS 2012 - Node.js Security – Old vulnerabilities in new dresses par Sven V...
Cyber Security Alliance
 
Putevoditel v krym_2013
Putevoditel v krym_2013Putevoditel v krym_2013
Putevoditel v krym_2013
Pasha
 
Sara Mahmoud Resume - Trans
Sara Mahmoud Resume - TransSara Mahmoud Resume - Trans
Sara Mahmoud Resume - Trans
Sara Mahmoud
 
Chiffres clés de l'automédication 2010
Chiffres clés de l'automédication 2010Chiffres clés de l'automédication 2010
Chiffres clés de l'automédication 2010
Morgan REMOLEUR
 

Destaque (20)

ASFWS 2012 - Node.js Security – Old vulnerabilities in new dresses par Sven V...
ASFWS 2012 - Node.js Security – Old vulnerabilities in new dresses par Sven V...ASFWS 2012 - Node.js Security – Old vulnerabilities in new dresses par Sven V...
ASFWS 2012 - Node.js Security – Old vulnerabilities in new dresses par Sven V...
 
Node.JS security
Node.JS securityNode.JS security
Node.JS security
 
Server Side Apocalypse, JS
Server Side Apocalypse, JSServer Side Apocalypse, JS
Server Side Apocalypse, JS
 
Javascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stackJavascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stack
 
Surviving Web Security - Node Interactive
Surviving Web Security - Node InteractiveSurviving Web Security - Node Interactive
Surviving Web Security - Node Interactive
 
Blue Ocean Strategy Case Seats2meet
Blue Ocean Strategy Case Seats2meetBlue Ocean Strategy Case Seats2meet
Blue Ocean Strategy Case Seats2meet
 
Frank allen
Frank allenFrank allen
Frank allen
 
9 unknown mistakes you may be making while promoting your brand on social media
9 unknown mistakes you may be making while promoting your brand on social media9 unknown mistakes you may be making while promoting your brand on social media
9 unknown mistakes you may be making while promoting your brand on social media
 
Interactie en onderhouden
Interactie en onderhoudenInteractie en onderhouden
Interactie en onderhouden
 
Flavio Cattaneo: Nuovi massimi storici per Terna (La Stampa)
Flavio Cattaneo: Nuovi massimi storici per Terna (La Stampa)Flavio Cattaneo: Nuovi massimi storici per Terna (La Stampa)
Flavio Cattaneo: Nuovi massimi storici per Terna (La Stampa)
 
Sharing motivation
Sharing motivationSharing motivation
Sharing motivation
 
Yakinlah pada diri
Yakinlah pada diriYakinlah pada diri
Yakinlah pada diri
 
Putevoditel v krym_2013
Putevoditel v krym_2013Putevoditel v krym_2013
Putevoditel v krym_2013
 
Flavio Cattaneo: La scommessa (proibita) di Terna che imbarazza Eni ed Enel
Flavio Cattaneo: La scommessa (proibita) di Terna che imbarazza Eni ed EnelFlavio Cattaneo: La scommessa (proibita) di Terna che imbarazza Eni ed Enel
Flavio Cattaneo: La scommessa (proibita) di Terna che imbarazza Eni ed Enel
 
Global educational consultancies directory
Global educational consultancies directoryGlobal educational consultancies directory
Global educational consultancies directory
 
Xero
XeroXero
Xero
 
Ismael plascencia hábitos saludables
Ismael plascencia hábitos saludablesIsmael plascencia hábitos saludables
Ismael plascencia hábitos saludables
 
Sara Mahmoud Resume - Trans
Sara Mahmoud Resume - TransSara Mahmoud Resume - Trans
Sara Mahmoud Resume - Trans
 
Chiffres clés de l'automédication 2010
Chiffres clés de l'automédication 2010Chiffres clés de l'automédication 2010
Chiffres clés de l'automédication 2010
 
8.QAI-CMMI Dev-V1.3
8.QAI-CMMI Dev-V1.38.QAI-CMMI Dev-V1.3
8.QAI-CMMI Dev-V1.3
 

Semelhante a ASFWS 2012 WS Security - REST vs SOAP par Sylvain Maret

Cours services web_fabrice_mourlin
Cours services web_fabrice_mourlinCours services web_fabrice_mourlin
Cours services web_fabrice_mourlin
angeeLee
 
2 20 presentations_generales_des_web_services
2 20 presentations_generales_des_web_services2 20 presentations_generales_des_web_services
2 20 presentations_generales_des_web_services
Camus LANMADOUCELO
 
Client riche et nouvelles technologies
Client riche et nouvelles technologiesClient riche et nouvelles technologies
Client riche et nouvelles technologies
Sébastien Letélié
 
Asterid: Linked Data Asterisms
Asterid: Linked Data AsterismsAsterid: Linked Data Asterisms
Asterid: Linked Data Asterisms
Gregoire Burel
 

Semelhante a ASFWS 2012 WS Security - REST vs SOAP par Sylvain Maret (20)

soapC1.pdfnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
soapC1.pdfnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnsoapC1.pdfnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
soapC1.pdfnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
 
Présentation SOA
Présentation SOAPrésentation SOA
Présentation SOA
 
Cours services web_fabrice_mourlin
Cours services web_fabrice_mourlinCours services web_fabrice_mourlin
Cours services web_fabrice_mourlin
 
2 20 presentations_generales_des_web_services
2 20 presentations_generales_des_web_services2 20 presentations_generales_des_web_services
2 20 presentations_generales_des_web_services
 
Web services SOAP et REST
Web services  SOAP et RESTWeb services  SOAP et REST
Web services SOAP et REST
 
Démystifions l'API-culture!
Démystifions l'API-culture!Démystifions l'API-culture!
Démystifions l'API-culture!
 
Soap
SoapSoap
Soap
 
xml-webservices-intro.pdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
xml-webservices-intro.pdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhxml-webservices-intro.pdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
xml-webservices-intro.pdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
 
Web APIs in Action (in French)
Web APIs in Action (in French)Web APIs in Action (in French)
Web APIs in Action (in French)
 
Protocoles SSL/TLS
Protocoles SSL/TLSProtocoles SSL/TLS
Protocoles SSL/TLS
 
Client riche et nouvelles technologies
Client riche et nouvelles technologiesClient riche et nouvelles technologies
Client riche et nouvelles technologies
 
LemonLDAP::NG et le support SAML2
LemonLDAP::NG et le support SAML2LemonLDAP::NG et le support SAML2
LemonLDAP::NG et le support SAML2
 
(protocoles)
(protocoles)(protocoles)
(protocoles)
 
S51 vos projets web services ibm i a l aide de php
S51   vos projets web services ibm i a l aide de phpS51   vos projets web services ibm i a l aide de php
S51 vos projets web services ibm i a l aide de php
 
Asterid: Linked Data Asterisms
Asterid: Linked Data AsterismsAsterid: Linked Data Asterisms
Asterid: Linked Data Asterisms
 
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUESARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
 
SL2009 - Identity Management Cycle - LDAP synchronization and WebSSO
SL2009 - Identity Management Cycle - LDAP synchronization and WebSSOSL2009 - Identity Management Cycle - LDAP synchronization and WebSSO
SL2009 - Identity Management Cycle - LDAP synchronization and WebSSO
 
.NET DotNet CF - 3
.NET DotNet CF - 3.NET DotNet CF - 3
.NET DotNet CF - 3
 
Asp.Net Web.API, SignalR et UX : le futur
Asp.Net Web.API, SignalR et UX : le futurAsp.Net Web.API, SignalR et UX : le futur
Asp.Net Web.API, SignalR et UX : le futur
 
Architecture orientée service (SOA)
Architecture orientée service (SOA)Architecture orientée service (SOA)
Architecture orientée service (SOA)
 

Mais de Cyber Security Alliance

Killing any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented featureKilling any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented feature
Cyber Security Alliance
 

Mais de Cyber Security Alliance (20)

Bug Bounty @ Swisscom
Bug Bounty @ SwisscomBug Bounty @ Swisscom
Bug Bounty @ Swisscom
 
Robots are among us, but who takes responsibility?
Robots are among us, but who takes responsibility?Robots are among us, but who takes responsibility?
Robots are among us, but who takes responsibility?
 
iOS malware: what's the risk and how to reduce it
iOS malware: what's the risk and how to reduce itiOS malware: what's the risk and how to reduce it
iOS malware: what's the risk and how to reduce it
 
Why huntung IoC fails at protecting against targeted attacks
Why huntung IoC fails at protecting against targeted attacksWhy huntung IoC fails at protecting against targeted attacks
Why huntung IoC fails at protecting against targeted attacks
 
Corporations - the new victims of targeted ransomware
Corporations - the new victims of targeted ransomwareCorporations - the new victims of targeted ransomware
Corporations - the new victims of targeted ransomware
 
Blockchain for Beginners
Blockchain for Beginners Blockchain for Beginners
Blockchain for Beginners
 
Le pentest pour les nuls #cybsec16
Le pentest pour les nuls #cybsec16Le pentest pour les nuls #cybsec16
Le pentest pour les nuls #cybsec16
 
Introducing Man in the Contacts attack to trick encrypted messaging apps
Introducing Man in the Contacts attack to trick encrypted messaging appsIntroducing Man in the Contacts attack to trick encrypted messaging apps
Introducing Man in the Contacts attack to trick encrypted messaging apps
 
Understanding the fundamentals of attacks
Understanding the fundamentals of attacksUnderstanding the fundamentals of attacks
Understanding the fundamentals of attacks
 
Rump : iOS patch diffing
Rump : iOS patch diffingRump : iOS patch diffing
Rump : iOS patch diffing
 
An easy way into your sap systems v3.0
An easy way into your sap systems v3.0An easy way into your sap systems v3.0
An easy way into your sap systems v3.0
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 
Easy public-private-keys-strong-authentication-using-u2 f
Easy public-private-keys-strong-authentication-using-u2 fEasy public-private-keys-strong-authentication-using-u2 f
Easy public-private-keys-strong-authentication-using-u2 f
 
Create a-strong-two-factors-authentication-device-for-less-than-chf-100
Create a-strong-two-factors-authentication-device-for-less-than-chf-100Create a-strong-two-factors-authentication-device-for-less-than-chf-100
Create a-strong-two-factors-authentication-device-for-less-than-chf-100
 
Offline bruteforce attack on wi fi protected setup
Offline bruteforce attack on wi fi protected setupOffline bruteforce attack on wi fi protected setup
Offline bruteforce attack on wi fi protected setup
 
App secforum2014 andrivet-cplusplus11-metaprogramming_applied_to_software_obf...
App secforum2014 andrivet-cplusplus11-metaprogramming_applied_to_software_obf...App secforum2014 andrivet-cplusplus11-metaprogramming_applied_to_software_obf...
App secforum2014 andrivet-cplusplus11-metaprogramming_applied_to_software_obf...
 
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScriptWarning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
 
Killing any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented featureKilling any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented feature
 
Rump attaque usb_caralinda_fabrice
Rump attaque usb_caralinda_fabriceRump attaque usb_caralinda_fabrice
Rump attaque usb_caralinda_fabrice
 
Operation emmental appsec
Operation emmental appsecOperation emmental appsec
Operation emmental appsec
 

ASFWS 2012 WS Security - REST vs SOAP par Sylvain Maret

  • 1. Initiation à la sécurité des Web Services (SOAP vs REST) Sylvain MARET Principal Consultant / MARET Consulting OpenID Switzerland & OWASP Switzerland Application Security Forum - 2012 Western Switzerland 7-8 novembre 2012 - Y-Parc / Yverdon-les-Bains https://www.appsec-forum.ch 08.11.2012, Version 1.1 @smaret
  • 2. 2 Agenda  Qu’est-ce qu’un Web Service ?  SOAP  REST  Threat Modeling / ACME SA  Réduction des risques  Conclusion  Questions
  • 3. 3 Bio  18 years of experience in ICT Security  Principal Consultant at MARET Consulting  Expert at Engineer School of Yverdon  Swiss French Area delegate at OpenID Switzerland  Co-founder Geneva Application Security Forum  OWASP Member  Author of the blog: la Citadelle Electronique  http://ch.linkedin.com/in/smaret or @smaret  http://www.slideshare.net/smaret  Chosen field – AppSec & Digital Identity Security
  • 4. 4 Agenda  Qu’est-ce qu’un Web Service ?  SOAP  REST  Threat Modeling / ACME SA  Réduction des risques  Conclusion  Questions
  • 5. 5 Web Service: la base….
  • 6. 6 Web Service ? XML, JSON, Provider Consumer etc.
  • 7. 7 Un peu d’histoire  1990 : DCE/RPC – Distributed Computing Environment  1992 : CORBA – Common Object Request Broker Architecture  1990-1993 : Microsoft’s DCOM -- Distributed Component Object Model  1995: RMI – Monde Java  Pour arriver à une standardisation (toujours en cours) des protocoles, outils, langages et interfaces – SOAP – REST – Etc. Web Service
  • 8. 8 Agenda  Qu’est-ce qu’un Web Service ?  SOAP  REST  Threat Modeling / ACME SA  Réduction des risques  Conclusion  Questions
  • 11. 11 SOAP: Démystification des technologies  Langages – XML – WSDL : Descripteur du service – UDDI: Annuaire des services  Protocoles – Transport: HTTP, HTTPS, SMTP, FTP, SMS, TFTP, SSH, etc. (TCP or UDP) – Message: Enveloppe SOAP  Sécurité – WS-Security (Signature & Chiffrement)  Autres éléments – AuthN: SAML, X509, Username & Password, Kerberos, HTTP Digest, etc.
  • 12. 12 Enveloppe SOAP - SOAP : Simple Object Access Protocol - Permet l’envoi de messages XML - Agnostique au moyen de transport - HTTP - HTTPS - FTP - etc. Source= wikipédia
  • 13. 13 SOAP request SOAP response
  • 14. 14 UDDI  Universal Description Discovery and Integration, connu aussi sous l'acronyme UDDI, est un annuaire de services fondé sur XML et plus particulièrement destiné aux services Web.
  • 15. 15 WSDL  WSDL est une grammaire XML permettant de décrire un Service Web.  Le WSDL sert à décrire : – le format de messages requis pour communiquer avec ce service – les méthodes que le client peut invoquer – la localisation du service – le protocole de communication (SOAP RPC ou SOAP orienté message) http://fr.wikipedia.org/wiki/Web_Services_Description_Language
  • 18. 18 SOAP: Démystification des protocoles Découverte UDDI Description WSDL Message SOAP / XML HTTP, HTTPS, FTP, SFTP, SMS, SMTP Protocole (TCP or UDP) Transport IP
  • 19. 19 Agenda  Qu’est-ce qu’un Web Service ?  SOAP  REST  Threat Modeling / ACME SA  Réduction des risques  Conclusion  Questions
  • 21. 21 REST: Démystification des technologies  Langages – XML – JSON – XHTML, HTML, PDF... as data formats  Protocoles – HTTP(s)  Utilisation d’une URL – Méthode de communication (GET, POST, PUT, DELETE)  Sécurité – Sécurité du transport (SSL/TLS) – Sécurité des messages: HMAC & Doseta (Like XML Signature)  Autres éléments – Oauth, API Keys
  • 24. 24 REST: Démystification des protocoles Découverte ??? Description WADL, Swagger *** Message XML, JSON, etc. Protocole HTTP, HTTPS Transport TCP/IP *** Avant-gardiste mais peux utiliser
  • 25. 25
  • 27. 27 Agenda  Qu’est-ce qu’un Web Service ?  SOAP  REST  Threat Modeling / ACME SA  Réduction des risques  Conclusion  Questions
  • 29. 29
  • 31. 31 Menaces selon le DFD Acme SA  Threat 1 – Interception des messages (Information disclosure) – Modification des messages (Tampering) – Usurpation d’identité (Spoofing)  Threat 2 – Attaque de l’application • BoF • Injection • DoS & DDoS • Etc
  • 32. 32 Agenda  Qu’est-ce qu’un Web Service ?  SOAP  REST  Threat Modeling / ACME SA  Réduction des risques  Conclusion  Questions
  • 33. 33 ACME SA: Réduction des risques ?  Chiffrement du transport  AuthN  SSL Mutual AuthN / X509  WAF / XML Gateway  Intégrité et confidentialité des messages  Secure Coding
  • 34. 34 Chiffrement du transport SOAP / XML REST HTTPS HTTPS SSL/TLS tunnel SSH IPSEC Etc.
  • 35. 35 AuthN SOAP / XML REST HTTP Basic, Digest, HTTP Basic, Digest, HTTP Header HTTP Header Mutual SSL Mutual SSL IP trust IP trust WS Security user name password Oauth WS SAML Authentication token API Keys XML Signature Kerberos Etc.
  • 36. 36 SSL Mutual AuthN / X509 / PKI SOAP / XML REST SSL/TLS Mutual AuthN** SSL/TLS Mutual AuthN** ** Man in the middle not possible… (As I Know)
  • 37. 37 WAF / XML Gateway (Protection périmétrique) SOAP / XML REST Reverse Proxy Reverse Proxy Contrôle requêtes HTTP Contrôle requêtes HTTP Rupture SSL/TLS Rupture SSL/TLS Black List Black List White List White List Validation WSDL Signature & Verification Encryption & Decryption SAML
  • 38. 38 Intégrité et confidentialité des messages SOAP / XML REST XML Signature •(p.ex: HMAC, Doseta) XML Encryption • JSON Signature • ** ** Pas de chiffrement à ma connaissance
  • 39. 39 Code security SOAP / XML REST - Data input validation - Data input validation - Data output encoding - Data output encoding - Pseudorandom data generation, high - Pseudorandom data generation, high entropy entropy - Strong / reliable data encryption algorithms - Strong / reliable data encryption algorithms - Data leakage prevention - Data leakage prevention - Robust error & exception handling - Robust error & exception handling - Anti-automation and expiration measures - Anti-automation and expiration measures OWASP Application Security Verification Standard (ASVS): https://www.owasp.org/index.php/ASVS WASC web application weaknesses: http://projects.webappsec.org/w/page/13246978/Threat%20Classification
  • 41. 41 Agenda  Qu’est-ce qu’un Web Service ?  SOAP  REST  Threat Modeling / ACME SA  Réduction des risques  Conclusion  Questions
  • 42. 42 Conclusion  SOAP: – Implémenter les standards WS-* liés à la sécurité – Mettre en place un filtrage applicatif (WAF, XML GW) – Complexe à mettre en œuvre (PKI, Secure coding, Cryptography, etc.) – Architecture à forte contrainte de sécurité  REST – Mettre en place un filtrage applicatif (WAF, XML GW) – Implémentation rapide et facile  tendance – Architecture de type Cloud, Intranet, Social Login, etc.  On attend avec impatience les standards sécu pour REST ??? – Pragmatique: protection périmétrique, chiffrement et Secure Coding ???
  • 43. 43 Pour aller plus loin….
  • 45. 45 Merci / Thank you! Contact: sma@maret-consulting.ch @smaret http://www.maret-consulting.ch Slides: http://slideshare.net/ASF-WS/