YOUR FEEDBACK
NGASI Releases AppServer Manager 8.1
Dave Jenkins wrote: The remote server management is a welcomed added feature...
SOA World Conference
Virtualization Conference
$200 Savings Expire May 16, 2008... – Register Today!


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SOA World Editorial: Defining Terms
It seems like not a day goes by lately in which some new story of malfeasance in office doesn't come out - whether it's lying under oath, using the services of a call girl, or spying on other officials in the government in order to further a personal agenda. Clearly, our elected officials don't have
SYS-CON.TV
TODAY'S TOP SOA & WEBSERVICES LINKS


Don't Forget Security on the Way Out
Security requirements for a Web service that are often overlooked

Digg This!

Typically when we think about security for a Web service, our focus is on how to protect it from unauthorized and malicious users. Thus, we tend to concentrate on such things as authentication of the requestor, checking to see that the requestor is authorized to access the service, validation of the request message, and so forth - all things that happen on the way in or during a request for the service. However, there is an equally important set of security functions that need to occur on the way out or after the service has finished processing the request.

Because these security requirements are not as apparent when thinking about Web services security, they tend to get built in as an afterthought without as much design and consideration as is necessary. This article describes some of the important security requirements that need to be considered beyond the typical steps that occur during a service request. In this article we'll refer to these steps as "security on the way out."

Typical View of Web Services Security - Only Half of the Picture
Figure 1 shows a simplified view of what we tend to concentrate on when thinking about Web services security. A requestor issues a request for a Web service in the form of a SOAP message. As part of this message, there are claims about the identity of the requestor and any associated attributes. When the Web service receives this request, it first verifies the identity of the requestor. Once the identity is verified, it compares the attributes associated with the identity against those referenced in its security policy to determine if the requestor is authorized. Next, it validates the request message, verifying any signatures, validating the XML, and so forth. When all of this is successful, the request is passed to the service implementation for processing. Although accomplishing all of this is by no means trivial, this is only half of the picture.

The Complete Picture
Figure 2 represents a more complete picture of Web services security, showing all of the steps that occur on the way in as described above, plus all of the steps that may need to occur on the way out. The following are some of the steps:

  • Filtering the content of the response message
  • Signing the response message (or selected elements of it)
  • Encrypting the response message (or selected elements of it)
  • Inserting any additional security tokens
The next several sections describe each of these steps in more detail, including the motivation for why they may be needed.

Content Filtering
In many cases, even though the requestor may be authorized to access a service, it may not be authorized to access all of the data that is produced or retrieved by that service. Thus, the contents of the response will need to be filtered to return only the data that the requestor is authorized to access. For example, within the Department of Defense (DOD), a requestor may invoke an enterprise search service to find information related to biological weapons. That search service may find a set of documents related to biological weapons, some of which are classified as Secret and some classified as Top Secret. If the requestor only has a clearance level of Secret, then the search service will need to filter out the documents classified as Top Secret before returning the response.

Ideally, this type of functionality should be handled in the security infrastructure, separate from the implementation of the service. One approach may be to use a message handler that intercepts outbound messages from the Web service and uses XSLT to filter out content that the requestor is not authorized to see. One drawback to this approach is that it may not be the most efficient approach. In some cases, it may make more sense to filter out the content before everything is converted to XML. In other cases, this may not even be feasible. Considering the DOD example from above, if the schema definition for the response data does not include an element or attribute that specifies the classification level of the data, that information would be lost once the response is converted into XML. Thus, the message handler would not have enough information to properly filter the data. In such cases, it may be necessary to have a post-processing security layer within the service implementation to perform the filtering before the response is converted into XML.

Message Signing
There are two purposes for digitally signing the response message: for nonrepudiation and protecting the integrity of the message. These are typically driven by business or legal agreements that require the response messages to be digitally signed to protect both the service provider and consumer.

