secure web services arvind easwaran (arvinde@seas) cis/tcom 551 spring 2004 slide set 7

44
Secure Web Secure Web Services Services Arvind Easwaran Arvind Easwaran (arvinde@seas) (arvinde@seas) CIS/TCOM 551 Spring 2004 CIS/TCOM 551 Spring 2004 Slide Set 7 Slide Set 7

Upload: tiffany-mcdaniel

Post on 18-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Secure Web ServicesSecure Web Services

Arvind Easwaran Arvind Easwaran (arvinde@seas)(arvinde@seas)

CIS/TCOM 551 Spring 2004CIS/TCOM 551 Spring 2004

Slide Set 7Slide Set 7

Page 2: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

OutlineOutline

Web Services (WS): An overviewWeb Services (WS): An overview XML BasicsXML Basics SOAP BasicsSOAP Basics WSEmail : The real oneWSEmail : The real one Security in WSSecurity in WS

Page 3: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Web Services (WS) Web Services (WS) OverviewOverview

Page 4: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Today’s WebToday’s Web

Designed for applications involving human Designed for applications involving human interactionsinteractions

Intended purpose Intended purpose – Information sharing: a distributed content libraryInformation sharing: a distributed content library– Enabled B2C e-commerceEnabled B2C e-commerce– Non-automated B2B interactionsNon-automated B2B interactions

How did it happen?How did it happen?– Built on very few standards: http + htmlBuilt on very few standards: http + html– Shallow interaction model: very few Shallow interaction model: very few

assumptionsassumptions– Result was ubiquityResult was ubiquity

Page 5: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

What’s next?What’s next?

There is a lot more we can do !There is a lot more we can do !– Open, automated B2B e-commerceOpen, automated B2B e-commerce– Business process integration on the WebBusiness process integration on the Web– Resource sharing, distributed computingResource sharing, distributed computing

Existing Web technology is Existing Web technology is ad hoc ad hoc for thisfor this– Application-to-application interactions with Application-to-application interactions with

HTML formsHTML forms Goal Goal

Enabling systematic application-to-Enabling systematic application-to-application interaction on the Webapplication interaction on the Web

Page 6: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Web ServicesWeb Services

““Web services” is an effort to build a Web services” is an effort to build a distributed computing platform for the Webdistributed computing platform for the Web

Web service applications are encapsulated, Web service applications are encapsulated, loosely coupled Web “components” that loosely coupled Web “components” that can bind dynamically to each othercan bind dynamically to each other

The Penn – Amazon exampleThe Penn – Amazon example

Page 7: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Typical Web Service Typical Web Service ComponentsComponents

Page 8: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

SOAPSOAPSOAPSOAP Web Services consumers send and Web Services consumers send and

receive SOAP messages receive SOAP messages

WSDLWSDLWeb Services Web Services

Description LanguageDescription Language

WSDLWSDLWeb Services Web Services

Description LanguageDescription Language

Web Services are defined in terms of the Web Services are defined in terms of the formats and ordering of messagesformats and ordering of messages

Built using open Internet protocols Built using open Internet protocols XML & HTTPXML & HTTP

Web Services Architecture Web Services Architecture

A programmable application A programmable application component accessible via standard component accessible via standard Web protocolsWeb protocols

OpenOpen Internet Internet Protocols Protocols

Web Web ServiceService

UDDIUDDIUniversal Description, Universal Description,

Discovery, and IntegrationDiscovery, and Integration

UDDIUDDIUniversal Description, Universal Description,

Discovery, and IntegrationDiscovery, and Integration

Provide a Directory of Services on the Provide a Directory of Services on the InternetInternet

Page 9: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Web Services FrameworkWeb Services Framework

Framework can be described in terms ofFramework can be described in terms of– What goes “on the wire”What goes “on the wire”

Formats and protocols : XML and SOAP Formats and protocols : XML and SOAP using HTTPusing HTTP

– What describes what goes on the wireWhat describes what goes on the wireDescription languages : WSDLDescription languages : WSDL

– What allows us to find these descriptionsWhat allows us to find these descriptionsDiscovery of services : UDDIDiscovery of services : UDDI

Page 10: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

XMLXML

Page 11: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

What is XML?What is XML?

Extensible Markup LanguageExtensible Markup Language Meta language that Meta language that

– Allows to create and format own document Allows to create and format own document markupsmarkups

a method for putting structured data into a method for putting structured data into a text file a text file

