Secured SOA

105
Secured SOA By Prabath Siriwardena ~ WSO2 Santa Clara , CA

Transcript of Secured SOA

Page 1: Secured SOA

Secured SOABy Prabath Siriwardena ~ WSO2

Santa Clara , CA

Page 2: Secured SOA
Page 3: Secured SOA
Page 4: Secured SOA
Page 5: Secured SOA
Page 6: Secured SOA

Securing a Web Service..???

Page 7: Secured SOA
Page 8: Secured SOA
Page 9: Secured SOA

People Can SEE What You Send

Page 10: Secured SOA

People Can ALTER What You Send

Page 11: Secured SOA

People Can ALTER What You Send

Page 12: Secured SOA

Anyone Can CALL Your Service

Page 13: Secured SOA

People SEE What’s On

Page 14: Secured SOA

People Can ALTER What’s On

Page 15: Secured SOA

People Can ALTER What’s On

Page 16: Secured SOA

HTTP is NOT Secured

Page 17: Secured SOA

HTTPS

Page 18: Secured SOA

HTTPS is Transport Level

Page 19: Secured SOA
Page 20: Secured SOA
Page 21: Secured SOA

Security inherited from the transport channel

Page 22: Secured SOA

Safe only while on the transport

Page 23: Secured SOA

Parts of the message CANNOT

BEencrypted

Page 24: Secured SOA
Page 25: Secured SOA

Authenticating with HTTPS ?

Page 26: Secured SOA

BasicAuth

Page 27: Secured SOA
Page 28: Secured SOA
Page 29: Secured SOA
Page 30: Secured SOA

Mutual Authentication

Page 31: Secured SOA

SSL Handshake

Page 32: Secured SOA

CLIENT_HELLO

Highest SSL Version,

Ciphers Supported,

Data Compression Methods,

SessionId = 0,

Random Data

Page 33: Secured SOA

SERVER_HELLO

Selected SSL Version,

Selected Cipher,

Selected Data Compression Method,

Assigned Session Id,

Random Data

Page 34: Secured SOA

CERTIFICATE

Public Key,

Authentication Signature

Page 35: Secured SOA

CLIENT_CERT_REQUEST

[Optional]

Page 36: Secured SOA

CLIENT_CERT

[Optional]

Page 37: Secured SOA

CLIENT_KEY_EXCHANGE

Page 38: Secured SOA

CERTIFICATE_VERIFY[Optional]

Page 39: Secured SOA

CHANGE_CIPHER_SPEC

Page 40: Secured SOA

FINISHED

Page 41: Secured SOA

CHANGE_CIPHER_SPEC

Page 42: Secured SOA

FINISHED

Page 43: Secured SOA

MONDAY Morning

Page 44: Secured SOA

NOT Happy With HTTPS

Page 45: Secured SOA

Requires END To END Security

Page 46: Secured SOA

Parts of message need to be Encrypted

Page 47: Secured SOA

<soap:Envelope > <soap:Body>

<ns1:withdrawMoney > <param1></ param1><param2></ param2><param3></ param3>

</ ns1:withdrawMoney > </soap:Body>

</soap:Envelope>

Page 48: Secured SOA

<soap:Envelope > <soap:Body>

<ns1:withdrawMoney > <param1></ param1><param2></ param2><param3></ param3>

</ ns1:withdrawMoney > </soap:Body>

</soap:Envelope>

Page 49: Secured SOA

Message Level Security

Page 50: Secured SOA

XML Encryption

Page 51: Secured SOA

XML Signature

Page 52: Secured SOA

WS - Security

Page 53: Secured SOA

Confidentiality

Page 54: Secured SOA

Integrity

Page 55: Secured SOA

NON - Repudiation

Page 56: Secured SOA

Authentication

Page 57: Secured SOA

UsernameToken

Page 58: Secured SOA

<wsse:UsernameToken wsu:Id="Example-1"><wsse:Username> ... </wsse:Username><wsse:Password

Type="..."> ... </wsse:Password><wsse:Nonce

EncodingType="..."> ... </wsse:Nonce><wsu:Created> ... </wsu:Created>

</wsse:UsernameToken>

Page 59: Secured SOA

NOBODY Can See the Message in Clear Text Other

than the Intended Recipient

Page 60: Secured SOA

NOBODY In the Middle Can ALTER the Message

Page 61: Secured SOA

Only the Authenticated Users Can Invoke the Service

Page 62: Secured SOA

Sign & Encrypt OR Encrypt & Sign

