Programming Security for Web Services

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

Web Services Interfaces

To develop Web Services clients, you use the Web Services Security Service Module (SSM) application programming interfaces (APIs) developed by BEA Systems.

These interfaces are described in the following sections:

 


Registry Service Interface

To map security service type and SSM configuration and SOAP endpoints, each Web Services SSM process has its own separate Registry Service. The address of the Registry Service should be known to the web services client from its configuration. This service maps the SSM Configuration ID and the service type to the Web Services SSM and SOAP endpoints for the security services. The Configuration ID is defined in the default.properties file for the SSM instance. The Registry Service makes it possible to distinguish between the supported service types (auditing, authentication, authorization, credential mapping, and role mapping). Registry Service operations on a particular machine are limited to the local machine (see Figure 5-1). The Web Services client learns about the Registry Service from its configuration file.

Figure 5-1 Registry Service Function

Registry Service Function

The following topics provide or more information on the Registry Service.

How the Registry Service Works

The Registry Service works as follows (Figure 5-2):

Figure 5-2 How the Registry Service Works

How the Registry Service Works

  1. If a web services client asks the Registry Service about the existence of a particular security service type, the Registry Service responds with a true or false answer.
  2. If a web services client asks for the URL of a valid security service type for the local host, the Registry Service returns the fully qualified URL of the endpoint for the requested service type that is provided by the SSM configuration. The Configuration ID is defined in the default.properties file.
  3. If a web services client asks the registry for a URL for a security service type that has an invalid security service type for Web Services SSM identified by the Configuration ID, the Registry Service returns a RegistryFailure SOAP Fault.
Note: The Registry Service does not provide lifecycle management functions for the Web Services.

For more information on the Registry Service interface and the methods it supports, see WSDLdocs for Web Services Interfaces.

Registry Service Methods

The Registry Service supports two methods: locateService() and doesServiceExist(). Both methods accept the requested service type of the Web Server SSM or Web Services SSM that provides the service. The supported service types are: ALES_AUDIT, ALES_AUTHENTICATION, ALES_AUTHORIZATION, ALES_CREDENTIAL, and ALES_ROLE. The type for all service types is string.

For the locateService() method, the Registry Service returns the fully qualified URL for the endpoint of the requested service. For the doesServiceExist() method, the service returns a Boolean value (true or false) that indicates whether the service exists and can be requested.

 


Methods Common to All Web Services Interfaces

The following methods are supported by all Web Services interfaces, except for the Registry Service interface.

 


Authentication Service Interface

The Authentication Service provides security functions to an application so as to establish, verify, and transfer a person or process identity. Thus, the Authentication Service provides two main security functions: authentication and identity assertion.

The Authentication Service accepts user credentials and/or identity assertion tokens and verifies that they match the user identity stored in the existing user profile. The following types of identity assertion tokens are supported:

The Extensible Markup Language (XML) structures used by the Authentication Service for transmitting identity assertion tokens and other credential types are defined the WSDL interface.

To ensure secure handling of credentials, all credentials presented to the Web Services Security Service Module must satisfy the following requirements:

The Web Services SSM only accepts clear-text passwords. However, the credentials presented are always be protected by SSL, either one-way or two-way. The Web Services SSM returns credentials to clients over SSL as well.

The SOAP authentication interface enables the Web Services SSM to return challenges to clients if they fail to provides the information necessary to complete the authentication process. In such cases, the client can respond with the requested information. In order to avoid expensive round trips, however, the web services client should pass in all available credentials information with the initial SOAP request.

The following topics provide more information on the Authentication Service interface:

Authentication Process

The authentication process is as follows (see Figure 5-3):

Figure 5-3 Authentication Service Process

Authentication Service Process

  1. The web services client connects to the Web Services SSM over HTTP and the Web Services SSM responds by presenting a digital certificate to prove its identity to the client. The Web Services SSM authenticates itself to the web services client using its server X.509 certificate. If the Web Services SSM presents a certificate that is not valid (for instance, the certificate has expired or has a subject name mismatch), the client should break the connection.
  2. The web services client verifies the SSMs digital certificate and submits a certificate signed by a recognized certificate authority (CA) to the Web Services SSM.
  3. The Web Services SSM verifies the clients certificate and establishes an SSL connection.
  4. The web services client submits credentials to Web Services SSM to login. Web services clients present user credentials with each login request. Use credential can be username/password, a SAML assertion, or an ALES cookie.
  5. The Authentication Service verifies the client credentials.
  6. If the credentials authenticate, the Authentication Service returns an identity assertion token to the web services client.
  7. If the credentials do not authenticate, the Authentication Service submits the credentials for checking. The Authentication Service does one of two things:
    • Validates the user credentials, grants the login, and returns a success message to the Web Services SSM.
    • Invalidates the user credentials, blocks the login, and returns a failure message to the Web Services SSM.
  8. If an authentication decision cannot be made with the parameters included in the initial client request, the request fails.
  9. If authentication is successful, the Web Services SSM returns the default identity assertion token representing the user. The type of the default identify assertion token is configurable. If the type is not specified, SAML assertions are used.
  10. If authentication fails, the Web Services SSM returns an AuthenticationFailure SOAP Fault to the caller.

For more information on the Authentication Service Interface and the methods it supports, see WSDLdocs for Web Services Interfaces.

Authentication Service Methods

To support authentication functions the authentication provides the following methods:

authenticate() Method

This method accepts any credential type supported by the authentication provider or a response to an earlier authentication challenge, and, optionally, the type of requested identity assertion that represents the identity and application context of the authenticated user. In response, it returns either the requested identity assertion token and status information or an authentication challenge.

Note: In addition to the identity assertion types, the Web Services SSM supports user credentials in form of usernames with passwords.