- easy to read- easy to read- unambiguous- unambiguous- extensible- extensible- platform-independent- platform-independent

Page 12: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Sample XML ExampleSample XML Example

<?xml version=“1.0” encoding=“…”?><?xml version=“1.0” encoding=“…”?><msg:message from=“id” to=“id” xmlns:msg=“URI” <msg:message from=“id” to=“id” xmlns:msg=“URI”

xmlns:po=“URI”>xmlns:po=“URI”><msg:text><msg:text>

Hi please bill to the following addressHi please bill to the following address</msg:text></msg:text><msg:item><msg:item>

<po:po id=“123”><po:po id=“123”> <po:billto><po:billto>

<po:company> Skateboard </po:company><po:company> Skateboard </po:company> <po:street> One Warehouse Park </po:street><po:street> One Warehouse Park </po:street> <po:city> Boston </po:city><po:city> Boston </po:city>

</po:billto></po:billto> </po:po></po:po>

</msg:item></msg:item></msg:message> </msg:message>

Page 13: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

XMLXML Declaration Declaration

<?xml version=“1.0” encoding=“…”?><?xml version=“1.0” encoding=“…”?>

<?xml ?> the XML declaration<?xml ?> the XML declaration – Not required, but typically usedNot required, but typically used– Attributes include:Attributes include:

VersionVersion Encoding – the character encodingEncoding – the character encoding

Page 14: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

XMLXML Element Element

<msg:message from=“id” to=“id” xmlns:msg=“URI” <msg:message from=“id” to=“id” xmlns:msg=“URI” xmlns:po=“URI”>xmlns:po=“URI”><msg:text><msg:text>

Hi please bill the followingHi please bill the following</msg:text></msg:text><msg:item><msg:item>

<po:po id=“123”><po:po id=“123”> … …

</po:po></po:po> </msg:item></msg:item>

</msg:message> </msg:message>

<tag> text/element </tag> an element<tag> text/element </tag> an element Each element tag can be divided into 2 parts Each element tag can be divided into 2 parts Namespace, Tag Namespace, Tag

namename

Page 15: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

XML AttributeXML Attribute

<msg:message from=“id” to=“id” xmlns:msg=“URI” <msg:message from=“id” to=“id” xmlns:msg=“URI” xmlns:po=“URI”>xmlns:po=“URI”>

…… <po:po id=“123”><po:po id=“123”>

… … </po:po></po:po>

</msg:message> </msg:message>

XML Attribute XML Attribute – Describes additional information about an elementDescribes additional information about an element– <tag key=”value”> text</tag><tag key=”value”> text</tag>– Reserved attribute Reserved attribute xml:lang xml:lang

Page 16: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

XMLXML Namespaces Namespaces

<msg:message from=“id” to=“id” <msg:message from=“id” to=“id” xmlns:msg=“URI” xmlns:po=“URI”>xmlns:msg=“URI” xmlns:po=“URI”>

……</msg:message> </msg:message>

NamespacesNamespaces– Not mandatory, but useful in giving uniqueness Not mandatory, but useful in giving uniqueness

to an elementto an element– Declared using the xmlns:Declared using the xmlns:namename= “= “value”value”

Page 17: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

SOAPSOAP

Page 18: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

SOAPSOAP

An XML envelope for XML messagingAn XML envelope for XML messaging Headers + bodyHeaders + body SOAP is “transport independent”SOAP is “transport independent” A convention for doing RPCA convention for doing RPC

Page 19: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Soap Message ProcessingSoap Message Processing

Page 20: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

SOAP Message ExampleSOAP Message Example

<?xml … ?><?xml … ?><SOAP-ENV:Envelope xmlns:SOAP-ENV=“URI” ><SOAP-ENV:Envelope xmlns:SOAP-ENV=“URI” >

<SOAP-ENV:Header><SOAP-ENV:Header> <t:Transaction xmlns:t=“URI” SOAP-ENV:mustUnderstand=“1” ><t:Transaction xmlns:t=“URI” SOAP-ENV:mustUnderstand=“1” >

1234512345 </t:Transaction></t:Transaction> <p:Priority xmlns:p=“URI”><p:Priority xmlns:p=“URI”>

Very HighVery High </p:Priority></p:Priority></SOAP-ENV:Header></SOAP-ENV:Header>

<SOAP-ENV:Body><SOAP-ENV:Body>““XML Document”XML Document”

</SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope></SOAP-ENV:Envelope>