Page 63: Secured SOA

Sign & Encrypt

MessgaeSignture

Page 64: Secured SOA

XML Signature defines THREE

types of signatures

Page 65: Secured SOA

<Message>

</Message>

</Signature>

<Signature>

Page 66: Secured SOA

<Message>

</Message>

<Signature>

</Signature>

Page 67: Secured SOA

<Message>

</Message>

<Signature>

</Signature>

Page 68: Secured SOA

<Message>

</Message>

<Signature>

</Signature>

<Envelope>

</Envelope>

<Header>

</Header><Body>

</Body>

Page 69: Secured SOA

Sign & EncryptWith

WS-Security

Page 70: Secured SOA

<Message>

</Message>

<Envelope>

</Envelope>

<Body>

</Body>

1

Page 71: Secured SOA

<Message>

</Message>

<Signature>

</Signature>

<Envelope>

</Envelope>

<Header>

</Header><Body>

</Body>

2

Page 72: Secured SOA

<EncryptedData>

</EncryptedData>

<Signature>

</Signature>

<Envelope>

</Envelope>

<Header>

</Header><Body>

</Body>

3

Page 73: Secured SOA

Encrypt & SignMessgaeSignture

Page 74: Secured SOA

<Message>

</Message>

<Envelope>

</Envelope>

<Body>

</Body>

1

Page 75: Secured SOA

<EncryptedData>

</EncryptedData>

<Envelope>

</Envelope>

<Body>

</Body>

2

Page 76: Secured SOA

<EncryptedData>

</EncryptedData>

<Signature>

</Signature>

<Envelope>

</Envelope>

<Header>

</Header><Body>

</Body>

3

Page 77: Secured SOA

XML SignatureXML

EncryptionUsername

Token ProfileX.509 Token

Profile

WS - Security

Page 78: Secured SOA

DONE with My First Assignment

Page 79: Secured SOA

BUT… Paul NOT Happy

Page 80: Secured SOA

Authentication LIMITED to

INTERNAL Users ONLY

Page 81: Secured SOA

Users OUT SIDE OurDomain Need ACCESS

Page 82: Secured SOA

We DON’T Have Their Credentials

Page 83: Secured SOA

We Can’t Use UsernameToken

Page 84: Secured SOA

Delegate Authentication to the External Domain

itself

Page 85: Secured SOA

They Should Know How to Authenticate Their Own

Users

Page 86: Secured SOA

We TRUST What the External Domain Says

Page 87: Secured SOA
Page 88: Secured SOA

WS-TRUST

Page 89: Secured SOA

<s:Envelope><s:Header>

<wsa:Action>http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue

</wsa:Action></s:Header><s:Body>

<wst:RequestSecurityToken><wst:TokenType>

http://example.org/mySpecialToken</wst:TokenType><wst:RequestType>

http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</wst:RequestType>

</wst:RequestSecurityToken></s:Body>

</s:Envelope>

Page 90: Secured SOA

<s:Envelope><s:Header>

<wsa:Action>http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/Issue

</wsa:Action></s:Header><s:Body>

<wst:RequestSecurityTokenResponseCollection> <wst:RequestSecurityTokenResponse>

<wst:RequestedSecurityToken><xyz:CustomToken xmlns:xyz="..."> </xyz:CustomToken>

</wst:RequestedSecurityToken> </wst:RequestSecurityTokenResponse> </wst:RequestSecurityTokenResponseCollection>

</s:Body> </s:Envelope>

Page 91: Secured SOA

XML Signature

XML Encryption

Username Token Profile

X.509 Token Profile

WS - Security

WS - Trust

Page 92: Secured SOA

Another Problem on HAND…

Page 93: Secured SOA

How Do We Communicate our Security

Requirements to Outsiders ?

Page 94: Secured SOA

The Encryption Algorithm We Use…

Page 95: Secured SOA

Key Size…

Page 96: Secured SOA

Token Types…

Page 97: Secured SOA

Elements to be Signed…

Page 98: Secured SOA

Elements to be Encrypted…

Page 99: Secured SOA

Use Symmetric Key or Asymmetric Key…

Page 100: Secured SOA

WS-Security Policy

Page 101: Secured SOA

Finally… all on the White Board…

Page 102: Secured SOA
Page 103: Secured SOA
Page 104: Secured SOA

http://wso2.com

http://wso2.com/about/contact

[email protected]

[email protected]

Page 105: Secured SOA

Thank You…!!!