Wednesday, October 31, 2007

SOA Part 3 - WS-Security

When we talk about security, we need to be concerned about all aspects of security: authentication, authorization, integrity, confidentiality, and auditing.

WS-Security aims to guarantee integrity and confidentiality of SOAP messages. The security considerations could be based on many factors. For example, if application interacts with the Web service directly, transport-layer security provides sufficient protection and better performance. If a Web service request can pass through intermediate servers, the message-layer security provides an end-to-end data protection. If SOAP needs to run on top of multiple protocols, transport-layer security built on HTTP might not be of use.

It is common for an environment to provide both transport-layer and message-layer security for Web services.

Transport-layer security: HTTPS protocol is used to provide point-to-point encryption. In Java, the cert is installed for the JVM the client is running in and is used automatically by the JVM to do SSL handshake.

One configuration I have seen is to have Transport layer protection up to the proxy server. Once it is inside the DMZ zone, the protection of data is via the server access control.

Message-layer security: WS-Security specification describes how to encode X.509 certificates, Kerberos tickets, and UsernameTokens as part of a SOAP message.

WS-Security specification could be used to provide authentication, authorization, and encryption of the request and response. We might use WS-Security to only authenticate requests but not encrypting Web service requests and response if we already use HTTPS/SSL for the transport.

One thing to point out: for HTTPS/SSL, both requests and responses are encrypted for the duration of the session once the secure link is established. For SOAP, you have to specifically work to enable encryption of the response even if the request is already encrypted.

To provide authorization once the request has been authenticated, you might have to examine the details of the certificate to restrict access to resources. For the Java Web service, a Java Authentication and Authorization Service (JAAS) might come into play.

No comments: