Core Security Patterns: Best Practices and Strategies for J2EE, Web Services, and Identity Management

There are a number of initiatives in the industry related to access control and policy management, such as IETF, DMTF, and OASIS. Each of them produces specifications for policy and has corresponding industry support groups. Sometimes architects and developers are confused about whether they are related or whether they are competing. For example, a telecommunication service provider wants to build a generic policy engine for determining the security policy for service-on-demand home network services and network infrastructure services. IETF (http://www.ietf.org/html.charters/policy-charter.html) and DMTF (http://www.wbemsolutions.com/tutorials/CIM/dmtf-policies.html) have produced policy specifications. The Parlay Group (http://www.parlay.org/about/policy_management/index.asp) has also issued a framework specification on policy management, which is targeted for implementing security services and access-control policies in the telecommunications sector. Which policy management specification should the telecommunication service provider choose? This section summarizes each policy management specification and discusses how they are related.

It is important for security architects and developers to understand that although these standards and industry groups share the same term "policy," they use the term to denote different meanings. The term "policy" may refer to specific data formats, protocols, operational semantics, and logical architectural framework components. For example, many policy frameworks (such as IETF policy framework) specify operational components such as Policy Enforcement Point (PEP), Policy Decision Point (PDP), Policy Issuing Point (PIP), and Attribute Authorities. These policy operational components are not necessarily restricted to security access control; they can be applicable to general business services as well. There are also specific data flows between these architectural components. These architectural components are practically logical and agnostic to specific physical infrastructure.

There are two XML standards related to policy and access control: SAML and XACML. SAML provides specific data formats (also known as "assertions") and protocols (XML-based, and not network protocol) for communicating between architectural components using those data formats (for example, Attribute Query and Response, Authorization Decision Query and Response, and so forth). SAML describes a very basic (or primitive) assertion format and protocol for communicating between a PEP and a PDP, but does not specify the operation of a PDP (that is, how it reaches its decision). It also does not specify how a PDP gets the information on which its decision will depend (that is, the policies).

XACML (eXtensible Access Control Markup Language) provides specific data formats (for example, Request and Response Context, PolicySet or Policy, and so forth) and specifies how the PDP component must operate in order to process an authorization decision request from a PEP. XACML 2.0 defines a SAML profile to extend SAML for interoperation with SAML. Refer to the previous section on "Use of XACML 2.0 with SAML 2.0" for details.

IETF Policy Management Working Group

The IETF Policy Management Working Group defines a structure (also called architecture) to manage policies by a policy management service (for example, a graphical user interface administration console), a dedicated policy repository (for example, directory server), a policy decision point (for example, policy server), a policy enforcement point (for example, firewall, routers), and local policy decision points (aka scaled-down policy decision points). The IETF policy framework is widely referenced in network infrastructure products, such as Cisco Quality of Service Policy Manager and SOCKS v5 with IPSec. Another example is Common Open Policy Service (COPS), which is a network client-server protocol between policy decision points and policy enforcement points in the telecommunications sector. In summary, the IETF policy framework provides a good architecture framework, but it does not define any specific communication protocol or software component.

The IETF policy framework introduces key operational elements (for example, PDP) in the policy management area. There are two security patterns, Load Balancing PEP and Clustered PEP, that apply the principle of these operational elements to implement network perimeter security. Refer to Chapter 8, "The Alchemy of Security Design: Methodology, Patterns, and Reality Checks," for details. However, the IETF policy framework is too generic and does not provide details of the data formats or the underlying protocols that are necessary to support end-to-end security for distributed applications and business services, particularly for J2EE-based applications and Web services.

Distributed Management Task Force (DMTF)

DMTF collaborates with IETF to work on a policy architecture that includes more application infrastructure protocols (such as LDAP, FTP, and SOAP) and refines a declarative data model with details of a policyRule, policyGroup, policyAction, and policyCondition defined in a Common Information Model (CIM). IPSec policy is a direct result of the collaboration. DMTF also defines a set of CIM policy data models (CIM Policy version 2.6 and version 2.7) that are also available in XML Schema. There is wide support of Web-based Enterprise Management (WEBM) and CIM in the computer hardware component and system management areas.

DMTF has published a CIM data model for policy. With the XML Schema, the CIM data models can be used for Web-based application development. However, the CIM data model is fairly generic for policy definition. It does not provide a specific communication protocol or interaction mechanism that business applications (not systems management applications) can use.

Parlay Group

The Parlay Group has defined a framework for policy management related to secure access using a Parlay gateway. It has API definitions that can define new rules (createRule), define conditions (createCondition), retrieve actions (getAction) and action lists (setActionList), and commit transactions (commitTransactions). For example, architects and developers can create a set of policies that allow newly created users to access broadband Internet services upon successful provisioning of their service accounts. Unfortunately, there is no mature commercial implementation of the Parlay policy product available. In addition, the Parlay policy management API specification is very telecommunication-domainspecific, and it does not currently provide any integration mechanisms for use with other security specifications such as SAML.

Strictly speaking, the Parlay policy management API specification is not yet another policy framework, as is IETF and DMTF. It intends to provide APIs that can work on top of policy standards and frameworks. It does not create specific data formats or protocols. Nor does it create a policy language. Thus, it should not be confused with other policy standards that have their own architecture models.

Enterprise Privacy Authorization Language (EPAL)

EPAL is another policy markup language specification drafted by IBM (http://www.w3.org/Submission/2003/SUBM-EPAL-20031110/). It is designed to address data privacy, privacy audit, and enforcement requirements. EPAL allows privacy-rule administrators to define ruling, user category, action, data category, purpose, condition, and obligation. EPAL has some elements specific to data privacy but they are not necessarily relevant to access control. For example, the element <data-category> is an element that describes the type of resources (as in "resource" in XACML). The element <purpose> may be relevant to access control, but not always. EPAL requires a <purpose> element to describe both data privacy and access control, however, which makes it problematic for use as a general purpose access control language. The concept and usage of the elements <rule> and <condition> are similar to XACML. However, EPAL does not support sub-policies or the concept of combining algorithms (that is, combining multiple rule or policy results into a single overall response), which are often used in complex access-control environments. Instead, it can support a sequence of rules.

EPAL 1.1 reuses the <xacml:condition> element of the XACML condition language. In EPAL 1.2, IBM dropped any reference to XACML and submitted the draft specifications to W3C (http://www.w3.org/Submission/2003/SUBM-EPAL-20031110/). Currently, EPAL is in draft status and is not an approved standard or in pre-standard status yet.

For a detailed analysis on comparing EPAL and XACML refer to [Anne1]. Table 7-1 summarizes the comparison of EPAL and XACML from a Sun white paper (refer to [Anne1] for details and http://research.sun.com/projects/xacml for an updated comparison).

Table 7-1. High-Level Comparison of EPAL and XACML

Features

EPAL

XACML

Remarks

Decision request

X

X

EPAL is a functional subset of XACML.

Nested policies

Not Supported

X

 

Policy references

Not Supported

X

 

Rule

X

X

Functional equivalent.

Combining algorithm and precedence

X

X

EPAL is a functional subset of XACML.

Vocabulary

X

Not Supported

 

Attribute values

X

X

Identical.

Attribute mapping

X

X

Functional equivalent.

Attribute retrieval

X

X

Identical.

XML attribute values

Not Supported

X

 

Hierarchical entities

X

X

EPAL and XACML support different models for hierarchical entities.

Subjects with multiple attributes

X

X

EPAL is a functional subset of XACML.

Multiple subjects

Not Supported

X

 

Purpose attribute

X

X

EPAL is a functional subset of XACML.

Error handling

X

X

EPAL is a functional subset of XACML.

Targets or pre-conditions

X

X

EPAL is a functional subset of XACML.

Condition

X

X

Functional equivalent.

Revision number

X

X

Functional equivalent.

Data types

X

X

EPAL is a functional subset of XACML.

Functions

X

X

EPAL is a functional subset of XACML.

Obligations

X

X

EPAL is a functional subset of XACML.

Multiple responses

Not Supported

X

 

Status as a standard

Proposal to W3C

OASIS standard

 

EPAL introduces the concept of a policy vocabulary that is not available in XACML. Refer to the next section for the discussion of XACML. The element <vocabulary> points to a separate file that specifies the collection of attributes needed in order to evaluate the policy. Attributes in a vocabulary are grouped into containers. Each separate container specifies a collection of attributes that can be obtained together from a single source. It may also represent a subset of attributes that would be used by a given rule in a policy. However, there is a drawback when designing complex policies: The need to group attributes into containers in a vocabulary may actually add to complexity by requiring vocabulary managers to be aware of the structure of the rules in the policy.

In contrast, XACML provides a richer set of access-control and privacy features that are not available in EPAL version 1.2. This includes the following features:

  • Combination of the results of multiple policies that are developed by potentially independent policy issuers

  • The ability to reference other policies as part of a given policy

  • The ability to specify conditions on multiple subjects that may be involved in making a request

  • The ability to return multiple results when access to a hierarchical resource is being requested

  • Support for subjects who must simultaneously be in multiple independent hierarchical roles or groups

  • Clear handling of error conditions and missing attributes

  • Support for attribute values that are XML schema elements

  • Support for additional primitive data types (including X.500 Distinguished Names and RFC822 names)

Web Services PolicyWS-Policy and WSPL

Web services policies are necessary in order to specify the conditions or assertions regarding the interactions between two Web services endpoints, such as authentication, authorization, quality of protection, quality of service, privacy, reliable messaging, and service-specific options (such as bandwidth guarantee). There are two emerging policy-related specifications: WS-Policy and WSPL (Web services policy language).

Web Services Policy Framework (WS-Policy) is part of the Web Services roadmap and specifications (aka WS*) proposed by Microsoft, IBM, VeriSign, and others. It is primarily a policy language that defines policies for Web services; these policies are a collection of "policy alternatives" (a collection of policy assertions such as authentication scheme, privacy policy, and so forth). WS-Policy encodes the policy definition in XML using SOAP messages for data exchange.

The policy definitions in the WS-Policy specification are not restricted to access control or privacy, a fact that differentiates WS-Policy from XACML and EPAL. Security architects and developers can use WS-Policy to specify the type of security token, digital signature algorithm, and encryption mechanism for a SOAP message (for example, a payment message), or even partial contents of a SOAP message (for example, credit card number). It can also specify data-privacy or data-confidentiality rules. However, WS-Policy does not specify how to discover policies or how to attach a policy to a Web service. It relies on other WS* specifications (for example, WS-PolicyAttachment) to provide full functionality of policy management.

The other necessary component of WS-Policy is the definition of a set of policy assertions for each policy domain. For example, the assertions for use with WS-Security are defined in WS-SecurityPolicy. Each specification or schema to be controlled or managed by WS-Policy will require definition of a new set of assertions. The authors suggest that in the future, assertions will be defined as part of the underlying specification or schema rather than in a separate document as was required for WS-SecurityPolicy.

Under the WS-Policy model, a policy for Web services denotes conditions or assertions regarding the interactions between two Web services endpoints. The service provider exposes a Web services policy for the services they provide. The service requester will decide, using the policies, whether they want to use the service, and if so, the "policy alternative" they wish to use. In other words, WS-Policy does not have the notion of a Policy Enforcement Point (which enforces policies) and a Policy Decision Point (which determines policies). It leaves the policy enforcement and decision to the service providers and service requesters.

WSPL (Web Services Policy Language) is based on XACML (refer to the next section for details) and is currently a working draft in the OASIS XACML technical committee. It uses a strict subset of XACML syntax (restricted to Disjunctive Normal Form) and has a different evaluation engine than XACML has. XACML evaluates the access-control policies with a given set of attributes and policies, while WSPL determines what the mutually acceptable sets of attributes are when given two policies. For a good introduction on WSPL refer to [Anne3].

WSPL has provided similar functionality to define policies for Web services. WSPL has the semantics of policy (set of rules) and operators (which allow comparison between an attribute of the policy and a value, or between two attributes of the policy). The policy syntax also supports rule preference. There are three distinctive features in WSPL. First, it allows policy negotiation, which can merge policies from two sources. Second, policy parameter allows fine-grained parameters such as time of day, cost, or network subnet address to be defined in a policy for Web services. Third, the design of WSPL is flexible enough to support any type of policy by expressing the policy parameters using standard data types and functions.

One main problem WSPL has addressed is the negotiation of policies for Web services. Negotiation is necessary when choices exist, or when both parties (Web services consumers and service providers) have preferences, capabilities, or requirements. In addition, it is necessary to automate service discovery and connection related to policies.

WSPL shares similar policy definition capabilities with WS-Policy. Example 7-11 shows a policy defined in WS-Policy, which specifies the security token usage and type for the Web services. It uses the element <ExactlyOne> to denote the security token usage.

Example 7-11. Policy for a security token usage and type defined in WS-Policy

<wsp:Policy> <wsp:ExactlyOne> <wsse:SecurityToken> <wsse:TokenType>wsse:Kerberosv5TGT </wsse:TokenType> <wsse:/SecurityToken> <wsse:SecurityToken> <wsse:TokenType>X509v3 </wsse:TokenType> <wsse:/SecurityToken> </wsp:ExactlyOne> </wsp:Policy>

Example 7-12 shows that the same policy can be expressed in WSPL. WSPL translates the policy requirements into two rules. This makes it more descriptive and extensible in the event that security architects and developers need to add more operators or constraints.

Example 7-12. Policy for security token usage and type using WSPL

<Policy Policy RuleCombiningAlgorithm="&permit-overrides;"> <Rule Rule Effect="Permit"> Condition Function> <AttributeValue DataType="&string;">Kerberosv5TGT</AttributeValue> <ResourceAttributeDesignator Attribute DataType="&string;"/> </Condition> </Rule> <Rule Rule Effect="Permit"> <Condition Function> <AttributeValue DataType="&string;">X509v3</AttributeValue> <ResourceAttributeDesignator Attribute DataType="&string;"/> </Condition> </Rule> </Policy>

The following are identified as technical limitations of WS-Policy when compared with WSPL (refer to [Anne2] for details):

  • Negotiation. WS-Policy does not specify a standard merge algorithm or a standard way to specify policy negotiation (for example, for merging policies from two sources). Specifications for domain-specific WS-Policy Assertions may describe how to merge or negotiate assertions, but these methods are domain-specific.

  • Assertion Comparison. Since there is no standard language for defining Assertions in WS-Policy, there is no standard way to describe requirements such as "fee > 25." Again, specifications for domain-specific WS-Policy Assertions may describe schema elements for such comparisons, but the implementation of these elements must be done on a domain-by-domain basis since there is no standard.

  • Dependency. WS-Policy is designed to depend on extensions. Each extension must be supported by a custom evaluation engine.

Web services policy specifications are still evolving. Some of them have specific problems (for example, policy negotiation) to address. It is possible that these specifications may expand and converge into one single standard in the future. For security architects and developers, it is useful to understand the policy language design, architectural components, and differences behind these specifications and to determine whether these policy specifications meet their technical requirements before they adopt them for prototypes and implementations.

Категории