Page 21: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

WSEmailWSEmail

Carl GunterCarl Gunter

Kevin LuxKevin Lux

Michael MayMichael May

Page 22: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

WSEmailWSEmail

Traditional Internet EmailTraditional Internet Email– Based on a collection of protocolsBased on a collection of protocols

SMTP, POP, IMAPSMTP, POP, IMAP

– Evolved over a vast installed baseEvolved over a vast installed base– ShortcomingsShortcomings

FlexibilityFlexibility Security and Security and IntegrationIntegration

Page 23: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

WSEmail : The SolutionWSEmail : The Solution

Aims to exploit advantages of web Aims to exploit advantages of web service protocolsservice protocols

Uses web service security features to Uses web service security features to support integrity, authentication, and support integrity, authentication, and access control for both end-to-end access control for both end-to-end and hop-by-hop message and hop-by-hop message transmissionstransmissions

A collection of services that can be A collection of services that can be added to the base systemadded to the base system

Page 24: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

The Solution (Contd)The Solution (Contd)

A way to integrate different A way to integrate different messaging systemsmessaging systems

Prototype system is built using Prototype system is built using Microsoft .Net Microsoft .Net

On-demand attachmentsOn-demand attachments Integrated instant messagingIntegrated instant messaging

Page 25: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

ArchitectureArchitecture

Page 26: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Architecture (Contd)Architecture (Contd)

Sender Client SC makes a call on its Sender Sender Client SC makes a call on its Sender Server SSServer SS

All calls are SOAP calls over TCPAll calls are SOAP calls over TCP The server SS then makes a call on the The server SS then makes a call on the

Receiver Server RSReceiver Server RS The Receiver Client RC periodically makes The Receiver Client RC periodically makes

calls to RCcalls to RC Security based on standards for web service Security based on standards for web service

security possibly supported by encrypted security possibly supported by encrypted tunnelstunnels

Page 27: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Architecture (Contd)Architecture (Contd)

Hop-by-hop confidentiality, so Hop-by-hop confidentiality, so communications between the nodes can communications between the nodes can be protected by TLSbe protected by TLS

Clients like SC and RC are typically Clients like SC and RC are typically authenticated by a passwordauthenticated by a password

Servers authenticate themselves using Servers authenticate themselves using certificatescertificates

Such certificates are used in TLS and used Such certificates are used in TLS and used to sign messages using XMLDSIGto sign messages using XMLDSIG

Page 28: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Variations – Security TokenVariations – Security Token

Page 29: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Security Token (Contd)Security Token (Contd)

SC contacts SS to obtain a security token SC contacts SS to obtain a security token recognized by RSrecognized by RS

SC sends a message authenticated with this SC sends a message authenticated with this credential to RScredential to RS

Instant messages are posted directly to the Instant messages are posted directly to the clientclient

RS and RC apply access control for this RS and RC apply access control for this function based on the security token from function based on the security token from SCSC

Token is recognized because of a form of Token is recognized because of a form of federated identity between SS and RSfederated identity between SS and RS

Page 30: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7
Page 31: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

SecuritySecurity

Page 32: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Why Web Services Security Why Web Services Security is a Challengeis a Challenge

Theory: This thing has 4 wheel drive But we only take it to the Mall

Practice: In this environment we need 4 wheel drive

Page 33: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Message Level SecurityMessage Level Security

Page 34: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Example : SC to SSExample : SC to SS

<wsse:Security SOAP-ENV:mustUnderstand="1“<wsse:Security SOAP-ENV:mustUnderstand="1“ SOAP-ENV:actor=“…” xmlns:wsse=“…"> SOAP-ENV:actor=“…” xmlns:wsse=“…">

<wsse:UsernameToken xmlns:wsu=“…“<wsse:UsernameToken xmlns:wsu=“…“ wsu:Id="SecurityToken…">wsu:Id="SecurityToken…"><wsse:Username>SC</wsse:Username><wsse:Username>SC</wsse:Username> <wsse:Nonce>…</wsse:Nonce><wsse:Nonce>…</wsse:Nonce> <wsu:Created>Date</wsu:Created> <wsu:Created>Date</wsu:Created> </wsse:UsernameToken> </wsse:UsernameToken>

Page 35: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

<Signature> <Signature> <SignedInfo> <SignedInfo>

<CanonicalizationMethod <CanonicalizationMethod Algorithm=“…" /> Algorithm=“…" />