For example, the accounts payable department of a large organization may provide a Web service for its partners to submit invoices for payment. The implementation logic of this service will need to verify and approve the invoices that it receives. Upon verification and approval, this service will need to digitally sign a response message that is sent back to the partner indicating that the invoice has been received, verified, and approved. If there is ever any type of dispute over late or missing payments, the partner will have a digitally signed response proving that the organization did receive and approve the invoice it sent.

In some cases, the total amount due that is specified on an invoice may not be the total amount that is approved for payment, perhaps because not all goods were delivered or some were defective. Whatever the case may be, the response from this invoicing service may contain an element that specifies the actual amount that was approved for payment. The service provider may want to sign that element of the response message to protect its integrity - so that it can't be modified without detection. This prevents an unscrupulous partner from disputing that a greater amount was approved for payment.

Digitally signing the response message should be handled in the security infrastructure. The implementation should use the W3C specification for XML Signature [XMLSIG]. This is a formal recommendation from W3C that describes the syntax and processing rules for digitally signing selected elements in an XML document. The Web Services Security (WS-Security) standard from OASIS describes how XML Signature can be used to secure SOAP messages and how the signature should be attached to the message headers [WSSEC]. Following this standard allows loosely coupled service providers and consumers to independently sign and verify the SOAP messages that they exchange. Most Web service security products available today provide an outbound message handler that can be plugged into the service and digitally sign the XML response message. Some vendors offer dedicated XML hardware appliances that can "sit in front of" the Web service and intercept inbound and outbound messages and digitally sign and verify the XML messages.

Message Encryption
The reason why message encryption may be needed on the response is pretty obvious - the response may contain sensitive information that only the intended recipient should see. With traditional applications, confidentiality is typically provided through transport and network-level mechanisms such as SSL and TLS. In a SOA Web services environment, such mechanisms may not always be adequate or feasible. Although not explicitly shown in the Figures 1 and 2, the response message may go through several intermediaries before it is returned to the requestor or the next target service in a process flow. Some of these intermediaries may be trusted and some may not be. Mechanisms such as SSL and TLS are point to point, so the intermediaries will be able to see the response messages unencrypted. For untrusted intermediaries, it is obvious why this is a problem. For trusted intermediaries, there may be elements of the message that they should be able to access and still other elements that should be kept confidential from them. Thus, message-level encryption is needed for selectively encrypting certain elements of the response message and to prevent exposure of the response message to untrusted intermediaries.

Message encryption should be performed after the response has been converted into an XML message. Similar to message signing, this makes it ideal to be performed in the outbound message handler of the security infrastructure. WS-Security describes how XML Encryption should be used to encrypt any section of the body or header of a SOAP message. XML Encryption is another W3C recommendation that specifies a process for encrypting XML data and representing the results in XML [XMLENC]. Using these mechanisms essentially allows encrypting of the response message at the application level, thus avoiding the aforementioned problems. Just as with message signing, most Web service security vendors provide message handlers or XML appliances that can perform the message-level encryption and decryption so that developers will not need to build it into the service's implementation.

Insert Security Tokens
With the composite nature of SOA-based systems, the flow usually does not stop at a single Web service. That service may need to invoke another service or its response may be returned to an orchestration engine that uses the contents as input to the next service in the process flow. In either case, the service may need to forward along the security tokens from the original requestor or it may need to insert some new tokens with information about the service provider. A security token is just a collection of claims or statements (usually about the identity, privileges, group memberships, etc.) about a subject, which in this case can be the Web service itself or the original requestor of the service. Adding security tokens to the outbound message (either a response or a new request for another service) from a Web service allows the next target service in the flow to authenticate who is making the request and to make an authorization decision.

