Security Guide

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Configuring Message-Level Security for Web Services

Message-level security applies security checks to a SOAP message after a Web services client establishes a connection with an AquaLogic Service Bus proxy service or business service and before the proxy service or business service processes the message.

Message-level security is categorized as follows:

The following sections describe configuring message-level security for a proxy service or a business service:

Note: The implementation of message-level security includes proxy services that have been configured with message-level custom authentication (either custom token or username/password).

The message-level security mechanisms described in this section work alone or in concert with the message-level custom authentication mechanism, which is described in Configuring Custom Authentication. See Combining WS-Security with Custom Username/Password and Tokens for information about using both types of security.

 


About Message-Level Security

AquaLogic Service Bus supports message-level security for SOAP messages that are sent over the HTTP (including HTTPS) or JMS protocols. Usually you use message-level security in addition to the transport-level security that these protocols offer. You can require Web services clients to provide credentials at the transport level, the message level, or both levels. If you require clients to provide credentials at both levels, AquaLogic Service Bus uses the message-level credentials for proxy service authentication and authorization.

To express the message-level security requirements for a proxy service or business service that is a Web service, you use the Web Services Policy (WS-Policy) framework. The Web Services Policy (WS-Policy) framework is described in Configuring Message-Level Security for Web Services.

With message-level security, a proxy service or business service specifies which of its operations are secured and which of the following security measures a Web services client must apply to its SOAP messages, which contain requests to invoke operations:

All of these security measures require a client to encode security tokens in its SOAP messages, and the proxy service or business service specifies which types of security tokens it requires to be encoded in the SOAP messages.

AquaLogic Service Bus supports the following WS-Security token profiles:

Sample Sequence of Actions in Message-Level Security

To send a SOAP message to a proxy service that requires message-level security, the following actions occur:

  1. A Web services client generates a SOAP header and adds the header to the SOAP message envelope. The header includes digital signatures, security tokens, and other constructs.
  2. When the proxy service processes the secured envelope, it decrypts the message, which removes the security header.
  3. The proxy service then verifies that the message conforms to its security requirements. For example, the proxy service confirms that the required message parts were signed and/or encrypted and that the required tokens are present with the required claims.
  4. The entire process is repeated in reverse for the response from the proxy service to the client.

For more information about WS-Security (which is the OASIS standard that defines message-level security), see Web Services Security: SOAP Message Security 1.0 (WS-Security 2004) at the following URL:
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf

 


Message-Level Access Control Policies for Proxy Services

While message integrity and message confidentiality guarantee that intermediaries do not view or modify messages, and while message authentication requires clients to prove that they are known users, they do nothing to specify which known users are allowed (authorized) to invoke proxy service operations.

To limit access to authorized users, you use the AquaLogic Service Bus Console to create message-level access control policies. These policies allow a proxy service to process only those SOAP messages from authorized clients.

 


Configuring Proxy Service Message-Level Security

You can configure a proxy service to support one of the following techniques for inbound message-level security:

Creating an Active Intermediary Proxy Service: Main Steps

To create a proxy service to act as an active intermediary:

  1. In a text editor or IDE, create a WSDL document to define the proxy service:
    • If you plan to bind the policies directly from the console, the WSDL does not need to have policy statements.
    • If you want the policy to be WSDL-based, attach one or more Web Services Policy (WS-Policy) statements to the WSDL document, including one or more of the predefined policies.
  2. In the AquaLogic Service Bus Console, import the WSDL document into the AquaLogic Service Bus WSDL repository and resolve any WSDL dependencies.
  3. See “Adding a WSDL” in WSDLs in the Using the AquaLogic Service Bus Console.

  4. If you have not already configured the WebLogic security framework to support AquaLogic Service Bus, do one or more of the following depending on whether the WS-Policy of any of the operations in the proxy service contains security policy assertions that secure requests from clients to the proxy service:
  5. In the AquaLogic Service Bus Console, do one or more of the following depending whether the WS-Policy of any of the operations in the proxy service contains security policy assertions that secure responses from the proxy service to clients:
    • If any operation response policy requires digital signatures, configure a service key provider that contains a digital signature credential. You can create one service key provider that contains credentials for both encryption and digital signatures. See “Adding a service key provider” in Service Key Providers in Using the AquaLogic Service Bus Console.
    • If any operation response policy specifies encryption, the client must send its certificate to the proxy service on the request. The proxy service will use the client’s public key to encrypt its response. The client certificate must not be the same as the proxy service’s encryption certificate.
  6. In the AquaLogic Service Bus Console, create a proxy service from the WSDL that you imported in step 1. Activate your changes.
  7. If the WSDL document does not have WS-Policy attachments and you want to add them, or if you want to specify a different WS-Policy from that of the WSDL, edit the proxy service you just created to do the following from the Policies tab:
    1. Select Custom Policy Bindings.
    2. To specify policies that apply to the entire service, expand the service name entry. Click Add to search for and select your policies.
    3. To specify policies that apply to an operation or the request/response of that operation, expand the operation name entry. Click Add to search for and select your policies.
    4. Update the policy binding.

  8. Edit the proxy service you just created to do the following from the Security tab:
    1. Specify the service key provider that you created in step 4.
    2. Select the Process WS-Security Header check box.
    3. Optionally, modify the proxy service’s default message-level access control policy, which specifies conditions under which users, groups, or roles can invoke the secured operations. See “Editing Message-Level Access Policies” under Security Configuration in Using the AquaLogic Service Bus Console.
    4. Optionally, modify the proxy service’s message-level custom authentication settings. See “Editing Message-Level Access Policies” under Security Configuration in Using the AquaLogic Service Bus Console.

