Skip navigation.
Downloads | Product Documentation | Support

Securing WebLogic Server

# Customizing the Default Security Configuration

The following sections provide information about customizing the default security configuration by creating a new security realm:

- Why Customize the Default Security Configuration?
- Before You Create a New Security Realm
- Creating and Configuring a New Security Realm: Main Steps

For information about configuring security providers, see Configuring WebLogic Security Providers, and Configuring Authentication Providers.

For information about migrating security data to a new security realm, see Migrating Security Data.

# Why Customize the Default Security Configuration?

To simplify the configuration and management of security, WebLogic Server provides a default security configuration. In the default security configuration, `myrealm` is set as the default (active) security realm, and the WebLogic Adjudication, Authentication, Identity Assertion, Credential Mapping, CertPath, XACML Authorization and XACML Role Mapping providers are defined as the security providers in the security realm.

Customize the default security configuration if you want to do any of the following:

- Replace one of the security providers in the default realm with a different security provider.
- Configure additional security providers in the default security realm. (For example, if you want to use two Authentication providers, one that uses the embedded LDAP server and one that uses a Windows NT store of users and groups.)
- Use an Authentication provider that accesses an LDAP server other than WebLogic Server's embedded LDAP server.
- Use an existing store of users and groups (for example, a DBMS database) instead of defining users and groups in the WebLogic Authentication provider.
- Add an Auditing provider to the default security realm.
- Use an Identity Assertion provider that handles SAML assertions or Kerberos tokens.
- Use the Certificate Registry to add certificate revocation to the security realm.
- Change the default configuration settings of the security providers.

For information about configuring different types of security providers in a security realm, see Configuring WebLogic Security Providers and Configuring Authentication Providers.

The easiest way to customize the default security configuration is to add the security providers you want to the default security realm (`myrealm`). However, BEA recommends instead that you customize the default security configuration by creating an entirely new security realm. This preserves your ability to revert more easily to the default security configuration. You configure security providers for the new realm; migrate any security data, such as users as groups, from the existing default realm; and then set the new security realm as the default realm. See Creating and Configuring a New Security Realm: Main Steps.

# Before You Create a New Security Realm

Before creating a new security realm, you need to decide:

- What model to use to set security roles and security policies for Web application and EJB resources. These security roles and policies can be set through deployment descriptors or through the WebLogic Administration Console. See see "Options for Securing Web Application and EJB Resources in Securing WebLogic Resources.
- How to create and manage credential maps. You can load credential maps from a resource adapter's deployment descriptor file (`weblogic-ra.xml`) into the embedded LDAP server and then use the Administration Console to create new credential maps, or directly modify credential maps defined in the deployment descriptor.

Once information from a `weblogic-ra.xml` deployment descriptor file is loaded into the embedded LDAP server, the original resource adapter remains unchanged. Therefore, if you redeploy the original resource adapter (which will happen if you redeploy it through the WebLogic Administration Console, modify it on disk, or restart WebLogic Server), the data will once again be imported from the `weblogic-ra.xml` deployment descriptor file and new credential mapping information may be lost.

- Whether or not to use the Web resource.

The Web resource is deprecated. If you are configuring a custom Authorization provider that uses the Web resource (instead of the URL resource) in the new security realm, enable Use Deprecated Web Resource on the new security realm. This option changes the runtime behavior of the Servlet container to use a Web resource rather than a URL resource when performing authorization.

Note: When you create a new security realm, you must configure at least one of the Authentication providers to return asserted LoginModules. Otherwise, `run-as` tags defined in deployment descriptors will not work.

For more information, see Configure new security realms in the Administration Console online help.

# Creating and Configuring a New Security Realm: Main Steps

To create a new security realm:

1. Define a name and set the configuration options for the security realm. See Before You Create a New Security Realm and Configure new security realms in the Administration Console online help.
2. Configure the required security providers for the security realm. A valid security realm requires an Authentication provider, an Authorization provider, an Adjudication provider, a Credential Mapping provider, a Role Mapping provider, and a CertPathBuilder. See Configuring WebLogic Security Providers and Configuring Authentication Providers.
3. Optionally, define Identity Assertion, Auditing, and Certificate Registry providers. See Configuring WebLogic Security Providers and Configuring Authentication Providers.
4. If you configured the WebLogic Authentication, Authorization, Credential Mapping or Role Mapping provider or the Certificate Registry in the new security realm, verify that the settings of the embedded LDAP server are appropriate. See Managing the Embedded LDAP Server.
5. Optionally, configure caches to improve the performance of the WebLogic or LDAP Authentication providers in the security realm. See Improving the Performance of WebLogic and LDAP Authentication Providers.
6. Protect WebLogic resources in the new security realm with security policies. Creating security policies is a multi-step process with many options. To fully understand this process, read Securing WebLogic Resources. This document should be used in conjunction with Securing WebLogic Server to ensure security is completely configured for a WebLogic Server deployment.
7. If the security data (users and groups, roles and policies, and credential maps) defined in the existing security realm will also be valid in the new security realm, you can export the security data from the existing realm and import it into the new security realm. See Migrating Security Data.
8. Protect user accounts in the new security realm from dictionary attacks by setting lockout attributes. See Protecting User Accounts.
9. Set the new realm as the default security realm for the WebLogic domain. See Change the default security realm in the Administration Console online help.

Note: You can also use the WebLogic Scripting Tool or Java Management Extensions (JMX) APIs to create a new security configuration. See WebLogic Scripting Tool.