Adding security tokens to an outbound message can be supported by having an outbound message handler that intercepts the message on the way out and inserts the tokens into the message headers. Unfortunately, the heterogeneous environment in which a Web service typically operates often adds extra complexity. Security tokens can be expressed in multiple formats such as X.509 certificates, Kerberos tickets, or SAML assertions. In a heterogeneous environment there may be multiple interacting domains with different security infrastructures, and they may not all support the same format for security tokens. Thus, the security token inserted by the outbound message handler may not always be interoperable with the security infrastructure of the next target service. Web Services Trust (WS-Trust) is a set of specifications, proposed by vendors such as IBM, BEA, and Microsoft, which describes how security tokens can be issued and exchanged through a trusted authority to enable interoperability across security domains [WSTRUST]. WS-Security defines how security tokens should be represented and attached to the headers of a SOAP message. Using a Web service security product that supports both WS-Security and WS-Trust may help to alleviate some of the complexity involved with supporting this requirement.

Summary
In this article we discussed security requirements on the way out from a Web service. Such requirements typically don't get as much consideration when we think about Web services security. We discussed content filtering, signing the response message, encrypting the response message, and inserting security tokens. These requirements are almost identical to the steps that a client performs when sending a request to a service. The same technologies and standards are used to support both. Fundamentally, this is because the interactions between Web services and their requestors resemble more of a peer-to-peer model instead of the traditional client-to-server model. From a security perspective, this means that there is almost always a parallel set of security processing steps that needs to occur in the other half of the interacting peers. Keeping this in mind when designing the security for your SOA will help to ensure that you're not just supporting half of the requirements.

References

About Tieu Luu
Tieu Luu is an Associate with Booz Allen Hamilton where he works on architectures and strategies for large enterprise systems. Prior to Booz Allen Hamilton, Tieu held lead engineering positions at companies including Grand Central Communications, Mercator Software, and Aether Systems where he worked on the development of integration and mobile computing platforms. You can read more of Tieu’s writing at his blog at http://thluu.blogspot.com.

SYS-CON Australia News Desk wrote: Typically when we think about security for a Web service, our focus is on how to protect it from unauthorized and malicious users. Thus, we tend to concentrate on such things as authentication of the requestor, checking to see that the requestor is authorized to access the service, validation of the request message, and so forth - all things that happen on the way in or during a request for the service. However, there is an equally important set of security functions that need to occur on the way out or after the service has finished processing the request.
read & respond »
SOA WORLD LATEST STORIES
HP Launches New Versions Of SOA Testing Products
HP has introduced enhanced quality and management software designed to meet new requirements for mainstream deployment of service-oriented architectures (SOA) by businesses. To make sure that services meet all functional and performance objectives and are ready for production deploymen
Why Enterprise Architects Continue to Fall Short with SOA
If you read this column and listen to my podcasts, you know that I call SOA what SOA is - an architectural pattern. In many instances, SOA is a vital component of healthy enterprise architecture. Indeed, I've provided some keynote talks around this very topic at about half-a-dozen ente
Aras Delivers Version 9 of Advanced Model-Based SOA for Enerprise PLM
Aras announced the availability of Version 9 of the Aras Innovator suite of model-based service-oriented architecture (SOA) solutions for enterprise Product Lifecycle Management (PLM). Version 9 delivers model-based SOA for PLM and includes single-instance multi-language capabilities a
Skyway Software Launches SOA Developer Contest at JavaOne
Skyway Software, announced a SOA developer contest. The SOA design and delivery solutions provider announced the contest with a prize of a $2500 gas card for the winner. The company feels that the basics are very easy. The winner would also get a copy of the Skyway SOA Platform - Devel
Micro Focus Upgrades SOA Express for IBM CICS
Micro Focus announced the availability of SOA Express 8.0. The new version adds support for direct deployment into IBM's Customer Information Control System (CICS), enabling users to accelerate the deployment of Web services by reusing their existing CICS TS mainframe infrastructure in
Oracle Previews Fusion Middleware 11g
Building on its November 2007 preview, Oracle previewed additional planned feature enhancements of Oracle Fusion Middleware 11g. Based on feedback resulting from close cooperation with customers testing in real-world environments, the latest preview of Oracle Fusion Middleware 11g incl
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS


ADS BY GOOGLE