Creating a Pass-Through Proxy Service: Main Steps

To create a pass-through proxy service:

  1. Create a business service to which the proxy service will pass the unprocessed SOAP message. There are two configuration methods:
  2. If the WSDL document does not have WS-Policy attachments and you want to add them, or if you want to specify a different WS-Policy from that of the WSDL, edit the business service you just created to do the following from the Policies tab:
    1. Select Custom Policy Bindings.
    2. To specify policies that apply to the entire service, expand the service name entry. Click Add to search for and select your policies.
    3. To specify policies that apply to an operation or the request/response of that operation, expand the operation name entry. Click Add to search for and select your policies.
    4. Update the policy binding.

  3. In the AquaLogic Service Bus Console, create a proxy service from a WSDL document. You can use the same WSDL document that you used for the business service that you created in step 1. Activate your changes.
  4. If you should later edit the proxy service you just created, do not select the Process WS-Security Header check box on the Security tab.
  5. Configure the proxy service to route to the business service that you created in step 1.
  6. If you route to the business service based on the operation that the client’s SOAP message is requesting to invoke, you must configure the routing so that it specifies an operation selection algorithm other than the SOAP body algorithm. Make sure the actions in the proxy service pipeline do not modify the WS-Security header or any parts of the SOAP envelope that are signed or encrypted. Changes to clear-text message parts covered by digital signatures almost always break the digital signature because the signature cannot be verified later.

    See Proxy Services in Using the AquaLogic Service Bus Console.

 


Configuring Business Service Message-Level Security: Main Steps

Outbound message-level security applies to messages between AquaLogic Service Bus proxy services and SOAP-HTTP or SOAP-JMS business services. It applies security to both the request and the response.

To configure outbound message-level security for a business service that represents a SOAP-HTTP or SOAP-JMS Web service:

  1. In a text editor or IDE, create a WSDL document to define the policy.
  2. In the AquaLogic Service Bus Console, import the Web service’s WSDL document into the AquaLogic Service Bus WSDL repository and resolve any WSDL dependencies.
  3. See “Adding a WSDL” in WSDLs in the Using the AquaLogic Service Bus Console.

  4. In the AquaLogic Service Bus Console, do one or more of the following depending on whether the WSDL document contains WS-Policy statements that secure requests from a proxy service to the business service:
    • If any operation request policy includes an identity assertion with WS-Security Username Token as one of the supported token types, configure a service account for the business service. In the service account, provide the user name and password that you want the proxy service to send to the business service. Proxy services that route to this business service will get the username and password from this service account. See Service Accounts and Business Services in the Using the AquaLogic Service Bus Console.
    • If any operation request policy requires authentication with a WS-Security Username/Password token with password digest, make sure to enable password digests. See step 5 in Configuring the WebLogic Security Framework: Main Steps.
    • If any operation request policy requires digital signatures, configure a service key provider that contains a digital signature credential. You can create one service key provider that contains credentials for both encryption and digital signatures. See “Adding a service key provider” in Service Key Providers in Using the AquaLogic Service Bus Console.
  5. If any operation response policy in the business service requires encryption (that is, the business service encrypts the response with the proxy service’s encryption public key), configure a service key provider and assign an encryption credential to the service key provider. See “Adding a service key provider” in Service Key Providers in Using the AquaLogic Service Bus Console.
  6. Caution: Encrypted back-end response messages: If the response policy of the business service specifies encryption, the proxy service will send its encryption certificate to the business service on the request. The business service will encrypt its response using the proxy service’s public key. The proxy service encryption credential must not be the same as the business service encryption credential.
  7. If any policy in the business service specifies using SAML assertions, configure a WebLogic SAML Credential Mapping Provider V2 asserting party. For more information, see Configuring SAML Credential Mapping: Main Steps.
  8. In the AquaLogic Service Bus Console, create a business service from the WSDL that you imported in step 2. Activate your changes.
  9. See Business Services in Using the AquaLogic Service Bus Console.

  10. If you want to directly attach the policies to the service, edit the business service you just created to do the following from the Policies tab:
    1. Select Custom Policy Bindings.
    2. To specify policies that apply to the entire service, expand the service name entry. Click Add to search for and select your policies.
    3. To specify policies that apply to an operation or the request/response of that operation, expand the operation name entry. Click Add to search for and select your policies.
    4. Click Update to update the business service.

  11. Create a proxy service that routes SOAP messages to the business service. You can use either an active-intermediary proxy service or a pass-through proxy service.
  12. See Creating an Active Intermediary Proxy Service: Main Steps.

 