Table 5-1 describes the authenticate() method parameters.

Table 5-1 authenticate() Method Parameters 
Parameter
Description
Supported Values/Types
Input Parameters
Identity
Credential
Specifies the identity credential that is to be used to authenticate the caller.
ssm:IdentityCredential
Type
RquestCredential
Type
Specifies the identity credential type.
ssm:CredentialTypeType
AppContext
Specifies the application context in which authentication is being requested.
ssm:"ContextType"
Where ssm:ContextType can be one of the following: StringValue/string, BoolValue/boolean, DateTimeValue/dateTime, TimeValue/time, IntValue/integer IpValue/ssm:IpType
Return Parameters
IdentityAssertion
Returns the identity assertion token.
type="ssm:Identity
AssertionType"
Challenge
Returns an authentication challenge to the caller.
type="ssm:ChallengeType"
StatusInfo
Returns status information.
type="xsd:string"

assertIdentity() Method

This method accepts any supported identity assertion type or a response to an earlier authentication challenge, and, optionally, the type of requested identity assertion that represents the identity and application context of the authenticated user. In response, it returns either the requested identity assertion token and status information or an authentication challenge.

Table 5-2 describes the assertIdentity() method parameters.

Table 5-2 assertIdentity() Method Parameters 
Parameter
Description
Supported Values/Types
Input Parameters
IdentityAssertion
An identity assertion token that represents the authenticated identity of the user.
type="ssm:IdentityAssertion
Type"
Requested
CredentialType
Specifies the type of credential being submitted for authentication.
type="ssm:CredentialTypeType"
AppContext
Specifies the application context in which authentication is being requested.
ssm:ContextType
Where ssm:ContextType can be one of the following: StringValue/string, BoolValue/boolean, DateTimeValue/dateTime, TimeValue/time, IntValue/integer IpValue/ssm:IpType
Return Parameters
IdentityAssertion
Returns the identity assertion token.
An acceptable user's identity assertion token.
type="ssm:Identity
AssertionType"
Challenge
Returns an authentication challenge to the caller.
type="ssm:ChallengeType"
StatusInfo
Returns status information.
type="xsd:string"

isAssertionTokenSupported() Method

This method accepts an identity assertion credential type that represents the authenticated user's identity. It returns a Boolean value (true or false) to indicate whether this token type is supported by this instance of the Web Services SSM.

Table 5-3 describes the isAssertionTokenSupported() method parameters.

Table 5-3 isAssertionTokenSupported() Method Parameters
Parameter
Description
Supported Values/Types
Input Parameter
Assertion
CredentialType
Specifies the identity assertion credential type. The type specified can be any type supported by the ALES Credential Mapping provider. The Authentication Service may also return an authentication challenge to the caller requesting other assertion token types. If the caller fails to specify an assertion token type supported by the Authentication Service even after challenges, the Authentication Service returns CredentialMappingFailure to the caller.
AssertionCredentialType
type="ssm:CredentialTypeType"
Return Parameter
isAssertionToken
SupportedResponse
Specifies whether the assertion token is supported.
true/false
type="xsd:boolean"

validateIdentity() Method

This method accepts any supported identity assertion type that represents the identity of the authenticated user. It returns a structure with a Boolean value (true or false) that indicates whether the token is valid.

Table 5-4 describes the validateIdentity() method parameter.

Table 5-4 validateIdentity() Method Parameters
Parameter
Description
Supported Values/Types
Input Parameter
IdentityAssertion
An identity assertion token that represents the authenticated identity of the user.
IdentityAssertion
type="ssm:Identity
AssertionType"
Return Parameter
validateIdentity
Response
Specifies whether the identity is valid.
true/false
type="xsd:boolean"

 


Authorization Service Interface

The Authorization Service is a service that allows an application to determine if a specific identity is permitted to access a specific resource. This decision may then be enforced in the application directly at the policy enforcement point.

The Authorization Service is primarily based on a single method: isAccessAllowed(). This method accepts a supported type of user credential or an identity token, a runtime resource, and a runtime action. Optionally, this method can accept the type of the requested identity assertion token that represents the identity of the authenticated user, the application context, and direction parameters. The isAccessAllowed() method requires that a valid, authenticated identity or a null identity token (representing an anonymous identity) be present when requesting an access decision. The following topics provide more information on the Authorization Service.

Authorization Process

The authorization process is as follows (see Figure 5-4):

Figure 5-4 Authorization and Role Mapping Process

Authorization and Role Mapping Process

  1. The authorization process begins when the web services client calls the Web Services SSM to answer the question "Is this user allowed to perform this particular action on the specified resource?" Identity assertion token types supported include ALES cookies and signed SAML 1.1 assertions.
  2. If the token matches a credential in the cache, the SSM sets the user identity to the internal identity representation, which includes the user identity and the list of roles the user has been granted.
  3. If the token does not match any of the credentials in the cache, the SSM calls the Authorization Service and the Role Mapping Service to determine whether the user is authorized to access resources and to get the list of roles the user has been granted. If the user is authorized, the user identity is set to the internal identity representation, which includes the user identity and the list of roles the user has been granted.
  4. The Authorization Service then compares the user identity to the resource security policy to determine whether the user is in a role that has been granted the access privilege that is necessary to perform the requested action on the particular resource.
  5. If the authorization process fails due to parameter-related problems, an AuthorizationFailure SOAP Fault is returned to the caller.
  6. In the absence of an error, the authorization decision that is returned to the web services client contains a clear and unambiguous true or false statement that allows or disallows access to the resource in question. A negative authorization decision is a valid result and does not result in a SOAP Fault.

For more information about the Authorization Service interface, see the WSDLdocs for Web Services Interfaces.

Authorization Service Methods

The Authorization Service supports the following methods:

isAccessAllowed()

