8/9 Curso JEE5, Soa, Web Services, ESB y XML
-
Upload
juan-carlos-rubio-pineda -
Category
Technology
-
view
2.419 -
download
2
description
Transcript of 8/9 Curso JEE5, Soa, Web Services, ESB y XML
![Page 1: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/1.jpg)
SEGURIDAD EN XML Y WEB SERVICES
![Page 2: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/2.jpg)
• Índice de contenidos− Introducción:
• ¿Qué es seguridad?
• ¿Por qué crear esquemas de seguridad para web services?
− Iniciativas basadas en XML para seguridad en WS• Firma XML (XML signature)
• Encriptación XML
• XKMS
• XACML
• SAML
• WS-security
• ¿Cómo trabajan juntas?
![Page 3: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/3.jpg)
Introducción
• ¿Qué es seguridad? Conceptos básicos− Confidencialidad: ¿Pueden los ojos cotillas verlo?
− Autenticación: ¿Eres quien dices ser?
− Confianza: ¿Me fío de trabajar contigo?
− No repudio: ¿Puedes decir: “Yo no he sido” y mentir?
− Integridad: ¿Me ha llegado alterado o no?
− Autorización: ¿Tienes permiso para tenerlo?
− Auditoría: ¿Puedes probar lo que ha ocurrido sin tener que llamar a los de C.S.I.?
![Page 4: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/4.jpg)
¿Por qué definir nuevos esquemas de seguridad para web services?
![Page 5: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/5.jpg)
Esquemas de seguridad
• ¿Por qué definir nuevos esquemas de seguridad para Web Services? A día de hoy…− La interacción se centra más “sobre internet” (frente a un
escenario “dentro de la intranet”)
− Interacción entre miembros que previamente no habían establecido una relación (mutuamente desconocidos).
− Interacción programa a programa (frente a interacción humano a programa)
− Interacción más dinámica (frente a interacción estática)
− El número de servicios, proveedores y consumidores se incrementa.
![Page 6: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/6.jpg)
Esquemas de seguridad
• Actualidad de los esquemas de seguridad de webservices− SSL/TLS/HTTPS
• Nivel de seguridad de transporte (frente a nivel de seguridad demensaje)
• Seguridad únicamente punto-a-punto; no se lleva a cabo seguridad de mensajes extremo-a-extremo multisalto
• Seguridad sólo cuando los datos viajan por el cable. No hay seguridad de datos fuera del cable.
• HTTPS no tiene soporte a no repudio.
• HTTP podría no ser el único protocolo de transporte usado.
• No hay medios de firmar o encriptar elementos.
![Page 7: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/7.jpg)
Esquemas de seguridad
• ¿Puede el modelo actual de seguridad en webservices controlar los web services?−La técnica habitual es HTTPS usando SSL
• Comunicación punto a punto encriptada temporalmente.
• Transient point-to-point encrypted communication
− Los WS pueden usar y usan esta técnica, pero es insuficiente en algunos aspectos
• No es suficientemente granular; LO ENCRIPTA TODO.
• Es inflexible respecto al enrutamiento; funciona únicamente punto-a-punto
• No ofrece posibilidad a auditar lo que está pasando
• No puede evitarse el repudio; los datos no se firman
![Page 8: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/8.jpg)
XML y estándares de seguridad en Web Services
![Page 9: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/9.jpg)
Estándares en seguridad WS
• Estándares
![Page 10: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/10.jpg)
Estándares en seguridad WS
• XML y esquemas de seguridad WS− XML Digital Signature
− XML Encryption
− XKMS (XML Key Management Specification)
− XACML (eXtensible Access Control Markup Language)
− SAML (Secure Assertion Markup Language)
− WS-Security
− Identity Management & Liberty Project
![Page 11: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/11.jpg)
XML SIGNATURE (firma XML)
![Page 12: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/12.jpg)
XML Signature
• ¿Qué es XML Digital Signature (firma digital XML)?− Autenticación, integridad de datos y no repudio
− Esfuerzo conjunto de W3C/IETF
− Sintaxis XML para representar firma de recursos web
− Procedimientos para calcular y verificar esas firmas
− Validar por clave no está entre sus objetivos.
![Page 13: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/13.jpg)
XML Signature• ¿Por qué XML Signature?
• Muy flexible; puede soportar diversos conjuntos de modelos de transacción de intenet.− Puede firmar elementos individuales de un documento XML− Puede firmar múltiples elementos− Puede firmar tanto objetos locales como remotos. − Permite firmas diferidas que se aplican a un elemento remoto− Contenido referenciado por URIs− Puede firmar tanto contenido XML como contenido no XML− Permite múltiples niveles de firma (diferentes semánticas)
para el mismo contenido.• Firma, co-firma (firma conjunta), testigo, notario, etc.
![Page 14: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/14.jpg)
XML Signature
• Formularios de firma XML−Enveloped (ensobrado)−Enveloping (más o menos “envolvente”)−Detached (más o menos “diferida”)
![Page 15: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/15.jpg)
XML Signature
• XML Signature de tipo Enveloped<doc Id="myID">
<myElement>
...
</myElement>
<Signature>
...<Reference URI="#myID"/>...
</Signature>
</doc>
La firma está “ensobrada”dentro del contenido que ha sido firmado
![Page 16: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/16.jpg)
XML Signature• XML Signature de tipo Enveloping (envolvente)
<Signature>...<Reference URI="#myRefObjectID"...
<Object Id="myRefObjectID"><doc><myElement>...</myElement>...</doc></Object>
</Signature>
La firma envuelve el contenido que hay que firmar.
![Page 17: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/17.jpg)
XML Signature
• XML Signature de tip Detached (diferida).<Signature>
...
<Reference URI="http://www.buy.com/books/purchaseWS"/>
...
</Signature>
<signature> es externo al contenido a firmar.
![Page 18: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/18.jpg)
XML Signature• Ejemplo de una compra firmada
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2000/..." />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#PurchaseOrder"><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>qZk+nkcGcWq6piVxeFdcbJzQ2JO=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>IWijxQjUrcXBYc0ei4QxjWo9Kg8Dep9tlWoT4SdeRT87GH03dgh
</SignatureValue>
<KeyInfo>
<X509Data>
<X509SubjectName>CN=Alice Smith, STREET=742 Park Avenue, L=New York, ST=NY, C=US</X509SubjectName>
</X509Data>
</KeyInfo>
</Signature>
![Page 19: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/19.jpg)
ENCRIPTACIÓN XML
» XML Encryption
![Page 20: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/20.jpg)
Encriptación XML
• ¿Qué es XML Encryption (encriptación XML)?− Privacidad en los datos (confidencialidad)
− Define:• Sintaxis XML para datos encriptados
• Cómo encriptar/desencriptar datos
• Cómo encriptar ciertas partes de un documento.
![Page 21: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/21.jpg)
Encriptación XML
• Encriptación XML versus SSL−SSL encripta todos los datos transmitidos a través de
un canal SSL
−La encriptación XML puede encriptar porciones de datos de forma selectiva.
• Por ejemplo, un elemento específico dentro de un documento XML
![Page 22: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/22.jpg)
Encriptación XML• Ejemplo de encriptación XML
<purchaseOrder><name>Alice Smith</name><address> ... </address><EncryptedData xmlns='http://www.w3.org/2000/11/temp-xmlenc'>
<EncryptionMethod Algorithm="urn:nist-gov:tripledes-ede-cbc"><s0:IV xmlns:s0='http://somens'>ABCD</s0:IV>
</EncryptionMethod><KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>SharedKey</KeyName></KeyInfo><CipherData>A23B45C56</CipherData>
</EncryptedData><prodNumber>8a32gh19908</prodNumber><quantity>1</quantity>
</purchaseOrder>
![Page 23: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/23.jpg)
Encriptación XML
• Apache tiene un framework bastante bueno para hacer encriptación de XML: xmlsec
• Depende de xalan (procesador XSLT, para transformar un documento XML en HTML o en otro XML).
![Page 24: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/24.jpg)
XKMS
• XML Key Management Specification
![Page 25: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/25.jpg)
XKMS
• ¿Qué es XKMS?− Define un protocolo entre un cliente XKMS y un servidor
XKMS para llevar a cabo operaciones de PKI• public key registration (registro de clave pública)
• public key validation (validación de clave pública)
• public key discovery (descubrimiento de clave pública)
• public key revocation (recocación de clave pública)
− Un servidor XKMS proporciona un servicio confiable (trust service) en la forma de un Web Service
− Se usa tanto con firma digital XML (XML signature) como con encriptación XML (XML Encryption)
![Page 26: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/26.jpg)
XKMS
• ¿Por qué XKMS?− PKI es muy importante para los Web Services y el comercio
electrónico.
− Las operaciones de PKI son muy costosas para dispositivospequeños.
• XKMS reduce el trabajo de procesamiento desplazándolo a un servidorXKMS
− Las operaciones de PKI son demasiado complejas paramuchas aplicaciones.
• XKMS facilita la integración PKI desplazando la complejidad de lasoperaciones de PKI a un servidor XKMS
![Page 27: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/27.jpg)
XKMS
• Especificaciones XKMS− XKISS: XML Key Information Service Spec.
• Define un protocolo para la validación de claves públicas
− XKRSS: XML Key Registration Service Spec.• Define un protocolo para registro, revocación y recuperación de claves
públicas
![Page 28: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/28.jpg)
XKMS
• Implementaciones Java de XKMS − Verisign: Trust Services Integration Kit
• www.xmltrustcenter.org/developer/verisign/tsi
− Entrust: XKMS toolkit• xkms.entrust.com/xkms/
− Phaos• www.phaos.com/products/xkms/xkms.html
![Page 29: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/29.jpg)
XACML
• eXtensible Access Control Markup Language
![Page 30: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/30.jpg)
XACML
• ¿Qué es XACML?− Define el núcleo del schema (esquema) y namespace para las
políticas de autorización en XML:• Se usa contra elementos de un documento XML
• Es extensible
− Muy cercanos al desarrollo SAML• Los Policy Decision Points, PDPs (puntos de política de decisión)
implicados en SAML podrían consultar políticas codificadas en XACML para determinar si se permite el acceso al recurso.
![Page 31: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/31.jpg)
XACML
• ¿Por qué XACML?− Estandarizar lenguages de control de acceso en XML
− Lenguage extensible con semánticas flexibles
− Costes menores• No es necesario desarrollar lenguajes específicos
• No es necesario escribir políticas en diferentes lenguages
− Más simple• Los administradores sólo necesitan conocer un lenguage
− Composición de políticas• Se pueden combinar las políticas escritas por distintas partes.
![Page 32: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/32.jpg)
XACML• Ejemplo:
− Este ejemplo muestra un escenario en el que un usuario intenta acceder a una página web.
− El código proporcionado incluye• Solicitud (request)• Política (policy)• Respuesta (response)
− El usuario efectúa una solicitud en el que proporciona su identidad (código de usuario) y el grupo al que pertenece, el recurso al que quiere acceder y la acción que quiere efectuar sobre el recurso.
− La política definida afecta a cualquiera que intente cualquier acción sobre el recurso.
![Page 33: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/33.jpg)
XACML• La solicitud (request)
<Request><Subject>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"DataType="urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name">
<AttributeValue>[email protected]</AttributeValue></Attribute><Attribute AttributeId="group"
DataType="http://www.w3.org/2001/XMLSchema#string"Issuer="[email protected]">
<AttributeValue>developers</AttributeValue></Attribute>
</Subject>
<Resource><Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"><AttributeValue>http://server.example.com/code/docs/developer-guide.html</AttributeValue>
</Attribute></Resource>
<Action><Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
DataType="http://www.w3.org/2001/XMLSchema#string"><AttributeValue>read</AttributeValue>
</Attribute></Action>
</Request>
![Page 34: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/34.jpg)
XACML• La policy (parte I):
<Policy PolicyId="ExamplePolicy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:permit-overrides">
<Target><Subjects>
<AnySubject/>
</Subjects>
<Resources>
<Resource>
<ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:anyURI-equal"><AttributeValue DataType="http://www.w3.org/2001/XMLSchema#anyURI">http://server/devguide.html</AttributeValue>
<ResourceAttributeDesignator DataType="http://www.w3.org/2001/XMLSchema#anyURI"
AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"/>
</ResourceMatch>
</Resource>
</Resources><Actions>
<AnyAction/>
</Actions>
</Target>
…..
![Page 35: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/35.jpg)
XACML• La policy (parte II):
<Rule RuleId="ReadRule" Effect="Permit">
<Target>
<Subjects> <AnySubject/>
</Subjects>
<Resources> <AnyResource/>
</Resources>
<Actions>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
<ActionAttributeDesignator DataType="http://www.w3.org/2001/XMLSchema#string"
AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"/>
</ActionMatch>
</Action>
</Actions>
</Target>
<Condition FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
<SubjectAttributeDesignator DataType="http://www.w3.org/2001/XMLSchema#string" AttributeId="group"/>
</Apply>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">developers</AttributeValue>
</Condition>
</Rule>
</Policy>.
![Page 36: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/36.jpg)
XACML
• La respuesta:<Response>
<Result>
<Decision>Permit</Decision>
<Status>
<StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
</Status>
</Result>
</Response>
![Page 37: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/37.jpg)
SAML
− Security Assertion Markup Language
![Page 38: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/38.jpg)
SAML
• ¿Qué es SAML?− Define un framework XML para intercambiar información de
autenticación y autorización.
− Existen varias declaraciones (assertion) XML:• Credenciales, autenticación, atributo, autorización, etc.
• Protocolo de tipo Request&Response
− Permite habilitar Single-Sign-On (SSO)
− Es un estándar OASIS
![Page 39: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/39.jpg)
SAML
• ¿Por qué SAML? − Están apareciendo estándares para numerosas facetas de
comercio colaborativo, como• Transacciones de negocio (Por Ejemplo ebXML)
• Interacción de software (PEj.- SOAP)
− Pero no está estandarizado un medio para comunicar esaspropiedades de seguridad
• Pobre acoplamiento entre componentes
![Page 40: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/40.jpg)
SAML
• Casos de uso para compartir información de seguridad a través de SAML− SAML ha desarrollado en la línea de tres “casos de uso” para
acometer sus diseños y requerimientos:• Single Sign-on -SSO- (Autenticación unificada)
• Transacción distribuída
• Servicio de autorización
![Page 41: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/41.jpg)
SAML
• Escenario hipotético de SSO: − A los administradores del domino juntadeandalucia.es se les
permite el acceso a juntaex.es sin hacer relogin. Lo recíproco también se cumpliría.
![Page 42: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/42.jpg)
SAML
• Escenario de transacción distribuída.− Un comprador de un coche, contrata un seguro de automóvil
en seguros.com , que está afiliada a coches.com.
![Page 43: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/43.jpg)
SAML
• Escenario de servicio de autenticación− Un empleado de la Junta de Andalucía (JA) se loga
directamente en guadalinex.org que efectúa su propia autorización contra juntadeandalucia.es
![Page 44: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/44.jpg)
SAML
• SAML
− Es un framework basado en XML para intercambiar información XML
• Declaraciones de seguridad (security assertions) codificadas en XML
• Protocolo request/response codificado en XML
• Reglas de uso de assertions con frameworks estándares de mensajería y transporte.
![Page 45: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/45.jpg)
SAML
• SAML Assertions−Las assertions son declaraciones o descripciones de
un “hecho”, asociados a “alguien”.
−Las assertions SAML son conjuntos de uno o más de tres clases de “sentencia” (statement) acerca de un “sujeto” (subject).
• Autenticación (authentication statement)
• Atributo (attibute statement)
• Autorización (authorization statement)
![Page 46: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/46.jpg)
SAML
• Authentication statement
− Un authority assert declara que:• El sujeto S ha sido autenticado
• Con las intenciones I
• En la hora H
− Diseñado con el objetivo de usarlo en servicios de Single Sign-On.
![Page 47: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/47.jpg)
SAML• Ejemplo de assertion con un authentication statement:
<saml:Assertion …><saml:AuthenticationStatementAuthenticationMethod=“password”AuthenticationInstant=“2001-12-03T10:02:00Z”><saml:Subject><saml:NameIdentifier
SecurityDomain=“sun.com”Name=“Sang” />
<saml:ConfirmationMethod>http://…core-25/sender-vouches
</saml:ConfirmationMethod></saml:Subject>
</saml:AuthenticationStatement></saml:Assertion>
![Page 48: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/48.jpg)
SAML• Ejemplo de assertion con dos attribute statement
<saml:Assertion …>
<saml:AttributeStatement>
<saml:Subject>..Sang..</saml:Subject><saml:Attribute AttributeName=“PaidStatus” AttributeNamespace=“http://smithco.com”>
<saml:AttributeValue>
PaidUp
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute AttributeName=“CreditLimit” AttributeNamespace=“http://smithco.com”><saml:AttributeValue>
<my:amount currency=“USD”>500.00</my:amount>
</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
![Page 49: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/49.jpg)
SAML
• Authorization statement
− Una autoridad decide:• Si conceder o no acceso a la request del subject S
• Para el acceso de tipo A al recurso R
• Proporcionando la credencial E
− El sujeto (subject) puede ser un humano o un programa
− El recurso puede ser una página web o un web service.
![Page 50: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/50.jpg)
SAML
• Ejemplo de assertion con authorization statement<saml:Assertion …>
<saml:AuthorizationStatement
Decision=“Permit”
Resource=“http://jonesco.com/rpt_12345.html”>
<saml:Subject>…</saml:Subject>
<saml:Actions
ActionNamespace=“http://…core-25/rwedc”>
<saml:Action>Read</saml:Action>
</saml:Actions>
</saml:AuthorizationStatement>
</saml:Assertion>
![Page 51: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/51.jpg)
WS-Security
![Page 52: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/52.jpg)
WS-Security
• Especificación WS-Security− Conjunto de extensiones SOAP de mensajería segura
extremo-a-extremo• Esquemas de seguridad en el nivel de mensaje
− Se firman y encriptan mensajes SOAP añadiendo tokens de seguridad a los mensajes SOAP
• Cualquier combinación de partes de mensaje: bloques de cabecera, cuerpo, adjuntos…
− Proporciona• Integridad
• Autenticación
• Privacidad
![Page 53: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/53.jpg)
WS-Security
• WS-Security− Múltiples modelos de seguridad
• username/password (usuario/contraseña)
• Certificate (certificado)
− Múltiples tecnologías de seguridad• Kerberos
• PKI
− Múltiples tipos de tokens de seguridad• Kerberos ticket
• X509 certificate
• SAML assertions
![Page 54: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/54.jpg)
WS-Security• Ejemplo de mensaje SOAP con un token username
<S:Envelope xmlns:S="http://www.w3.org/2001/12/soap-envelope"xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">
<S:Header>...
<wsse:Security><wsse:UsernameToken>
<wsse:Username>cursoSOA</wsse:Username><wsse:Password>contraseña</wsse:Password>
</wsse:UsernameToken></wsse:Security>
...</S:Header>...
</S:Envelope>
![Page 55: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/55.jpg)
Uniéndolo todo: cómo hacer que estas tecnologías trabajen juntas
![Page 56: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/56.jpg)
Uniéndolo todo
• Las opciones más prácticas:
−SAML y XACML• XACML puede usarse para definir control de
acceso/políticas sobre las bases de controlar solicitudes assertion SAML
−SAML y WS-Security• Las assertions SAML pueden transportarse como tokens de
seguridad definidos en WS-Security.
![Page 57: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/57.jpg)
RECURSOS PARA APRENDER MÁS
![Page 58: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/58.jpg)
Recursos
• Recursos:− W3C XML Digital Signature
www.w3.org/Signature/
− W3C XML Encryption www.w3.org/Encryption/
− XKMS www.w3.org/TR/xkms/
− XACMLwww.oasis-open.org/committees/xacml/
− SAMLoasis-open.org/committees/security
![Page 59: 8/9 Curso JEE5, Soa, Web Services, ESB y XML](https://reader034.fdocument.pub/reader034/viewer/2022052622/558fc1901a28abe1668b4692/html5/thumbnails/59.jpg)
FIN