Examples of Custom WS-Policy Statements

The following sections provide examples of custom WS-Policy statements written under the WS-Policy specification using the proprietary BEA schema for security policy:

Example: Encrypting Part of the SOAP Body and Header

If you need to specify that particular parts of the body of a SOAP message are encrypted or digitally signed, rather than the entire body, you must create a custom WS-Policy file.

Listing 7-1 is an abstract WS-Policy statement that does the following:

This policy cannot be used with a business service because it is abstract: its KeyInfo element does not contain the certificate used for encryption. Instead, when you activate a proxy service that uses this WS-Policy statement, AquaLogic Service Bus binds to the WS-Policy statement the encryption certificate from the service key provider that you associate with the proxy service. See Service Key Providers in Using the AquaLogic Service Bus Console.

Figure 7-1 Binding a Certificate to an Abstract Policy

Binding a Certificate to an Abstract Policy

Also in Listing 7-1:

Example: Encryption Policy for a Business Service

If you want messages to a business service to be encrypted, you must create a custom WS-Policy. The policy must be concrete (it must contain the encryption certificate instead of using a certificate from a service key provider) and it must be located directly in a WSDL document instead of being included by reference.

Typically, you would require messages to a business service to be encrypted if the proxy service that sends messages to the business service is a pass-through proxy service. That is, the proxy service that receives messages from a client does not process the SOAP message. Instead, the proxy service routes the message to the business service, and the business service takes on the responsibility of Web Services Security. See Message-Level Access Control Policies for Proxy Services.

Listing 7-2 is a WSDL document that contains a concrete policy. Note the following about this example:

Example: Encrypting a Custom SOAP Header

Listing 7-3 is an abstract WS-Policy statement that encrypts a custom header named CreditCardNumber.

If you need to specify that particular parts of the body of a SOAP message are encrypted or digitally signed, rather than the entire body, you must create a custom WS-Policy file.

This policy cannot be used with a business service because it is abstract: its KeyInfo element does not contain the certificate used for encryption. Instead, when you activate a proxy service that uses this WS-Policy statement, AquaLogic Service Bus binds to the WS-Policy statement the encryption certificate from the service key provider that you associate with the proxy service. See Service Key Providers in Using the AquaLogic Service Bus Console.

Also of note in Listing 7-3:

Example: Signing the Message Body and Headers

Listing 7-4 is a WS-Policy statement that requires a digital signature to access the following in the SOAP message:

Example: Signing a SOAP Body with SAML Holder-of-Key

Listing 7-5 is a WS-Policy statement that requires the SAML asserter to use the holder-of-key method to sign the message body. The purpose of a SAML token with "holder-of-key" subject confirmation is to allow the subject to use an X.509 certificate that may not be trusted by the receiver to protect the integrity of the request messages.

For more information about the two SAML confirmation methods (sender-vouches or holder-of-key), see SAML Token Profile Support in WebLogic Web Services.

The WebLogic Server Security Policy Assertion Reference describes the policy elements in detail.

Note the following about this example:

Example: Authenticating, Signing, and Encrypting a SOAP Body and Headers with SAML Sender Vouches

Listing 7-6 is a WS-Policy statement that requires the SAML asserter to use the sender-vouches method to sign the message body and headers.

In sender-vouches the asserting party (different from the subject) vouches for the verification of the subject. The receiver must have a trust relationship with the asserting party.

For more information about the two SAML confirmation methods (sender-vouches or holder-of-key), see SAML Token Profile Support in WebLogic Web Services.

The WebLogic Server Security Policy Assertion Reference describes the policy elements in detail.

Note the following about this example:

 


Disabling Business Service Message-Level Security

Some infrequently used design patterns preempt a proxy service from automatically generating the outbound WS-Security SOAP envelope and instead use an XQuery expression to create the envelope. If you use this design pattern, to prevent a proxy service from automatically generating the outbound WS-Security SOAP envelope, you must create an action in the proxy service’s message flow that sets the value of the ./ctx:security/ctx:doOutboundWss element in the $outbound message context variable to xs:boolean("false"). You can create the action in either of the following places:

For information about the $outbound message context variable, see Message Context in AquaLogic Service Bus User Guide.

Under some circumstances, when you attempt to activate a session in which you have created or modified a proxy service with outbound message-level security disabled, the AquaLogic Service Bus Console reports validation errors (you cannot commit a session that contains errors). If your session validation reports errors because you have disabled outbound message-level security, modify the AquaLogic Service Bus startup command so that it sets the following system property to true:
com.bea.wli.sb.security.wss.LaxOutboundWssValidation

Then restart AquaLogic Service Bus. With this property set to true, the AquaLogic Service Bus Console reports warnings instead of errors (you can commit a session that reports warning messages).

Future releases of AquaLogic Service Bus will provide an easier way to disable outbound message-level security.


  Back to Top       Previous  Next