WAS v8.5 > Administer applications and their environment > Use the administrative clients > Use administrative programs (JMX) > Extend the WAS administrative system with custom MBeans

Define an explicit MBean security policy

We can explicitly define an MBean security policy for a particular MBean. Use this example to define an MBean security policy.

This task assumes a basic familiarity with MBean programming. For information on MBean programming, see MBean Java API documentation. In this information center, click Reference > Mbean interfaces. Perform the following tasks to define an explicit security policy.

  1. Assume that we have an MBean defined by the MBean sample.xml descriptor file.

  2. Specify the explicit security policy for that MBean in the sampleSecurity.xml file. The naming convention is that you must append "Security" to the MBean descriptor file name as the name of the MBean security descriptor file.
  3. Place the security policy descriptor file at the same directory where the MBean security descriptor file is so the MBean loader can find it. This directory is the typical location for the security policy descriptor file. If no MBean security descriptor file is present, the default MBean security policy is used.

  4. Specify the MBean name of sample in the resource element resource-name field of the sampleSecurity.xml file so the MBean policy loader can associate the MBean security policy with the MBean. The MBean security descriptor definition is very similar to the security policy defined by the J2EE deployment descriptor.


Results

You now have an explicitly defined MBean security policy that we can run with an MBean.


Example

The following example describes the MBean security descriptor file format for the sampleSecurity.xml file.

Line 2 specifies that an MBean security descriptor schema is defined by the RolePermissionDescriptor.dtd file, which is a document type definition (DTD) in WebSphere Application Server.

As shown on line 3, each MBean descriptor file contains a single role-permission element. The administrative security role hierarchy is defined in the security-role elements between line 9 and line 37. The administrative security role has an inheritance relationship.

As defined on line 14 through 21, the operator security role implies the monitor security role, which means that a user with the operator role has all the permissions of the monitor role. As defined between line 30 and line 38, an administrator security role implies both the configurator and operator security role. Every MBean security descriptor file typically has the same role relationship definition so that we can cut and paste this section to your MBean security descriptor file.

One or more method-permission elements are defined after the security-role element. Each method-permission element defines the required roles for one or more methods. Specify method parameters to avoid method name collision in case multiple methods have the same name.


Related concepts:

Administrative security
Default MBean security policy


+

Search Tips   |   Advanced Search