Wednesday, September 2, 2009

WS-Policy and My Dog Lily


This is my dog, Lily. Besides being and adorable puppie-wuppie, she was born blind. Yet here is a picture of her swimming in a lake. I wish I had video of her...she will swim out and fetch the ball. I'm not kidding. She is amazing. So how does she do it? Well, as it turns out "sighted" dogs have lousy sight. Dogs actually have a really good sense of smell, and hearing, and Lily uses some combination of these find the ball.

WS-Policy, despite what people make think, does not necessarily make interoperability of web-services any easier. Practical interoperability is actually achieved at the WS-Security level - through the exchange of messages. WS-Policy as a standard does not prescribe what the corresponding message looks like. It just says "this message is going to be encrypted with Basic 256". We can all agree that there are lots of ways that SOAP message could look...WS-Security gives us a lot of help here, but as you wade through the various pieces of WS-Security specification, and get into things like Derived and Encrypted Keys, there are a lot of inferences that are left to be made between the WS-Policy and the SOAP message.

I'm not on a crusade against WS-Policy, but I've run into a number of customers in the past few weeks that have gotten hung up on WS-Policy and in particular OSB's inability in the current release to consume WS-Policy on a WSDL. This is just a "Blind Dog"...OSB has rich WS-Security capabilities and can work with many of those end points even if it doesn't understand the assertions. Why? Because OSB supports WS-Security 1.0, SAML 1.1, Transport Level Security with SSL...and these capabilities are broadly interoperable with a number of Web Service vendors and implementations.

The key is that OSB, and WLS and OWSM for that matter, all have the ability to define a policy to be used on the client. It does not have to come from the WS-Policy attached to the WSDL. The "trick" is that you may have to simply remove the offending WS-Policy statements from the WSDL - and save it locally - to get client side stubs to get design time tooling - OSB pipeline or JAX-WS/RPC client stubs.

This does require some understanding of what the server's WS-Policy is trying to say...that is what does it expect....version of WS-Security, Is it signed, Is it encrypted, what tokens are included? Fortunately, WLS, OSB and OWSM all include pre-built client side policies that include some best practices and common scenarios, so that in most cases, you won't have to start from scratch, or modify the client policies at all. You just need to know which one to pick...pretty straight forward, assuming that you know something about the WS-Policy and what it means. If your expectation is that WS-Policy will just magically make security happen, then I think that we as an industry are a long way away from that Nirvana.

I work with many customers that have WS-Policy implementations that both "sides" understand, but still the messages don't work. There is no substitute for testing....that is vendor-to-vendor industry interoperability testing. Vendors continue to invest in this, but in the mean time, if you're going to use WS-Policy you'll need to understand how it works at some level. Remember, SSL or some other transport level security is always a reasonable choice. It meets many SOA security use cases.

3 comments:

  1. Josh,

    We struggled against this situation in the WS-SX committee for many years. The WS-SecurityPolicy specification is an extremely complex document (115 pages in the last version I saw) with laudable goals but with poor performance as far interoperability goes.

    Rich Levinson from Oracle has created a "Security Policy Examples" document (in spite of bitter opposition from various parties!) which lists a couple of dozen security scenarios and associated security policy expressions. Several vendors have also interoped against selected scenarios from the document.

    We have been pushing product management and customers to understand that basically these are the scenarios to focus on - going beyond is going to require explicit interop and lots of detailed work.

    Here is a link to latest version of the doc:

    http://www.oasis-open.org/committees/download.php/32873/WS-SX-ExamplesDocAndInteropMessages-cd-01-06.zip

    ReplyDelete
  2. Prateek,

    Thanks for the link. I'll be sure to share it with customers in the future.

    JB

    ReplyDelete
  3. @Jost: Good blog.
    @Prateek: Thanx for the link, very interesting material.

    At the moment I'm struggling very hard with OSB and Siebel communication using a very basic ws-security mechanism.

    http://forums.oracle.com/forums/message.jspa?messageID=4171012#4171012

    Sadly my sense of smell and hearing isn't that good as Lily. Otherwise I might be able to find "the ball" earlier ;-)

    Well it's back to the trenches for me.

    ReplyDelete

Note: Only a member of this blog may post a comment.