Skip navigation.

Securing WebLogic Resources

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents Index View as PDF   Get Adobe Reader

Understanding WebLogic Resource Security

This chapter introduces terms and concepts, provides a workflow summary, and outlines the main steps for securing WebLogic resources:

 


Overview of Securing WebLogic Resources

A WebLogic resource is an object that the WebLogic Security Service creates to represent an underlying WebLogic Server entity and to determine who can access the entity. You create a security policy to specify which users, groups, or roles can access a resource under a set of conditions. A security role, like a security group, grants an identity to a user. Unlike a group, however, membership in a role can be based on a set of conditions that are evaluated at runtime.

For example, when you deploy a Web Service, the WebLogic Security Service creates a weblogic.security.service.WebServiceResource object. When a client attempts to interact with your Web Service, the application container forwards the request to the WebLogic Security Service. The Security Service refers to the security policy that you defined for the Web Service's WebServiceResource. Then it either grants the client permission to proceed or rejects the request. See Figure 2-1.

Figure 2-1 A Resource Determines Who Can Access an Entity

A Resource Determines Who Can Access an Entity


 

Figure 2-2 describes how you create roles and policies and how the Security Service uses them to determine whether a client can access a resource. A brief explanation follows the figure.

Figure 2-2 How a Policy Grants Access to a Resource

How a Policy Grants Access to a Resource


 
  1. Before creating security policies and roles, Administrators statically assign users to groups, which can represent organizational boundaries. The same user can be a member of multiple groups. Figure 2-2 shows three groups with two users each. User 1 and User 3 are members of multiple groups.
  2. BEA recommends assigning users to groups because doing so increases efficiency for administrators who work with many users.

  3. Administrators create a security role based on their organization's established business procedures. The security role consists of one or more conditions, which specify the circumstances under which a particular user, group, or other role should be granted the security role.
  4. At runtime, the Security Service compares the groups against the role condition(s) to determine whether users in the group should be dynamically granted a security role. This process of comparing groups to roles is called role mapping. In Figure 2-2, Group 2 is the only group that is granted a security role.
  5. Individual users can also be granted a security role, but this is a less typical practice.

  6. Administrators create a security policy based on their organization's established business procedures. The security policy consists of one or more policy statements, each of which includes a policy condition. The policy condition specifies the circumstances under which a particular security role should be granted access to a protected WebLogic resource.
  7. At runtime, the WebLogic Security Service uses the security policy and the WebLogic resource itself to determine whether access to the protected WebLogic resource should be granted. Only users who are members of the group that is granted the security role can access the WebLogic resource. In Figure 2-2, User 3 and User 6 can access the protected WebLogic resource because they are members of Group 2, and Group 2 is granted the necessary security role.

 


Designing Roles and Policies for WebLogic Resources: Main Steps

To design a set of roles and policies that can secure the resources in your domain:

  1. List all of the resources that will be in your domain and determine which ones should be accessed only by specific users or groups.
  2. To see a list of all the types of resources that could be in any given domain, see Types of WebLogic Resources.

    For planning purposes, organize the resources into the following categories:

  3. For each type of resource that you want to secure, determine if you need to create root-level policies, scoped policies, or a combination of both.
  4. A root-level policy applies to all instances of a resource type. For example, if you define a root-level policy for the Web Services resource type, then the policy will apply to all Web Services in your domain.

    A scoped policy applies to a specific resource instance and overrides a root-level policy. If the resource contains child resources, then the scoped policy applies to all children as well. For example, if you create a scoped policy for a Web Service named WebService1, then the policy applies only to WebService1 and all operations of WebService1. If you have also defined a root-level policy for the Web Services resource type, WebService1 uses its scoped policy and ignores the root-level policy.

    See Security Policies.

  5. Analyze your users and the resources that you want them to access. Organize them into security groups and roles as follows:
  6. See Users, Groups, And Security Roles.

  7. Use the Administration Console to create users, groups, roles, and policies:
    1. To create the users and groups, see Manage Users and Groups in Administration Console Online Help.
    2. To create security roles, see Manage Security Roles in Administration Console Online Help.
    3. To create security policies, see Manage Security Policies in Administration Console Online Help.

Best Practices: Conditionalize Policies or Conditionalize Roles

Because both roles and policies can evaluate a set of conditions at runtime, you should consider which parts of your security data should be static and which should be dynamic. For example, you might want some policies to always allow one specific role to access a resource, and then you use conditions in the role's definition to move users in and out of the roles as needed. In other cases, you might want a static role definition and create a policy that allows access to different roles at different times of the day.

As a general guideline, if you base the authorization decision on the resource instead of the entities (roles) who can access the resource, you would add conditions to the security policy. If you base authorization on who can access the resource, then you would add conditions to the security role.

For an example of authorization based on who can access the resource, consider a manager who is going on vacation. You can temporarily place a user in a Manager security role. Dynamically granting this security role means that you do not need to change or redeploy your application to allow for such a temporary arrangement. You simply specify the hours between which the temporary manager should have special privileges. Further, you do not need to remember to revoke these special privileges when the actual manager returns as you would if you temporarily added the user to a management group.

Best Practices: Configure Entitlements Caching When Using WebLogic Providers

The WebLogic Authorization provider (DefaultAuthorizer) and the WebLogic Role Mapping provider (DefaultRoleMapper) improve performance by caching the roles, predicates, and resource data that they look up. If you modify your realm to use these WebLogic providers, you can configure the maximum number of items that they store in the caches.

Note: By default, security realms in newly created domains include the XACML Authorization and Role Mapping providers. The XACML providers use their own cache, but this cache is not configurable. WebLogic Server also includes the WebLogic Authorization provider (DefaultAuthorizer) and the Role Mapping provider (DefaultRoleMapper), which use a proprietary policy language. The DefaultAuthorizer and DefaultRoleMapper providers are the only BEA provider with configurable caches of entitlement data.

By default, the Weblogic Authorization and Role Mapping providers store the following number of items in each cache:

If a cache exceeds its maximum size, the WebLogic entitlements engine removes the least recently used (LRU) item from the cache.

If the applications on a WebLogic Server instance use more than 2000 roles or 5000 resources, consider increasing the cache sizes. (The WebLogic providers include less than 50 predicates, so there is no need to increase the size of this cache.)

To change the maximum number of items that a cache contains, pass one of the following system properties in the java startup command for a WebLogic Server instance:

By default, the WebLogic providers add items to the cache as they use them. With this configuration, the initial lookup of entitlement data takes longer than subsequent lookups. You can, however, decrease the amount of time needed for an initial lookup by configuring a WebLogic Server instance to load the caches during its startup cycle. To do so, pass the following system property to the server's java startup command:

For example:

java -Dweblogic.entitlement.engine.cache.max_role_count=6001
     -Dweblogic.entitlement.engine.cache.max_resource_count=3001
     -Dweblogic.entitlement.engine.cache.preload=true
      weblogic.Server

 

Skip navigation bar  Back to Top Previous Next