Adding JRun service security

JMX does not provide a security layer of its own, but uses the Java 2 security model to protect attributes and methods. Protecting operations involves the following steps:

  1. Creating the proper Permission object to represent the permission to enforce.
  2. Assigning the permission to jrun.jar using the jrun.policy file that is used at server startup.
  3. Adding AccessController checks before the method body within the service method that you are protecting.

If the calling code has permission to invoke the method, the method logic proceeds; if it does not, access is prevented and an Exception is thrown.

Note:   The permissions and policy model authenticates code, not users. Permissions assigned to services are given to all code originating from jrun.jar; the permissions are listed in the jrun.policy file located at JRUN_HOME/lib/jrun.policy.

For example, no code outside of jrun.jar gets the necessary permissions to perform any meaningful operations on the JRun transaction manager. This is defined in jrun.policy, loaded into the protection domains for the classes at server startup, and enforced in several service methods. Any user can look up and retrieve a reference to a service, but that does not imply that the calling code can invoke any method on the service that it is referencing. The method would have to be invoked from within the proper code base, as permissions are granted to code bases.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/jrun/4/JRun_SDK_Guide/creatingservices5.htm