<SignatureMethod Algorithm=“hmac-<SignatureMethod Algorithm=“hmac- sha1" /> sha1" />

<Reference URI="#Id…"> <Reference URI="#Id…"> <Transforms> <Transform <Transforms> <Transform Algorithm="xml-exc-c14n#" /> Algorithm="xml-exc-c14n#" /> </Transforms></Transforms><DigestMethod <DigestMethod Algorithm="xmldsig#sha1" /> Algorithm="xmldsig#sha1" /><DigestValue>…</DigestValue> <DigestValue>…</DigestValue>

</Reference></Reference></SignedInfo> </SignedInfo>

Page 36: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

<SignatureValue>…</SignatureValue><SignatureValue>…</SignatureValue>

<KeyInfo> <KeyInfo> <wsse:SecurityTokenReference> <wsse:SecurityTokenReference>

<wsse:Reference <wsse:Reference URI=“…" /> URI=“…" /> </wsse:SecurityTokenReference> </wsse:SecurityTokenReference> </KeyInfo> </KeyInfo>

</Signature> </Signature>

</wsse:Security> </wsse:Security>

Page 37: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

CanonicalizationCanonicalization

Logically equivalent physically Logically equivalent physically different XML snippetsdifferent XML snippets

– <p a=“1” b=“2”> </p><p a=“1” b=“2”> </p>

– <p a=“1” b=“2” /><p a=“1” b=“2” />

Page 38: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

XML Element Specific XML Element Specific SecuritySecurity

<po xmlns=“URI” id=“123”><po xmlns=“URI” id=“123”><enc:EncryptedData Type=“URI”><enc:EncryptedData Type=“URI”>

<enc:EncryptionMethod Algorithm=“…”/><enc:EncryptionMethod Algorithm=“…”/><ds:KeyInfo><ds:KeyInfo>

<ds:KeyName> Shared Key <ds:KeyName> Shared Key </ds:KeyName></ds:KeyName>

</ds:KeyInfo></ds:KeyInfo><enc:CipherData>…</enc:CipherData><enc:CipherData>…</enc:CipherData>

</enc:EncryptedData></enc:EncryptedData>……

</po></po>

Page 39: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

XML Key Management XML Key Management Specification (XKMS)Specification (XKMS)

Management of Public KeysManagement of Public Keys– RegistrationRegistration

Alice registers her email signature public keyAlice registers her email signature public key

– InformationInformation Bob looks up the key for AliceBob looks up the key for Alice Bob checks to see if it is validBob checks to see if it is valid

Core ObjectiveCore Objective– Shield the client from the complexity of PKIShield the client from the complexity of PKI

Page 40: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Platform Level SecurityPlatform Level Security

Page 41: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Security TerminologySecurity Terminology

Authentication Authentication – Positively identifying the clientsPositively identifying the clients– User ID password pairs, X509 certificate etcUser ID password pairs, X509 certificate etc

AuthorizationAuthorization– Defining what authenticated clients are allowed to see Defining what authenticated clients are allowed to see

and doand do– ACLsACLs

Non RepudiationNon Repudiation– Digital SignaturesDigital Signatures

Secure CommunicationSecure Communication– Ensuring that messages remain private and unaltered as Ensuring that messages remain private and unaltered as

they cross networksthey cross networks– SSL point-to-pointSSL point-to-point

Page 42: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

Is SSL Alone Enough?Is SSL Alone Enough?

For For somesome applications applications Yes Yes As Infrastructure As Infrastructure No No

SSL does not support multi-party SSL does not support multi-party transactionstransactions

– Intermediate NodeIntermediate Node

SSL does not support non-RepudiationSSL does not support non-Repudiation Does not leave any audit trail Does not leave any audit trail

Page 43: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

DemoDemo

Page 44: Secure Web Services Arvind Easwaran (arvinde@seas) CIS/TCOM 551 Spring 2004 Slide Set 7

ConclusionsConclusions

Without Security and TrustWithout Security and Trust– Web Services are Dead On ArrivalWeb Services are Dead On Arrival

Considerable progress has already been madeConsiderable progress has already been made– Industry wide consensus on value of standardsIndustry wide consensus on value of standards– Basic Infrastructure is in place or in developmentBasic Infrastructure is in place or in development– There is considerable consensus on the roadmapThere is considerable consensus on the roadmap– Web Services is certainly moving towards a secure Web Services is certainly moving towards a secure

architecturearchitecture