This method accepts a supported type of an identity assertion token and runtime resource and action structures. Optionally, it can accept the requested identity assertion credential type, application context, and authorization direction parameters. In response, this method returns the authorization decision and authorization data, or, if required by the authorization provider, additional context requests.

Table 5-5 describes the isAccessAllowed() method parameters.

Table 5-5 isAccessAllowed() Method Parameters 
Parameter
Description
Supported Values/Types
Input Parameters
IdentityAssertion
An identity assertion token that represents the authenticated identity of the user. The token type must be supported by the ALES Credential Mapping provider; otherwise, the service returns CredentialMappingFailure to the caller.
IdentityAssertion/ ssm:IdentityAssertionType
RuntimeResource
Specifies the runtime resource that the caller is requesting.
ResourceString, AuthorityName
type="ssm:Runtime
ResourceType"
RuntimeAction
Specifies the runtime action that the caller is requesting.
ActionString, AuthorityName
type="ssm:Runtime
ActionType"
Request
CredentialType
Specifies the identity assertion credential type. The type specified can be any type supported by the ALES Credential Mapping provider. The Authentication Service may also return an authentication challenge to the caller requesting other assertion token types. If the caller fails to specify an assertion token type supported by the Authentication Service even after challenges, the Authentication Service returns CredentialMappingFailure to the caller.
AssertionCredentialType/ ssm:CredentialTypeType
AppContext
Specifies the application context in which access to the resource is being requested.
ssm:"ContextRecordType"
Where ssm:ContextRecordType is one of the following: StringValue/string, BoolValue/boolean, DateTimeValue/dateTime, TimeValue/time, IntValue/integer IpValue/ssm:IpType
AtzDirection
Specifies authorization direction parameters.
ALES_ONCE, ALES_POST, ALES_PRIOR
type="ssm:AtzDirectionEnum"
Return Parameters
isAccessAllowed
Response
Indicates whether access is allowed.
true/false
type="xsd:boolean"
AtzDecisionData
Information about the access decision.
type="ssm:AtzDecisionDataType"
"ContextRequests"
Requests additional context if required by the ASI Authorization provider.
type="ssm:ContextRequestsType"

isAuthenticationRequired() Method

The Authorization Service interface also supports the isAuthenticationRequired() method. This method accepts a runtime resource and a runtime action. It returns a Boolean value (true or false) that indicates whether authentication is require to access this resource. The web services client uses this method to test whether privileges are required to access a particular resource.

Table 5-6 describes the isAuthenticationRequired() method parameters.

Table 5-6 isAuthenticationRequired() Method Parameters
Parameter
Description
Parameter Values/Types
Input Parameters
RuntimeResource
Specifies the runtime resource that the caller is requesting.
ResourceString, AuthorityName
type="ssm:Runtime
ResourceType"/
RuntimeAction
Specifies the runtime action that the caller is requesting.
ActionString, AuthorityName
type="ssm:Runtime
ActionType"
Return Parameter
isAuthentication
RequiredResponse
Indicates whether authentication is required.
true/false
type="xsd:boolean"

 


Authorization Via XACML

This version of AquaLogic Enterprise Security allows external applications to ask authorization questions using the XACML protocol. This capability is supported only in the Web Services SSM.

The XACML service is implemented as an extension to the existing Authorization Service in the Web Service SSM, and uses the same configuration and administration scripts of the Web Service SSM. The XACML service is silently installed together with the Web Service SSM. The XACML service is not viewable or configurable through the Administration Console.

Note: The XACML service supports XACML 2.0 only. It does not support a XACML 1.0 context. In addition, the SAML 2.0 profile for XACML 2.0 is not supported in this release.

Two-Way SSL Recommended

As described in Client Trust Model, the Web Services SSM supports both one-way and two-way SSL (see Figure 2-5). However, the connection between the PEP and the XACML service should be over two-way SSL.

XACML Service Use Case

This section describes a typical use case for the XACML service.

The following new terms are used in this section: PEP and PDP. The policy enforcement point (PEP) is the system entity that performs access control by making decision requests and enforcing authorization decisions. The policy decision point (PDP) is the system entity that evaluates applicable policy and renders an authorization decision. The XACML service implements a PDP: it provides a XACML-based Authorization service (inside the Web Service SSM) to your client PEP.

The basic use case for the XACML service is similar to the following:

  1. The PEP receives an access request from some user (subject).
  2. The PEP makes sure that the user is authenticated, either by authentication or some form of identity of assertion.
  3. The PEP constructs the XACML context request using the user's identity assertion, the action to be performed, the resource the user is requesting, and the environmental values if applicable.
  4. The PEP sends the request via SOAP to the XACML service (PDP).
  5. The XACML service converts the request to a format understood by the AquaLogic Enterprise Server and calls the Authorization Service's isAccessAllowed method to authorize the user.
  6. Depending on the authorization result, the XACML service constructs a XACML context response and returns it to the PEP with status, and obligations if any.
  7. The PEP takes actions according to the response.

Sample XACML Client Application is Provided

This version of AquaLogic Enterprise Security includes a simple XACML client (PEP) application that does authorization to the Web Service SSM using the XACML protocol. The example demonstrates the following concepts:

The example is located in BEA_HOME\ales25-ssm\webservice-ssm\examples\XACMLClient.

Overview of XACML Context

XACML is an OASIS standard language that specifies schemas for authorization policies and for authorization decision requests and responses. It also specifies how to evaluate policies against requests to compute a response. In this release, AquaLogic Enterprise Server implements the authorization process using XACML context. The XACML context is used to convey an authorization decision request and response.

