Download - Seguridad Para Servicios Web
![Page 1: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/1.jpg)
<Seguridad en Web <Seguridad en Web Services>Services>
Servicios Web y Frameworks de Servicios Web y Frameworks de DesarrolloDesarrollo
<José Miguel Selman Grez><José Miguel Selman Grez>
Lunes 3 de Julio de 2006Lunes 3 de Julio de 2006
![Page 2: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/2.jpg)
En esta En esta SesiónSesión……
Porque necesitamos seguridadPorque necesitamos seguridad– MotivaciónMotivación
Desafíos introducidos por Servicios WebDesafíos introducidos por Servicios Web Presentación Tecnologías seguridad Presentación Tecnologías seguridad
para XMLpara XML Presentación Tecnologías seguridad Presentación Tecnologías seguridad
para Servicios Webpara Servicios Web Discusión y RecomendacionesDiscusión y Recomendaciones
![Page 3: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/3.jpg)
Seguridad como un Seguridad como un habilitadorhabilitador Integración de AplicacionesIntegración de Aplicaciones EAIEAI
– CRMsCRMs– ERPsERPs
B2C, B2B, etc.B2C, B2B, etc. Automatización de Procesos de NegocioAutomatización de Procesos de Negocio Portales de Agregación de InformaciónPortales de Agregación de Información ……
![Page 4: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/4.jpg)
Arquitectura General Arquitectura General Aplicaciones Aplicaciones EmpresarialesEmpresariales
ClientesServidor
WebServidor
App.
ServidorApp.
ServidorApp.
AccesoDatos
Conectores aSistemas Legados
Bases deDatos
Seguridad Back-Office
• Seguridad Mainframe• Seguridad RDBMS• etc.
Seguridad Middleware
• Roles• Seguridad Componentes• Criptografía• etc.
Seguridad Perímetro
• Firewalls/VPNs• Criptografía• Seguridad Servidores Web• Detección de Intrusión• etc.
Plataformas Predominantes: J2EE y .NET
![Page 5: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/5.jpg)
¿De qué debemos ¿De qué debemos proteger nuestras proteger nuestras aplicaciones?aplicaciones?
Violación de Confidencialidad Violación de Integridad
Ataque de Repetición
![Page 6: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/6.jpg)
Ataques AplicacionesAtaques Aplicaciones
Ataque del Intermediario (conocido como “Man in the Middle”)
![Page 7: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/7.jpg)
Ataque típicos Ataque típicos Aplicaciones WebAplicaciones Web Manipulación de parámetrosManipulación de parámetros
– http://www.sitio.com/listadoProductos.do?maxResults=100
¿maxResults=999999999?¿maxResults=999999999?– Ataques SQL (SQL Ataques SQL (SQL InjectionInjection))
http://www.sitio.com/listTabla.aspx?orderBy=columna1– SELECT * FROM tabla ORDER BY columna1SELECT * FROM tabla ORDER BY columna1
Recursos no publicadosRecursos no publicados– http://www.sitio.com/documentos/documento1.html
¿http://www.sitio.com/documentos/?¿http://www.sitio.com/documentos/? ¿http://www.sitio.com/test/?¿http://www.sitio.com/test/? ¿http://www.sitio.com/prueba/?¿http://www.sitio.com/prueba/?
Ataques a los servidoresAtaques a los servidores– Buffer OverflowBuffer Overflow– Etc.Etc.
Etc.Etc.
![Page 8: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/8.jpg)
Requerimientos de Requerimientos de SeguridadSeguridad AutenticaciónAutenticación AutorizaciónAutorización ConfidencialidadConfidencialidad IntegridadIntegridad No repudiaciónNo repudiación Alta DisponibilidadAlta Disponibilidad
![Page 9: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/9.jpg)
Desafíos de Seguridad Desafíos de Seguridad Servicios WebServicios Web Seguridad basada en el usuario Seguridad basada en el usuario
finalfinal Mantener la seguridad al pasar Mantener la seguridad al pasar
por múltiples Servicios (“nodos”)por múltiples Servicios (“nodos”) Abstracción de la seguridad del Abstracción de la seguridad del
transporte subyacentetransporte subyacente
![Page 10: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/10.jpg)
Seguridad basada en Seguridad basada en el usuario finalel usuario final
![Page 11: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/11.jpg)
Seguridad a través de múltiples Seguridad a través de múltiples Servicios y múltiples Servicios y múltiples transportestransportes
Physical
Data Link
Network
Transport
Session
Presentation
Application
Physical
Data Link
Network
Transport
Session
Presentation
Application
Usuario Sitio Web Servicio Web
HTTP JMS
Abstracción de Seguridad del transporte subyacenteAbstracción de Seguridad del transporte subyacente Seguridad PersistenteSeguridad Persistente
Contexto de Seguridad 1
Contexto de Seguridad 2
…
![Page 12: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/12.jpg)
Arquitectura General Arquitectura General Servicios WebServicios Web
ComunicacionesHTTP, SMTP, FTP, JMS, IIOP, …
Mensajes
Extensiones SOAPEntrega Confiable, Correlación, Transacciones…
SOAP
DescripcionesWSDL
ProcesosDescubrimiento, Agregación, Coreografía, …
XM
L, DTD
, XM
L Sch
em
a
SEGURIDAD
ADMINISTRACIÓN
![Page 13: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/13.jpg)
Opciones de Seguridad Opciones de Seguridad Capa de TransporteCapa de Transporte
Servicio de Servicio de SeguridadSeguridad TecnologíasTecnologías
IntegridadIntegridad SSL/TLSSSL/TLS
ConfidencialidadConfidencialidad SSL/TLSSSL/TLS
Autenticación Autenticación Proveedor (Servidor)Proveedor (Servidor)
SSL/TLSSSL/TLS
Autenticación Autenticación Consumidor (Cliente)Consumidor (Cliente)
SSL/TLS con autenticación de clienteSSL/TLS con autenticación de cliente
HTTP BasicHTTP Basic
HTTP DigestHTTP Digest
HTTP AttributesHTTP Attributes
SSL/TLSSSL/TLSHTTP BasicHTTP Basic
HTTP DigestHTTP Digest
![Page 14: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/14.jpg)
Seguridad para Seguridad para Servicios WebServicios Web Los servicios de seguridad Los servicios de seguridad
pueden ser provistos por:pueden ser provistos por:– Capa de TransporteCapa de Transporte– Capa de MensajeríaCapa de Mensajería– AmbasAmbas
Existencia de gran cantidad de Existencia de gran cantidad de especificaciones y alternativasespecificaciones y alternativas
![Page 15: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/15.jpg)
Seguridad en la Capa Seguridad en la Capa de Mensajeríade Mensajería
Transporte
(HTTP, SMTP, FTP, MQ, etc.)
Envelope (XML)
Header Body
• RPC/Encoded• Document/Literal
• Información Rutas• Transacciones• Entrega Confiable• Seguridad
![Page 16: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/16.jpg)
Interrelación Interrelación Tecnologías/Especificaciones de Tecnologías/Especificaciones de Seguridad Servicios WebSeguridad Servicios Web
…
TCP/IP
Capa de Transporte (HTTP, FTP, SMTP, MQ, etc.)
Seguridad Capa de Transporte (TLS/SSL)
XML Signature
XML Encryption
SOAP
WS Security
SAML XKMS Otras Alto Nivel
Infr
aest
ruct
ura
de R
ed
Fram
ew
ork
s X
ML
Fuente: “Securing Web Services With WS-Security. Demystifying WS-Security, WS-Policy, SAML, XML Signature, and XML Encryption”, Jothy Rosenberg and David Remy
![Page 17: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/17.jpg)
XML SignatureXML Signature
Esfuerzo conjunto IETF/W3CEsfuerzo conjunto IETF/W3C Su objetivo es firmar digitalmente:Su objetivo es firmar digitalmente:
– Documentos XMLDocumentos XML– Partes de Documentos XMLPartes de Documentos XML– Objetos ExternosObjetos Externos
Utiliza tecnologías maduras de encriptación asimétrica Utiliza tecnologías maduras de encriptación asimétrica y generación de y generación de hasheshashes– SHA1SHA1– RSARSA– ……
Requiere de una infraestructura de llaves públicas Requiere de una infraestructura de llaves públicas para proveer:para proveer:– IdentidadIdentidad– No repudiaciónNo repudiación
![Page 18: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/18.jpg)
Tipos de Firmas XML Tipos de Firmas XML SignatureSignature
<Signature> <Reference>
<ElementoFirmado>
Enveloping
<ElementoEnvolvente>
<Signature> <Reference>
Enveloped
<DocumentoXML>
<Signature> <Reference>
Detached
<ElementoDestino>
![Page 19: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/19.jpg)
CanonicalizaciónCanonicalización
<OrdenDeCompra>
<Productos>
<CodProducto>
SKU10023
</CodProducto>
</Productos>
</OrdenDeCompra>
<OrdenDeCompra><Productos><CodProducto>SKU10023</CodProducto></Productos></OrdenDeCompra>
• c14n• Consenso común• XSLT
![Page 20: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/20.jpg)
Estructura XML Estructura XML SignatureSignature
<Signature ID?>
<SignedInfo>
<CanonicalizationMethod/>
<SignatureMethod/>
(<Reference>
(<Transforms>)?
<DigestMethod>
<DigestValue>
</Reference>)+
</SignedInfo>
<SignatureValue>
(<KeyInfo>)?
(<Object ID?>)*
</Signature>
![Page 21: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/21.jpg)
XML Signature: XML Signature: EnvelopedEnveloped
<OrdenDeCompra id=”ODC200504251002”>
<SKU>12345678</SKU>
<Cantidad>17</Cantidad>
<Signature xmlns=”http://www.w3.org/2000/09/xmldsig#”>
<SignedInfo>
<Reference URI=”#ODC200504251002”/>
</SignedInfo>
<SignatureValue>…</SignatureValue>
<KeyInfo>…</KeyInfo>
</Signature>
</OrdenDeCompra>
![Page 22: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/22.jpg)
XML Signature: XML Signature: EnvelopingEnveloping
<Signature xmlns=”http://www.w3.org/2000/09/xmldsig#”>
<SignedInfo>
<Reference URI=”#10022334”/>
</SignedInfo>
<SignatureValue>…</SignatureValue>
<KeyInfo>…</KeyInfo>
<Object>
<SignedItem id=”10022334”>Información a ser Firmada</SignedItem>
</Object>
</Signature>
![Page 23: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/23.jpg)
XML Signature: XML Signature: DetachedDetached
<Signature xmlns=”http://www.w3.org/2000/09/xmldsig#”>
<SignedInfo>
<Reference URI=”http://www.jselman.com/imagen.jpg”/>
</SignedInfo>
<SignatureValue>…</SignatureValue>
<KeyInfo>…</KeyInfo>
</Signature>
![Page 24: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/24.jpg)
Recomendaciones Recomendaciones Seguridad XML Seguridad XML SignatureSignature Solamente lo firmado es seguroSolamente lo firmado es seguro
– Especial cuidado con desechos ocurridos por Especial cuidado con desechos ocurridos por transformacionestransformaciones
Solamente lo que se ve puede ser firmadoSolamente lo que se ve puede ser firmado– Por ejemplo si un contrato fue presentado a un Por ejemplo si un contrato fue presentado a un
usuario mediante el uso de XML y una plantilla usuario mediante el uso de XML y una plantilla XSLT, ambos deben ser firmados (WYSIWYS)XSLT, ambos deben ser firmados (WYSIWYS)
Ver lo que es firmadoVer lo que es firmado– Especial cuidado con referencias a objetos que Especial cuidado con referencias a objetos que
“deberían” contener cierto elemento.“deberían” contener cierto elemento.
![Page 25: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/25.jpg)
XML EncryptionXML Encryption
Posterior a XML SignaturePosterior a XML Signature La información cifrada es expresada en un formato común La información cifrada es expresada en un formato común
XMLXML Trozos de un documento XML pueden ser selectivamente Trozos de un documento XML pueden ser selectivamente
cifradoscifrados Utiliza algoritmos y técnicas de encriptación madurasUtiliza algoritmos y técnicas de encriptación maduras
– SimétricaSimétrica– AsimétricaAsimétrica– Híbrida (llave de sesión)Híbrida (llave de sesión)
Algunos AlgoritmosAlgunos Algoritmos– DESDES– 3DES3DES– AESAES– ……
![Page 26: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/26.jpg)
ConfidencialidadConfidencialidad
Simétrica
Asimétrica
![Page 27: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/27.jpg)
Llave de SesiónLlave de Sesión
![Page 28: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/28.jpg)
Estructura XML Estructura XML EncryptionEncryption
<EncryptedData Id? Type? MimeType? Encoding?><EncryptionMethod/>?<ds:KeyInfo>
<EncryptedKey>?<AgreementMethod>?<ds:KeyName>?<ds:RetrievalMethod>?<ds:*>?
</ds:KeyInfo><CipherData>
<CipherValue>?<CipherReference URI?>?
</CipherData><EncryptionProperties>?
</EncryptedData>
![Page 29: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/29.jpg)
Ejemplo XML Ejemplo XML EncryptionEncryption
<purchaseOrder> <Order> <Item>book</Item> <Id>123-958-74598</Id> <Quantity>12</Quantity> </Order> <Payment> <CardId> 123654-8988889-9996874 </CardId> <CardName>visa</CardName> <ValidDate>12-10-2004</ValidDate> </Payment></purchaseOrder>
<PurchaseOrder> <Order> <Item>book</Item> <Id>123-958-74598</Id> <Quantity>12</Quantity> </Order> <EncryptedData Type='http://www.w3.org/2001/04/xmlenc#Element‘ xmlns='http://www.w3.org/2001/04/xmlenc#'> <CipherData> <CipherValue>A23B45C564587</CipherValue> </CipherData> </EncryptedData></PurchaseOrder>
![Page 30: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/30.jpg)
XKMSXKMS
XML Key Management SpecificationXML Key Management Specification Infraestructura de llave pública (PKI)Infraestructura de llave pública (PKI)
– Repositorio de credencialesRepositorio de credenciales– Asociación a identidadesAsociación a identidades
VentajasVentajas– Complejidad reducida para los clientesComplejidad reducida para los clientes– Facilita la codificaciónFacilita la codificación– Administración de la confianza centralizadaAdministración de la confianza centralizada– ……
PKIServicios Web XKMS
Aplicaciones
![Page 31: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/31.jpg)
SAMLSAML
Security Assertion Markup LanguageSecurity Assertion Markup Language Especificación mantenida por OASISEspecificación mantenida por OASIS Transportador de identidadesTransportador de identidades ““Confianza Portable”Confianza Portable” Requiere preestablecimiento de confianza entre los Requiere preestablecimiento de confianza entre los
dominiosdominios Potencial uso para herramientas de Potencial uso para herramientas de Single Sign-OnSingle Sign-On Aserciones en formato XMLAserciones en formato XML
– AutenticaciónAutenticación– AtributosAtributos– AutorizaciónAutorización
¡Se pueden firmar con XML Signature!¡Se pueden firmar con XML Signature!
![Page 32: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/32.jpg)
Aserciones SAMLAserciones SAML
AutenticaciónAutenticación– El Sujeto El Sujeto SS fue identificado con el método fue identificado con el método MM a la hora a la hora TT..– Los métodos de autenticación soportadosLos métodos de autenticación soportados
ContraseñaContraseña Ticket KerberosTicket Kerberos Contraseña Remota Segura (RSP)Contraseña Remota Segura (RSP) Token de HardwareToken de Hardware Certificado de Cliente SSLCertificado de Cliente SSL Llave Pública en un contenedor X.509Llave Pública en un contenedor X.509 Llave Pública PGPLlave Pública PGP Llave Pública SPKILlave Pública SPKI Llave Pública XKMSLlave Pública XKMS Firma Digital XML SignatureFirma Digital XML Signature
AtributosAtributos– El sujeto El sujeto SS posee los siguientes atributos: posee los siguientes atributos:
Atributo 1Atributo 1: : aa Atributo 2Atributo 2: b: b …… Atributo nAtributo n: : nn
– Este tipo de información esta típicamente contenida en servidores LDAP. Este tipo de información esta típicamente contenida en servidores LDAP. AutorizaciónAutorización
– Al sujeto Al sujeto SS se puede autorizar el acceso tipo se puede autorizar el acceso tipo AA sobre el recurso sobre el recurso RR dada la dada la evidencia evidencia EE. .
![Page 33: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/33.jpg)
Ejemplo Aserción de Ejemplo Aserción de AutenticaciónAutenticación
<saml:AssertionMajorVersion=”1” MinorVersion=”0”AssertionID=”10.254.1.101.12345”Issuer=”jselman.com”IssueInstant=”2005-05-07T22:02:00Z”><saml:Conditions NotBefore=”2005-05-07T22:02:00Z” NotAfter=”2005-05-
07T22:09:00Z” /><saml:AuthenticationStatement
AuthenticationMethod=”password”AuthenticationInstant=”2005-05-07T22:02:00Z”><saml:Subject>
<saml:NameIdentifier SecurityDomain=”jselman.com” Name=”José Miguel” />
</saml:Subject></saml:AuthenticationStatement>
</saml:Assertion>
![Page 34: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/34.jpg)
Arquitectura SAMLArquitectura SAML
SAML
Aserción deAutenticación
Aserción deAtributos
Aserción deAutorización
Autoridad de Autenticación
Autoridad de Atributos
Punto de Decisiónde Políticas (PDP)
Recolector de Credenciales
Entidad deSistema
Punto de HacerValer Políticas (PEP)
RequerimientoAplicación
Política Política Política
![Page 35: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/35.jpg)
WS-SecurityWS-Security
Esfuerzo conjunto de IBM, Microsoft y VeriSignEsfuerzo conjunto de IBM, Microsoft y VeriSign– En Abril de 2002 publican “Security in a Web Services En Abril de 2002 publican “Security in a Web Services
World: A Proposed Architecture and Roadmap”World: A Proposed Architecture and Roadmap” Hoy mantenida por OASISHoy mantenida por OASIS Su objetivo es Proveer seguridad a SOAPSu objetivo es Proveer seguridad a SOAP Se enfoca en la correcta y efectiva aplicación Se enfoca en la correcta y efectiva aplicación
de tecnologías comode tecnologías como– XML SignatureXML Signature– XML EncryptionXML Encryption– SAMLSAML
Provee un contenedor para artefactos de Provee un contenedor para artefactos de seguridadseguridad
![Page 36: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/36.jpg)
El encabezado El encabezado WS-SecurityWS-Security Tokens de seguridadTokens de seguridad
– Cero, uno ó más tokens de seguridad Cero, uno ó más tokens de seguridad – Usualmente no más de unoUsualmente no más de uno
Elementos de contenido cifrado con XML Elementos de contenido cifrado con XML EncryptionEncryption– Cero, uno ó más de elementos XML EncryptionCero, uno ó más de elementos XML Encryption– Estos pueden serEstos pueden ser
<ReferenceList><ReferenceList> <EncryptedKey><EncryptedKey>
Elementos de contenido firmado digitalmente Elementos de contenido firmado digitalmente con XML Signaturecon XML Signature– Cero, uno ó más firmas XML SignatureCero, uno ó más firmas XML Signature– Usualmente, si se incluye una firma, esta firma como Usualmente, si se incluye una firma, esta firma como
mínimo alguna parte del cuerpo del mensaje.mínimo alguna parte del cuerpo del mensaje.
![Page 37: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/37.jpg)
Ejemplo Sobre SOAP Ejemplo Sobre SOAP WS-SecurityWS-Security
<S:Envelope><S:Header>
<wsse:Security><wsse:UsernameToken>
…</wsse:UsernameToken><ds:Signature>
…</ds:Signature>…<xenc:ReferenceList>
…<xenc:DataReference
URI=”#body”/>…
</xenc:ReferenceList></wsse:Security>
</S:Header><S:Body>
<xenc:EncryptedData Id=”body” Type=”content”>…
</xenc:EncryptedData></S:Body>
</S:Envelope>
![Page 38: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/38.jpg)
Espacios de Nombre Espacios de Nombre en WS-Securityen WS-SecurityPrefijPrefij
ooSignificadoSignificado Espacio de NombreEspacio de Nombre
dsds Digital Digital SignatureSignature
http://www.w3.org/2000/09/xmldsig#http://www.w3.org/2000/09/xmldsig#
wssewsse WS-Security WS-Security ExtensionExtension
http://www.docs.oasis-open.org/wss/2004/01/oasis-http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd200401-wss-wssecurity-secext-1.0.xsd
wsuwsu Web Services Web Services UtilityUtility
http://www.docs.oasis-open.org/wss/2004/01/oasis-http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd200401-wss-wssecurity-utility-1.0.xsd
xencxenc XML XML EncryptionEncryption
http://www.w3.org/2001/04/xmlenc#http://www.w3.org/2001/04/xmlenc#
![Page 39: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/39.jpg)
WS-Security WS-Security TimestampsTimestamps
<S:Envelope>
<S:Header>
<wsse:Security>
…
<wsu:Timestamp>
<wsu:Created>2005-05-14T19:31:22Z</wsu:Created>
<wsu:Expires>2005-05-14 T19:46:22Z</wsu:Expires>
</wsu:Timestamp>
…
</wsse:Security>
</S:Header>
</S:Envelope>
![Page 40: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/40.jpg)
Tokens de SeguridadTokens de Seguridad
Nombre de Usuario y ContraseñaNombre de Usuario y Contraseña Nombre de Usuario y Constraseña con Password Nombre de Usuario y Constraseña con Password
DigestDigest Certificados X509Certificados X509 KerberosKerberos XMLXML
– SAMLSAML Security Assertion Markup LanguageSecurity Assertion Markup Language
– XrMLXrML eXtensible Right Markup LanguageeXtensible Right Markup Language
– XCBFXCBF XML Common Biometric FormatXML Common Biometric Format
– …… ……
![Page 41: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/41.jpg)
Username TokenUsername Token
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>jselman</wsse:Username>
<wsse:Password>1234</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
![Page 42: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/42.jpg)
Username Token Username Token Password DigestPassword Digest
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>jselman</wsse:Username>
<wsse:PasswordType=”wsse:PasswordDigest”>
D2A12DFE8D90FC6…
</wsse:PasswordType>
<wsse:Nonce>EFD89F06CCB28C89</wsse:Nonce>
<wsu:Created>2005-05-08T20:21:23Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
![Page 43: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/43.jpg)
Certificados X509 Certificados X509
<wsse:Security><wsse:BinarySecurityToken
ValueType=”wsse:X509v3”
EncodingType=”wsse:Base64Binary”>NIFEPzCCA9CrAwIBAgIQEmtJZc0…
</wsse:BinarySecurityToken></wsse:Security>
![Page 44: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/44.jpg)
Token SAMLToken SAML<S:Envelope xmlns:S="...">
<S:Header>
<wsse:Security xmlns:wsse="...">
<saml:Assertion
MajorVersion="1"
MinorVersion="0"
AssertionID="SecurityToken-ef912422"
Issuer="jselman"
IssueInstant="2005-05-14T16:47:05.6228146-07:00"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
...
</saml:Assertion>
...
</wsse:Security>
</S:Header>
<S:Body>
...
</S:Body>
</S:Envelope>
![Page 45: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/45.jpg)
Token eXtensible Rights Token eXtensible Rights Markup LanguageMarkup Language
<S:Envelope> <S:Header> <wsse:Security> <r:license licenseId=”urn:foo:SecurityToken:ab12345”> <r:grant> <r:keyHolder> <r:info> <ds:KeyValue>…</ds:KeyValue> </r:info> </r:keyHolder> <r:possessProperty/> <sx:commonName>José Miguel Selman</sx:commonName> </r:grant> <r:issuer> <ds:Signature>…</ds:Signature> </r:issuer> </r:license> <ds:Signature> <ds:SignedInfo> … <ds:Reference URI=”#msgBody”> … </ds:Reference> … </ds:SignedInfo> … <ds:KeyInfo> <wsse:SecurityTokenReference> <wsse:Reference URI=”urn:foo:SecurityToken:ab12345” ValueType=”r:license”/> </wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature> </wsse:Security> </S:Header> <S:Body wsu:Id=”msgBody”> <PictureRequest xmlns=”http://www.jselman.com/pics”> <Picture format=”image/gif”> AxE1TrsRGGH… </Picture> </PictureRequest> </S:Body></S:Envelope>
![Page 46: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/46.jpg)
Token XCBFToken XCBF
<S:Envelope xmlns:S="..."> <S:Header> <wsse:Security xmlns:wsse="..."> <wsse:XCBFSecurityToken xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" Id="XCBF-biometric-object" ValueType="wsse:XCBFv1" EncodingType="wsee:XER">
<BiometricSyntaxSets> <BiometricSyntax> <biometricObjects> <BiometricObject> <biometricHeader> <version> 0 </version> <recordType> <id> 4 </id> </recordType> <dataType> <processed/> </dataType> <purpose> <audit/> </purpose> <quality> -1 </quality> <validityPeriod> <notBefore> 1980.10.4 </notBefore> <notAfter>2003.10.3.23.59.59</notAfter> </validityPeriod> <format> <formatOwner> <oid> 2.23.42.9.10.4.2 </oid> </formatOwner> </format> </biometricHeader> <biometricData> 0A0B0C0D0E0F1A1B1C1D1E1F2A2B2C2D2E2F </biometricData> </BiometricObject> </biometricObjects> </BiometricSyntax> </BiometricSyntaxSets>
</wsse:XCBFSecurityToken> </wsse:Security> </S:Header> <S:Body> ... </S:Body></S:Envelope>
![Page 47: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/47.jpg)
XML Signature en XML Signature en WS-SecurityWS-Security ObjetivoObjetivo
– Verificación de integridad y veracidad de Verificación de integridad y veracidad de credenciales incrustadas en los tokenscredenciales incrustadas en los tokens
– Proveer Integridad persistenteProveer Integridad persistente El mensaje puede ser manipulado El mensaje puede ser manipulado
legítimamente en cada nodo de su rutalegítimamente en cada nodo de su ruta Pueden incluirse varias firmas digitales en el Pueden incluirse varias firmas digitales en el
encabezadoencabezado No es más que la incrustación de un elemento No es más que la incrustación de un elemento
XML Signature en un encabezado WS-SecurityXML Signature en un encabezado WS-Security No establece reglas sobre qué se debe firmarNo establece reglas sobre qué se debe firmar
![Page 48: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/48.jpg)
Ejemplo XML Signature Ejemplo XML Signature en WS-Securityen WS-Security<S:Envelope> <S:Header> <wsse:Security> <wsse:BinarySecurityToken ValueType=”wsse:X509v3” EncodingType=”wsse:Base64Binary” wsu:Id=”X509Token”> ... </wsse:BinarySecurityToken> </wsse:Security> <ds:Signature> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm=”…”/> <ds:SignatureMethod Algorithm=”…”/> <ds:Reference URI=”#body”> <ds:Transforms> <ds:Transform Algorithm=”…”/> </ds:Transforms> <ds:DigestMethod Algorithm=”…”/> <ds:DigestValue>…</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> … </ds:SignatureValue> <ds:KeyInfo> <wsse:SecurityTokenReference> <wsse:Reference URI=”#X509Token”/> </wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature> </S:Header> <S:Body wsu:Id=”body”> … </S:Body></S:Envelope>
![Page 49: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/49.jpg)
XML Encryption en XML Encryption en WS-SecurityWS-Security ObjetivoObjetivo
– Esconder selectivamente información Esconder selectivamente información sensible dentro de mensajes SOAPsensible dentro de mensajes SOAP
– Proveer confidencialidad persistenteProveer confidencialidad persistente Generalmente se utiliza una llave de Generalmente se utiliza una llave de
sesión por rendimientosesión por rendimiento No es más que la incrustación de un No es más que la incrustación de un
elemento XML Encryption en un elemento XML Encryption en un encabezado WS-Securityencabezado WS-Security
No establece reglas sobre qué se debe No establece reglas sobre qué se debe cifrarcifrar
![Page 50: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/50.jpg)
Ejemplo XML Ejemplo XML Encryption en WS-Encryption en WS-SecuritySecurity
<S:Envelope> <S:Header> <wsse:Security> <xenc:EncryptedKey> <xenc:EncryptionMethod Algorithm=”…”/> <ds:KeyInfo> <wsse:SecurityTokenReference> <wsse:KeyIdentifier EncodingType=”wsse:Base64Binary” ValueType=”wsse:X509v3”> F2jFla0GxSq… </wsse.KeyIdentifier> </wsse:SecurityTokenReference> </ds:KeyInfo> <xenc:CipherData> <xenc:CipherValue>…</xenc:CipherValue> </xenc:CipherData> <xenc:ReferenceList> <xenc:DataReference URI=”#body”/> </xenc:ReferenceList> </xenc:EncryptedKey> </wsse:Security> </S:Header> <S:Body> <xenc:EncryptedData Id=”body”> <xenc:CipherValue>…</xenc:CipherValue> </xenc:EncryptedData> </S:Body></S:Envelope>
![Page 51: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/51.jpg)
Opciones de Seguridad Opciones de Seguridad Capa de MensajeríaCapa de Mensajería
Servicio de Servicio de SeguridadSeguridad TecnologíasTecnologías
IntegridadIntegridad
XML SignatureXML Signature
S/MIMES/MIME
PKCS#7PKCS#7
ConfidencialidadConfidencialidad XML EncryptionXML Encryption
Autenticación del Autenticación del Emisor SOAP (Cliente)Emisor SOAP (Cliente)
XML EncryptionXML Encryption username & [password|username & [password|digest]digest]
username & [password|digest]username & [password|digest]
Certificado X.509Certificado X.509
Token de Token de SeguridadSeguridad
KerberosKerberos
SAMLSAML
RELREL
Etc.Etc.
![Page 52: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/52.jpg)
Comparación Comparación Seguridad Según CapaSeguridad Según Capa
Seguridad de TransporteSeguridad de Transporte Seguridad de MensajeríaSeguridad de Mensajería
Punto a PuntoPunto a Punto Destino a DestinoDestino a Destino
Madura, su implementación es Madura, su implementación es relativamente directarelativamente directa
Nueva, relativamente Nueva, relativamente compleja con muchas opciones compleja con muchas opciones de seguridadde seguridad
No granular, enfoque del todo No granular, enfoque del todo o nadao nada
Muy granular, puede aplicar Muy granular, puede aplicar selectivamente a trozos de selectivamente a trozos de mensajes y solamente a los mensajes y solamente a los requerimientos o respuestasrequerimientos o respuestas
Dependiente del TransporteDependiente del Transporte La misma estrategia puede La misma estrategia puede aplicarse a distintas aplicarse a distintas tecnologías de transportetecnologías de transporte
![Page 53: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/53.jpg)
Seguridad Capa de Seguridad Capa de MensajeríaMensajería Construida sobre modelos madurosConstruida sobre modelos maduros Gran cantidad de especificacionesGran cantidad de especificaciones
– Muchas de ellas muy inmadurasMuchas de ellas muy inmaduras Mayor FortalezaMayor Fortaleza
– FlexibilidadFlexibilidad Mayor DebilidadMayor Debilidad
– FlexibilidadFlexibilidad
![Page 54: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/54.jpg)
Frameworks de Frameworks de DesarrolloDesarrollo .NET.NET
– WSE (Web Services Enhancements)WSE (Web Services Enhancements) http://msdn.microsoft.com/http://msdn.microsoft.com/
webservices/webservices/building/wse/webservices/webservices/building/wse/default.aspxdefault.aspx
JavaJava– WSS4J (WS-Security for Java)WSS4J (WS-Security for Java)
http://ws.apache.org/wss4j/http://ws.apache.org/wss4j/
![Page 55: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/55.jpg)
Recomendaciones Recomendaciones InteroperabilidadInteroperabilidad
Web Services Web Services Interoperability Interoperability OrganizationOrganization– Perfil BásicoPerfil Básico– Perfil Básico de Perfil Básico de
SeguridadSeguridad
– ““Security Security Challenges, Challenges, Threats and Threats and CountermeasuresCountermeasures””
http://www.ws-i.org/Profiles/BasicSecurityProfile-1.0.html
![Page 56: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/56.jpg)
El problema de El problema de administraciónadministración
Servicio 1 Política 1
Servicio 2
Servicio 3
Servicio j
Política 2
Política k
Cliente 1
Cliente 2
Cliente 3
Cliente 4
Cliente 2
Cliente i
![Page 57: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/57.jpg)
Firewall Servicios WebFirewall Servicios Web
ClientesServidor
WebServidor
App.
ServidorApp.
ServidorApp.
AccesoDatos
Conectores aSistemas Legados
Bases deDatos
FW
Firewall para Servicios Web
![Page 58: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/58.jpg)
Proxy ReversoProxy Reverso
Aplicación 1
Aplicación 2
Aplicación M
FirewallServicios
Web
Cliente N
Cliente 2
Cliente 1
Fuente: “Patterns for Application Firewalls”, Nelly Delessy-Gassant, Eduardo B. Fernandez, Saeed Rajput, and Maria M. Larrondo-Petrie
![Page 59: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/59.jpg)
Múltiples AgentesMúltiples AgentesAplicación 1
Aplicación 2
Aplicación M
Agente FW
Cliente N
Cliente 2
Cliente 1
Agente FW
Agente FW
Fuente: “Patterns for Application Firewalls”, Nelly Delessy-Gassant, Eduardo B. Fernandez, Saeed Rajput, and Maria M. Larrondo-Petrie
![Page 60: Seguridad Para Servicios Web](https://reader033.vdocumento.com/reader033/viewer/2022061119/546b23a5af79599b248b512f/html5/thumbnails/60.jpg)
¿Preguntas?¿Preguntas?