The XACML standard ( http://docs.oasis-open.org/xacml/2.0/access_control-xacml-2.0-core-spec-os.pdf) specifies how the XACML context should be used for authorization, and the behaviors of PEPs and PDPs.

The XACML context is the protocol used by the PEP to ask the PDP for an authorization decision. It defines a <xacml-context:Request> element to convey the request and a <xacml-context:Response> for the response. The request contains four elements for authorization, including:

The PEP sends the authorization request to the PDP using a XACML context, which contains the subject, action, resource, and environment. The PEP is asking the PDP the following question: "Given such a subject, is it allowed to perform the specified action on the specified resource in the specified environment?".

The response contains:

The XACML service takes the XACML request, converts the request to a format understood by the AquaLogic Enterprise Server, and calls the Java API (specifically, the Authorization Service's isAccessAllowed method) to authorize the user.

When a decision has been made, the XACML service wraps the AquaLogic Enterprise Server returned values into the XACML response. The XACML service returns a SOAP fault if the PEP sends a malformed request that does not follow the XACML context schema. Otherwise, the XACML service will always return a decision of "Permit", "Deny", "Indeterminate" or "NotApplicable".

The PEP then interprets the result and enforces the decision. For the "Permit" decision, the PEP allows the request, and for the "Deny" decision, the PEP denies the request. For results of "Indeterminate" or "NotApplicable," it is up to the PEP to interpret them. For "Permit-biased" PEP, the access will be allowed; for "Deny-biased" PEP, access will be denied.

Authentication and Valid Token Types

The policy enforcement point (PEP) that sends the authorization request to the XACML service is responsible for authenticating the user and supplying a valid AquaLogic Enterprise Server token as the subject.

The following types of identity assertion tokens are supported:

The Extensible Markup Language (XML) structures used by the Authentication Service for transmitting identity assertion tokens and other credential types are defined the WSDL interface.

The XACML service accepts the token supplied by the PEP and tries to assert that token (assertion) in AquaLogic Enterprise Server.

SOAP Binding of XACML Context

As described in Overview of XACML Context, the request contains an <xacml-context:Request> and the response contains an <xacml-context:Response> element. These two elements are directly enclosed in the SOAP body.

One, and only one, request or response should be in the SOAP body.

There are currently two defined XACML namespaces. Policies are defined using the identifier urn:oasis:names:tc:xacml:2.0:policy:schema:os, and request and response contexts are defined using the identifier urn:oasis:names:tc:xacml:2.0:context:schema:os.

This implementation uses the following identifier to represent the XACML service:http://security.bea.com/ssmws/ssm-ws-1.0.wsdl.

Listing 5-1 shows a sample SOAP request.

Listing 5-1 Sample Soap Request
POST /XACMLAuthorization HTTP/1.0
Host: pdp-01
Connection: Keep-Alive
Content-Type: application/soap+xml; charset=utf-8
SOAPAction: ssmws:xacml:authorization
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <xacml-context:Request xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os">
      <xacml-context:Subject>...</xacml-context:Subject>
      <xacml-context:Resource>...</xacml-context:Resource>
      <xacml-context:Action>...</xacml-context:Action>
      <xacml-context:Environment>...</xacml-context:Environment>
    </xacml-context:Request>
  </soap:Body>
</soap:Envelope> 

If a malformed SOAP request is sent to the server (for example, a non-XML request or an XML request that does not follow the schema definition), a SOAP fault is returned to the client (PEP).

How the XACML Request Element is Interpreted in AquaLogic Enterprise Security

The request element defined by the XACML standard ( http://docs.oasis-open.org/xacml/2.0/access_control-xacml-2.0-core-spec-os.pdf) is as follows:

<xs:element name="Request" type="xacml-context:RequestType"/>
<xs:complexType name="RequestType">
    <xs:sequence>
        <xs:element ref="xacml-context:Subject" maxOccurs="unbounded"/>
        <xs:element ref="xacml-context:Resource" maxOccurs="unbounded"/>
        <xs:element ref="xacml-context:Action"/>
        <xs:element ref="xacml-context:Environment"/>
    </xs:sequence>
</xs:complexType>

As detailed in the standard, the <Request> element contains <Subject>, <Resource>, <Action> and <Environment> elements. There may be multiple <Subject> elements and, under some conditions, multiple <Resource> elements. Each child element contains a sequence of <xacml-context:Attribute> elements associated with the subject, resource, action, and environment, respectively.

The sections that follow describe how the <Subject>, <Resource>, <Action> and <Environment> elements are interpreted.

Attribute

XACML subject, resource, action, and environment elements usually contain XACML context attributes, <xacml-context:Attribute>.

The context attributes contain metadata (such as AttributeId, DataType), and one or more <AttributeValue> element. As described in the XACML standard ( http://docs.oasis-open.org/xacml/2.0/access_control-xacml-2.0-core-spec-os.pdf), the schema of Attribute is as follows:

<xs:element name="Attribute" type="xacml-context:AttributeType"/>
<xs:complexType name="AttributeType">
    <xs:sequence>
        <xs:element ref="xacml-context:AttributeValue" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="AttributeId" type="xs:anyURI" use="required"/>
    <xs:attribute name="DataType" type="xs:anyURI" use="required"/>
    <xs:attribute name="Issuer" type="xs:string" use="optional"/>
</xs:complexType>

Different attributes in different elements will have different AttributeId and DataType.

The <AttributeValue>, by definition, can carry anything. It contains any element under any namespace, as well as any attributes. Any valid XML data can be put in. However, it must be meaningful for its parent <Attribute>'s AttributeId and DataType.

There can be multiple <AttributeValue> elements in an <Attribute>; however, the XACML service allows only one of them. If there is more than one, an indeterminate result is returned and a processing-error status is reported.

An <Attribute> without an <AttributeValue> results in a SOAP fault because it does not follow the schema.

If there is an Issuer attribute in <Attribute>, it is currently ignored by the XACML service.

The DataType of the <Attribute> is usually ignored, because the content of the <AttributeValue> is regarded only as a string type.

Subject

The <Subject> consists of a sequence of <xacml-context:Attribute> elements associated with the subject.

<xs:element name="Subject" type="xacml-context:SubjectType"/>
<xs:complexType name="SubjectType">
    <xs:sequence>
        <xs:element ref="xacml-context:Attribute" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="SubjectCategory" type="xs:anyURI" 
default="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"/>
</xs:complexType>

The <Subject> element has an optional attribute, SubjectCategory. This represents the subject's role of this request. For example, `access-subject', `requesting-machine', `code-base'.

Inside a <Subject>, there could be an <Attribute> with AttributeId of "urn:oasis:names:tc:xacml:1.0:subject-category", and the <AttributeValue> of this <Attribute> also represents the subject category. This is equal to the "SubjectCategory" attribute of the <Subject>.

For example, the following two <Subject> elements are functionally equal:

<Subject>
        <Attribute AttributeId="urn:oasis:names:tc:xacml:2.0:subject-category" DataType="xs:anyURI">
<AttributeValue>urn:oasis:names:tc:xacml:1.0:subject-category:access-subject</AttributeValue>
        </Attribute>
    </Subject>
<Subject SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
    </Subject>

Multiple subjects

There can be multiple subjects in a <Request> element.

The XACML context specifies that these subjects should be "disjunctive," which is defined in the standard as a sequence of predicates combined using the logical `OR' operation.

For example, one subject may represents the human user who initiates the request, another may represent the code that is doing the request. They are specified by subject categories.

The rules of handling multiple subjects are as follows:

The subject id <Attribute>

The DataType attribute of the subject-id <Attribute> element indicates the subject type. The type is of "anyURI" type, but in order to be understood, the DataType should be prefixed with the

identifier that represents the XACML service: http://security.bea.com/ssmws/ssm-ws-1.0.wsdl.

In addition, a fragment should be suffixed after this URL indicating the subject type that could be asserted in AquaLogic Enterprise Security; that is, the first parameter of the assertIdentity() method in the Authentication service API.

For example, if the subject contains ALESIdentityAssertion, it should have the DataType http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#ALESIdentityAssertion, and the <AttributeValue> of this <Attribute> is taken as the subject.

However, if a valid <AttributeValue> is provided and correctly recognized by the Web Service SSM, the DataType may not be checked.

If the <Subject> (which is of `access-subject' category) does not contain an <Attribute> with "subject-id", this subject will be considered as an anonymous user. The service will construct an anonymous identity and pass it to the authorization service.

Also note that this implementation reuses the Web Service SSM's identity cache for better performance, as described in Optimizing Web Services Performance with Caches.

Mapping Other Subject and Attribute Elements to AquaLogic Enterprise Security Identity

For other <Subject> elements and <Attribute> elements that are not in the `access-subject' category, or are in the `access-subject' category but without a "subject-id" id, those <Attribute> elements are converted as authorization context (AppContext) of AquaLogic Enterprise Security.

If there are multiple <Attribute> elements with the same id, a later one will override the previous one.

Also, only text values in <AttributeValue> are acceptable; child XML elements are ignored.

The rule for converting an attribute to an AquaLogic Enterprise Security context key-value pair is as follows:

  1. If the AttributeId is a URN (for example, "urn:oasis:names:tc:xacml:1.0: subject:authn-locality:authentication-method"), the last field of the URN, that is, the string after the last colon, is taken as the context key, and the AttributeValue is the context value. For example, if the previous URN has an AttributeValue of "username/password", the resulting ALES context will be "authentication-method" : "username/password".
  2. If the AttributeId is a URL (for example, "http://security.bea.com/ssmws/ssm-ws-1.0.wsdl/schema#Cache-Control"), the fragment (the string after the `#' character) of the URL is taken as the context key. The example URL is converted as "Cache-Control".
  3. Note that this is a XACML extension: the XACML standard does not have this type of URL as AttributeId, but the PEP could use this method to pass some context to AquaLogic Enterprise Server system.

  4. If none of the above matches, the full URI is used as the context key. The value is always the AttributeValue in this Attribute.

Mapping Resources and the AquaLogic Enterprise Security Resource

At least one of the resource attributes should have the following AttributeId: urn:oasis:names:tc:xacml:2.0:resource:resource-id.

The AttributeValue of this resource attribute should be the resource that can be understood by AquaLogic Enterprise Security; that is, the resource under the binding point of the SSM. The example queries the user for the resource name, and suggests a value of "store/book."

The DataType of this attribute should always be the XML schema standard "string" type: http://www.w3.org/2001/XMLSchema#string.

Other attributes in <Resource>, except for the one associated with the naming authority, are converted as authorization context attributes for authorization evaluation in AquaLogic Enterprise Security, using the same rule as <Subject> attributes.

Mapping Actions and the AquaLogic Enterprise Security Action

At least one of the attributes in the <Action> element must have the following AttributeId: urn:oasis:names:tc:xacml:1.0:action:action-id.

The attribute value of this attribute is the action performed on the resource. For example: GET, POST. The example queries the user for the action name.

The DataType of this attribute should be the XML schema standard string http://www.w3.org/2001/XMLSchema#string.

Other attributes in <Action> are converted as context attributes for authorization evaluation in AquaLogic Enterprise Security, using the same rule as <Subject> attributes.

How the Environment Element is Interpreted in AquaLogic Enterprise Security

The XACML service converts environment attributes to AquaLogic Enterprise Security application context. The rule to convert environment elements to AquaLogic Enterprise Security contexts is the same as for the subject. All attributes in <Environment> elements are converted.

For example, a sample environment element is as follows:

<Environment>
        <Attribute AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#DOB" 
DataType="http://www.w3.org/2001/XMLSchema#dateTime">
            <AttributeValue>1979-03-29</AttributeValue>
        </Attribute>
    </Environment>

The fragment (the string after the `#' character) of the URL is taken as the context key and the AttributeValue is the context value, which results in an AquaLogic Enterprise Security context of DOB:1979-03-29.

Sample Request

Listing 5-2 shows a full sample of a XACML request, without the SOAP envelope.

Listing 5-2 XACML Request
<Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">
    <Subject>
        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType=" 
http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#ALESIdentityAssertion">
            <AttributeValue>
               <ALESIdentityAssertion xmlns="...">......</ALESIdentityAssertion>
            </AttributeValue>
        </Attribute>
    </Subject>
    <Resource>
        <Attribute AttributeId="urn:oasis:names:tc:xacml:2.0:resource:resource-id" 
DataType="http://www.w3.org/2001/XMLSchema#string">
            <AttributeValue>/cgi-bin/j_security_check</AttributeValue>
        </Attribute>
    </Resource>
    <Action>
        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" 
DataType="http://www.w3.org/2001/XMLSchema#string">
            <AttributeValue>POST</AttributeValue>
        </Attribute>
    </Action>
    <Environment/>
</Request>

How the AquaLogic Enterprise Security XACML Response is Generated

The <Response> element is the root element of a response. It contains one or more <Result> elements, which contain authorization decision results. The XACML service supports only one <Result> element.

The <Result> element is defined as follows:

<xs:element name="Result" type="xacml-context:ResultType"/>
<xs:complexType name="ResultType">
    <xs:sequence>
        <xs:element ref="xacml-context:Decision"/>
        <xs:element ref="xacml-context:Status" minOccurs="0"/>
        <xs:element ref="xacml:Obligations" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="ResourceId" type="xs:string" use="optional"/>
</xs:complexType>

The <Result> element has a ResourceId attribute that indicates the identifier of the request resource element. This implementation does not use this value.

Mapping Decision.

Decision is the evaluation result. It contains a string value of "Permit", "Deny", "Indeterminate", or "NotApplicable". "Permit" or "Deny" are typically returned. For example: <Decision>Permit</Decision>.

If some required attribute is required, "Indeterminate" is returned, with the "missing-attribute" status.

Mapping Status

The <Status> element is an optional element of <Result>. It contains the following elements:

Mapping Obligations

A XACML obligation is an operation specified in a policy or policy set that should be performed by the PEP in conjunction with the enforcement of an authorization decision.

This implementation places the AquaLogic Enterprise Server evaluation returned values, like roles or the report_as values, in an obligation. Obligations are used only when the authorization result is "Permit."

<xs:element name="Obligations" type="xacml:ObligationsType"/>
    <xs:complexType name="ObligationsType">
        <xs:sequence>
            <xs:element ref="xacml:Obligation" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
<xs:element name="Obligation" type="xacml:ObligationType"/>
    <xs:complexType name="ObligationType">
        <xs:sequence>
            <xs:element ref="xacml:AttributeAssignment" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="ObligationId" type="xs:anyURI" use="required"/>
        <xs:attribute name="FulfillOn" type="xacml:EffectType" use="required"/>
    </xs:complexType>
    <xs:element name="AttributeAssignment" type="xacml:AttributeAssignmentType"/>
    <xs:complexType name="AttributeAssignmentType" mixed="true">
        <xs:complexContent mixed="true">
            <xs:extension base="xacml:AttributeValueType">
                <xs:attribute name="AttributeId" type="xs:anyURI" use="required"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

Obligations consist of one or more <Obligation> elements. An <Obligation> has the following attributes:

The <Obligation> element has zero or more <AttributeAssignment> elements. <AttributeAssignment> has an AttributeId and text content. The AttributeId is the returned attribute key, prefixed with the namespace http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#, and the content is the attribute value.

For example, the response attribute "currency" : "USD" is returned as:

<AttributeAssignment        AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#currency"        
DataType="http://www.w3.org/2001/XMLSchema#string">USD
</AttributeAssignment>

A role looks as follows:

<AttributeAssignment AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#role"      
DataType="http://www.w3.org/2001/XMLSchema#string">Admin
</AttributeAssignment>

Sample Response

Listing 5-3 shows a complete sample response, without the SOAP envelope.

Listing 5-3 XACML Response
<?xml version="1.0" encoding="UTF-8"?>
<Response xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">
   <Result> 
      <Decision>Deny</Decision>
      <Status>
          <StatusCode Value="urn:oasis:names:tc:1.0:status:processing-error"/>
          <StatusMessage>Authentication required</StatusMessage>
      </Status>
      <Obligations>
        <Obligation FulfillOn="Permit" ObligationId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#Roles">
           <AttributeAssignment DataType="http://www.w3.org/2001/XMLSchema#string"
                 AttributeId="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl#role">
              Admin
           </AttributeAssignment>
          </Obligation>
      </Obligations>
   </Result>
</Response>

WSDL Definition of the XACML Service

Listing 5-4 shows the WSDL definition of the XACML Service.

Listing 5-4 The WSDL File for the XACML Service
<?xml version="1.0" encoding="UTF-8"?>
<definitions
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os"
    xmlns:ssm="http://security.bea.com/ssmws/ssm-soap-types-1.0.xsd"
    xmlns:tns="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl"
    targetNamespace="http://security.bea.com/ssmws/ssm-ws-1.0.wsdl">
<types>
    <!-- note this policy schema is not a full one. it is stripped for the XACML runtime only -->
    <xs:import namespace="urn:oasis:names:tc:xacml:2.0:policy:schema:os" schemaLocation="access_control-xacml-2.0-policy-schema-os.xsd"/>
    <xs:import namespace="urn:oasis:names:tc:xacml:2.0:context:schema:os" schemaLocation="access_control-xacml-2.0-context-schema-os.xsd"/>
    <!-- for fault types -->
    <xs:import namespace="http://security.bea.com/ssmws/ssm-soap-types-1.0.xsd" schemaLocation="ssm-soap-types.xsd"/>
  </types>
<message name="XACMLAtzDecisionRequest">
    <part name="param" element="xacml-context:Request"/>
  </message>
  <message name="XACMLAtzDecisionResponse">
    <part name="param" element="xacml-context:Response"/>
  </message>
  <message name="XACMLFault">
    <part name="fault" element="ssm:xacmlFailure"/>
  </message>
  <message name="serviceFault">
    <part name="fault" element="ssm:serviceFailure"/>
  </message>
<portType name="XACMLPort">
    <operation name="authorize">
      <input message="tns:XACMLAtzDecisionRequest"/>
      <output message="tns:XACMLAtzDecisionResponse"/>
      <fault name="serviceFault" message="tns:serviceFault" />
      <fault name="xacmlFault" message="tns:XACMLFault"/>
    </operation>
  </portType>
<binding name="XACMLBinding" type="tns:XACMLPort">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <!-- Axis has problem support this wrapped style, use document instead. -->
    <operation name="authorize">
      <soap:operation soapAction="ssmws:xacml:authorization" style="document"/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
      <fault name="serviceFault">
        <soap:fault use="literal"/>
      </fault>
      <fault name="xacmlFault">
        <soap:fault use="literal"/>
      </fault>
    </operation>
  </binding>
<service name="XACMLService">
    <port name="XACMLAuthorization" binding="tns:XACMLBinding">
      <soap:address location="http://localhost/XACMLAuthorization"/>
    </port>
  </service>
</definitions>

 


Auditing Service Interface

The Auditing Service logs events based on activity related to enterprise security. The Web Services Security Service Module (SSM) runtime uses the Auditing Service to log appropriate data when events occur. The Auditing Service is based on an event model. When something of note occurs, an auditing event is automatically logged. A user or a application that wants notification when a particular event occurs can derive a new class from the AuditRecord class.

The following topics provide more information on the Auditing Service.

Auditing Process

The auditing process is as follows (see Fig):

Figure 5-5 Auditing Process

Auditing Process

  1. During the auditing process, the Web Services SSM audit logging function supports automated, centralized logging of audit messages. To capture a particular event for notification purposes an auditing user can use the recordEvent() method to specify the name of the audit record to be captured, and, optionally, the identity assertion token of the auditing user, and the application context.
  2. If the auditing provider requires application context that is not included in the recordEvent() method, the Auditing Service returns requests for additional application context.
  3. If parameter-related audit logging failures occur, including passing in an invalid identity assertion token for the user, an AuditingFailure SOAP Fault is returned to the caller.
  4. If no errors occur during the auditing process, an empty response is returned to the auditing user as an event notification and the audit event is logged by the auditing provider.

For more information on the Auditing Service interface and the methods it supports, see WSDLdocs for Web Services Interfaces.

Auditing Service Method

The Auditing Service passes the audit event to the Web Services SSM runtime. Based on its configuration, the SSM runtime routes the event to the proper auditing providers so that it can be recorded.

The Auditing Service supports a single method, recordEvent(). This method accepts an audit record, and, optionally, an identity assertion token, representing the auditing user, and an application context.

Table 5-7 describes the recordEvent() method parameters.

Table 5-7 recordEvent() Method Parameters
Parameter
Description
Supported Values/Types
Input Parameters
AuditRecord
Specifies the type of the audit record that encapsulates the logging information.
type="ssm:AuditRecord
Type"
IdentityAssertion
An identity assertion token that represents the authenticated identity of the auditing user.
type="ssm:Identity
AssertionType"
AppContext
Specifies the application context in which request for an auditing record is being made.
ssm:ContextType
Where ssm:ContextType can be one of the following: StringValue/string, BoolValue/boolean, DateTimeValue/dateTime, TimeValue/time, IntValue/integer IpValue/ssm:IpType

 


Role Mapping Service Interface

The Role Mapping Service allows an application to extract role information about specific identities and resources within the context of the application. These roles can then be used for customizing an interface or for other purposes.

Note: Do not use roles by themselves for authorization, because many policies, allowing or disallowing access to a resource, may be written against a role. Use the Authorization Service to determine actual access rights.

The Role Mapping Service evaluates an interaction of an identity with a resource within an application context and returns a list of role names associated with the configuration of that identity. These roles can change with every resource or be static for the identity across all resources. The roles assigned to an identity are determined by the security policy.

The Web Services SSM is capable of retrieving the roles that a user may have for the given resource and action combination. The user identity is passed as an identity assertion token, instead of a Java object. To obtain roles, authenticated users must be authorized to obtain their roles for the given resource/action combination.

The Role Mapping Service requires that the application pass in a valid identity, a valid resource, and a valid action. The application context is optional and may be set to null if no context is passed in.

The following topics provide more information on the Role Mapping Service.

Role Mapping Process

The role mapping process is as follows (see Figure 5-4):

  1. During the role mapping process, the Web Services SSM provides a mechanism for optionally specifying the application context to support role mapping.
  2. If parameter-related role mapping failures occur, including passing in an invalid identity assertion token for the user, a RoleMappingFailure SOAP Fault is returned to the caller.
  3. If no errors occur during the role mapping process, a list of zero or more roles, configured in the policy for the provided user/resource/action combination, is returned to the caller. An empty list is a valid response and does not result in a SOAP Fault.

For more information on the Role Mapping Service interface and the methods it supports, see WSDLdocs for the Web Services Interfaces.

Role Mapping Service Method

The Role Mapping Service interface supports one method, getRoles(). This method gets the roles for an authenticated user identity in reference to a RuntimeResource, RuntimeAction, and an optional Context.

The getRoles() method accepts a supported type of an identity token, and, optionally, runtime resource and action structures, and an application context. It returns either a list of user roles associated for the identity and a time-to-live parameter for user roles.

Table 5-8 describes the getRoles() method parameters.

Table 5-8 getRoles Method Parameters 
Parameter
Description
Supported Values/Types
Input Parameters
IdentityAssertion
An identity assertion token that represents the authenticated identity of the user. The token type must be supported by the Role Mapping provider; otherwise, the service returns RoleMappingFailure to the caller.
IdentityAssertion
type="ssm:IdentityAssertion
Type"
RuntimeResource resource
Specifies the runtime resource that the caller is requesting.
ResourceString, AuthorityName
type="ssm:RuntimeResource
Type"
RuntimeAction action
Specifies the runtime action that the caller is requesting.
ActionString,
AuthorityName
type="ssm:Runtime
ActionType"
AppContext
Specifies the application context in which access to the resource is being requested.
type="ssm:ContextType"
Where ssm:ContextType can be one of the following: StringValue/string, BoolValue/boolean, DateTimeValue/dateTime, TimeValue/time, IntValue/integer IpValue/ssm:IpType
Return Parameters
Roles
Specifies a list roles granted to the user.
type="ssm:IdentityRoleType"
RolesTtlAdvice
Specifies time to live for user roles.
type="xsd:positiveInteger

 


Credential Mapping Service Interface

The Credential Mapping Service allows an client application to fetch credentials of certain types that are associated with a specific identity for a specific resource. These credentials can then be used on behalf of that identity to execute some privileged function, such as logging into a database or sending e-mail.

The following topics provide more information on the Credential Mapping Service.

Credential Mapping Process

The credential mapping process is as follows (see Figure 5-6):

Figure 5-6 Credential Mapping Process

Credential Mapping Process

  1. The client presents a get credentials request to the Web Services SSM. The request includes a supported type of an identity assertion token and a list of requested credential types. Optionally, the request can include a runtime resource, runtime action, and an application context.
  2. In response, the Web Services SSM returns a list of requested user credentials and identity assertion tokens or, if required by the Credential Mapping provider, additional context requests.
  3. The Web Services SSM returns the following types of credentials in response to the client's request:
    • Username/password pairs
    • Signed SAML 1.1 assertions
    • ALES cookies
  4. If parameter-related credential mapping failures occur, the Web Service returns a CredentialMappingFailure SOAP Fault to the caller.
  5. If no errors occur during the credential mapping process, the Web Services SSM returns a list of zero or more credentials that are configured in the security policy for the specified user/resource/action combination. An empty list is a valid response and does not result in a SOAP Fault. Also, if some of the requested credential types are not available for specified user/resource/action combination, a SOAP Fault does not result.

For more information on the Credential Mapping Service interface and the methods it supports, see WSDLdocs for Web Services Interfaces.

Credential Mapping Method

The Credential Mapping Service supports one method: getCredentials(). This method accepts a supported type of an identity assertion token and a list of requested credential types. Optionally, this method can accept an identity assertion token that represents the identity of a different user and a runtime resource structure, which includes the requested resource and action and the application context. In response, the getCredentials() method returns either a list of requested user credentials, identity assertion tokens, and a list of any missing credential types.

Note: Since password credentials need to be returned in clear text to the caller in order to be usable for authentication in external systems, you should pay particular attention to providing channel and message security to protect messages in transit between clients and the Web Service. At a minimum, you must use a channel security protocol, such as SSL or TLS, for all communication.

Authenticated users are always authorized to obtain their own credentials for the given resource/action combination. However, authenticated user cannot requests credentials on behalf of another user.

Credential mapping process involves issuing new types of credentials to the specified combination of user, resource, and action. The user identity is passed as an identity assertion token, instead of a Java object.

Table 5-9 describes the getCredentials() method parameters.

Table 5-9 getCredentials Method Parameters 
Parameter
Description
Supported Values/Types
Input Parameters
IdentityAssertion
An identity assertion token that represents the authenticated identity of the user. The type used must be supported by the ALES Credential Mapping provider; otherwise, the service returns CredentialMappingFailure to the caller.
IdentityAssertion
ssm:"IdentityAssertion
Type"
Requested
CredentialTypes
Specifies a list of the types of credentials being requested. The Web Services SSM supports the following types of credentials:
  • Username/password pairs
  • Signed SAML 1.1 assertions
  • ALES proprietary cookie
type="ssm:CredentialTypes
Type"
Any non-empty string consisting of any number of alphanumeric characters and these separators: period ("."), comma (","), and underscore ("_").
RuntimeResource
Specifies the runtime resource that the caller is requesting.
ResourceString, AuthorityName
type="ssm:RuntimeResource
Type"
RuntimeAction
Specifies the runtime action that the caller is requesting.
ActionString, AuthorityName
type="ssm:Runtime
ActionType"
AppContext
Specifies the application context in which access to the resource is being requested. Specified as a name/value pair.
ssm:"ContextType"
Where ssm:ContextType can be one of the following: StringValue/string, BoolValue/boolean, DateTimeValue/dateTime, TimeValue/time, IntValue/integer IpValue/ssm:IpType
Return Parameters
MissingTypes
List of missing credential types.
type="xsd:string"
Identity
Credential
List of user credentials.
type="ssm:IdentityCredentialType"
IdentityAssertion
Identity assertion tokens that represent the authenticated identity of the user.
IdentityAssertion
type="ssm:IdentityAssertionType"


  Back to Top       Previous  Next