Voyager ORB

com.objectspace.voyager.security
Class VoyagerSecurityManager

java.lang.Object
  |
  +--java.lang.SecurityManager
        |
        +--com.objectspace.voyager.security.VoyagerSecurityManager

public class VoyagerSecurityManager
extends java.lang.SecurityManager

VoyagerSecurityManager is a pluggable security manager that restricts the operations of foreign objects. A foreign object is defined as an object whose class was loaded across the network from another program.

By default, a VoyagerSecurityManager is *not* installed. To install one, execute System.setSecurityManager( new VoyagerSecurityManager() );

If you are extending VoyagerSecurityManager to provide your own implementation, there is a method "isForeign()" that can be utilized to detect if a foreign object is involved in the call chain.

Version:
3.0

Fields inherited from class java.lang.SecurityManager
inCheck
 
Constructor Summary
VoyagerSecurityManager()
          Construct and initialize a Voyager security manager.
 
Method Summary
 void checkAccept(java.lang.String host, int port)
          A foreign object may accept connections from any host.
 void checkAccess(java.lang.Thread thread)
          A foreign object may not manipulate threads directly.
 void checkAccess(java.lang.ThreadGroup group)
          A foreign object may not manipulate thread groups directly.
 void checkAwtEventQueueAccess()
          A foreign object may gain access to the AWT event queue.
 void checkConnect(java.lang.String host, int port)
          A foreign object may connect to any host.
 void checkConnect(java.lang.String host, int port, java.lang.Object context)
          A foreign object may connect to any host.
 void checkCreateClassLoader()
          A foreign object may not create a class loader.
 void checkDelete(java.lang.String file)
          A foreign object may not delete files.
 void checkExec(java.lang.String cmd)
          A foreign object may not execute a process.
 void checkExit(int status)
          A foreign object may not exit the VM.
 void checkLink(java.lang.String lib)
          A foreign object may not link to dynamic library.
 void checkListen(int port)
          A foreign object may listen on any port.
 void checkMemberAccess(java.lang.Class type, int which)
          A foreign object may access only public data and methods.
 void checkMethodAccess(java.lang.Class type, java.lang.String method, java.lang.Object arg)
          Checks if the method invoked on the given type is allowed.
 void checkMulticast(java.net.InetAddress address)
          A foreign object may utilize multicast addressing.
 void checkMulticast(java.net.InetAddress address, byte ttl)
          A foreign object may utilize multicast addressing.
 void checkPackageAccess(java.lang.String packageName)
          A foreign object may access packages.
 void checkPackageDefinition(java.lang.String packageName)
          A foreign object may define classes in packages
 void checkPrintJobAccess()
          A foreign object may not print.
 void checkPropertiesAccess()
          A foreign object may manipulate properties.
 void checkPropertyAccess(java.lang.String key)
          A foreign object may manipulate properties.
 void checkRead(java.io.FileDescriptor fd)
          A foreign object may not read files, but may read socket file descriptors.
 void checkRead(java.lang.String file)
          A foreign object may not read files.
 void checkRead(java.lang.String file, java.lang.Object context)
          A foreign object may not read files.
 void checkSecurityAccess(java.lang.String provider)
          A foreign object may not access security APIs.
 void checkSetFactory()
          A foreign object may not set socket factories.
 void checkSystemClipboardAccess()
          A foreign object may not access the system clipboard.
 boolean checkTopLevelWindow(java.lang.Object window)
          A foreign object can create windows, but with warnings.
 void checkWrite(java.io.FileDescriptor fd)
          A foreign object may not write files but may write to socket file descriptors.
 void checkWrite(java.lang.String file)
          A foreign object may not write files.
protected  boolean invokedByRemoteMessage()
          Returns true if this thread of execution was initiated by a remote method invocation.
protected  boolean isForeign()
          Return true if the current object that is initiating the calling chain is a foreign object.
protected  boolean validThreadAccess()
           
 
Methods inherited from class java.lang.SecurityManager
checkPermission, checkPermission, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, getThreadGroup, inClass, inClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VoyagerSecurityManager

public VoyagerSecurityManager()
Construct and initialize a Voyager security manager.
Method Detail

checkAccept

public void checkAccept(java.lang.String host,
                        int port)
A foreign object may accept connections from any host.
Parameters:
host - The host name.
port - The port number.
Overrides:
checkAccept in class java.lang.SecurityManager

checkAccess

public void checkAccess(java.lang.Thread thread)
A foreign object may not manipulate threads directly.
Parameters:
thread - The thread.
Throws:
java.lang.SecurityException - A foreign object tried to manipulate a thread.
Overrides:
checkAccess in class java.lang.SecurityManager

checkAccess

public void checkAccess(java.lang.ThreadGroup group)
A foreign object may not manipulate thread groups directly.
Parameters:
group - The thread group.
Throws:
java.lang.SecurityException - A foreign object tried to manipulate a thread group.
Overrides:
checkAccess in class java.lang.SecurityManager

checkAwtEventQueueAccess

public void checkAwtEventQueueAccess()
A foreign object may gain access to the AWT event queue.
Overrides:
checkAwtEventQueueAccess in class java.lang.SecurityManager

checkConnect

public void checkConnect(java.lang.String host,
                         int port)
A foreign object may connect to any host.
Parameters:
host - The host name.
port - The port number.
Overrides:
checkConnect in class java.lang.SecurityManager

checkConnect

public void checkConnect(java.lang.String host,
                         int port,
                         java.lang.Object context)
A foreign object may connect to any host.
Parameters:
host - The host name.
port - The port number.
context - The context.
Overrides:
checkConnect in class java.lang.SecurityManager

checkCreateClassLoader

public void checkCreateClassLoader()
A foreign object may not create a class loader.
Throws:
java.lang.SecurityException - A foreign object tried to create a class loader.
Overrides:
checkCreateClassLoader in class java.lang.SecurityManager

checkDelete

public void checkDelete(java.lang.String file)
A foreign object may not delete files.
Parameters:
file - The filename.
Throws:
java.lang.SecurityException - A foreign object tried to delete a file.
Overrides:
checkDelete in class java.lang.SecurityManager

checkExec

public void checkExec(java.lang.String cmd)
A foreign object may not execute a process.
Parameters:
cmd - The command.
Throws:
java.lang.SecurityException - A foreign object tried to execute a process.
Overrides:
checkExec in class java.lang.SecurityManager

checkExit

public void checkExit(int status)
A foreign object may not exit the VM.
Parameters:
status - The exit status.
Throws:
java.lang.SecurityException - A foreign object tried to exit a VM.
Overrides:
checkExit in class java.lang.SecurityManager

checkLink

public void checkLink(java.lang.String lib)
A foreign object may not link to dynamic library.
Parameters:
lib - The library name.
Throws:
java.lang.SecurityException - A foreign object tried to link a dynamic library.
Overrides:
checkLink in class java.lang.SecurityManager

checkListen

public void checkListen(int port)
A foreign object may listen on any port.
Parameters:
port - The port number.
Overrides:
checkListen in class java.lang.SecurityManager

checkMemberAccess

public void checkMemberAccess(java.lang.Class type,
                              int which)
A foreign object may access only public data and methods.
Parameters:
type - The class.
Throws:
java.lang.SecurityException - A foreign object tried to access a non-public method or data member.
Overrides:
checkMemberAccess in class java.lang.SecurityManager

checkMulticast

public void checkMulticast(java.net.InetAddress address)
A foreign object may utilize multicast addressing.
Parameters:
address - The multicast address.
Overrides:
checkMulticast in class java.lang.SecurityManager

checkMulticast

public void checkMulticast(java.net.InetAddress address,
                           byte ttl)
A foreign object may utilize multicast addressing.
Parameters:
address - The multicast address.
ttl - value in use, if it is multicast send.
Overrides:
checkMulticast in class java.lang.SecurityManager

checkPackageAccess

public void checkPackageAccess(java.lang.String packageName)
A foreign object may access packages.
Parameters:
packageName - The package name.
Overrides:
checkPackageAccess in class java.lang.SecurityManager

checkPackageDefinition

public void checkPackageDefinition(java.lang.String packageName)
A foreign object may define classes in packages
Parameters:
packageName - The package name.
Overrides:
checkPackageDefinition in class java.lang.SecurityManager

checkPrintJobAccess

public void checkPrintJobAccess()
A foreign object may not print.
Throws:
java.lang.SecurityException - A foreign object tried to print.
Overrides:
checkPrintJobAccess in class java.lang.SecurityManager

checkPropertiesAccess

public void checkPropertiesAccess()
A foreign object may manipulate properties.
Overrides:
checkPropertiesAccess in class java.lang.SecurityManager

checkPropertyAccess

public void checkPropertyAccess(java.lang.String key)
A foreign object may manipulate properties.
Parameters:
key - The property key.
Overrides:
checkPropertyAccess in class java.lang.SecurityManager

checkRead

public void checkRead(java.io.FileDescriptor fd)
A foreign object may not read files, but may read socket file descriptors.
Parameters:
fd - The file descriptor.
Throws:
java.lang.SecurityException - A foreign object tried to read a file.
Overrides:
checkRead in class java.lang.SecurityManager

checkRead

public void checkRead(java.lang.String file)
A foreign object may not read files.
Parameters:
file - The filename.
Throws:
java.lang.SecurityException - A foreign object tried to read a file.
Overrides:
checkRead in class java.lang.SecurityManager

checkRead

public void checkRead(java.lang.String file,
                      java.lang.Object context)
A foreign object may not read files.
Parameters:
file - The filename.
context - The context.
Throws:
java.lang.SecurityException - A foreign object tried to read a file.
Overrides:
checkRead in class java.lang.SecurityManager

checkSecurityAccess

public void checkSecurityAccess(java.lang.String provider)
A foreign object may not access security APIs.
Parameters:
provider - The provider.
Throws:
java.lang.SecurityException - A foreign object tried to access the security API.
Overrides:
checkSecurityAccess in class java.lang.SecurityManager

checkSetFactory

public void checkSetFactory()
A foreign object may not set socket factories.
Throws:
java.lang.SecurityException - A foreign object tried to set a socket factory.
Overrides:
checkSetFactory in class java.lang.SecurityManager

checkSystemClipboardAccess

public void checkSystemClipboardAccess()
A foreign object may not access the system clipboard.
Throws:
java.lang.SecurityException - A foreign object tried to access the system clipboard.
Overrides:
checkSystemClipboardAccess in class java.lang.SecurityManager

checkTopLevelWindow

public boolean checkTopLevelWindow(java.lang.Object window)
A foreign object can create windows, but with warnings.
Parameters:
window - The window.
Overrides:
checkTopLevelWindow in class java.lang.SecurityManager

checkWrite

public void checkWrite(java.io.FileDescriptor fd)
A foreign object may not write files but may write to socket file descriptors.
Parameters:
fd - The file descriptor.
Throws:
java.lang.SecurityException - A foreign object tried to write a file.
Overrides:
checkWrite in class java.lang.SecurityManager

checkWrite

public void checkWrite(java.lang.String file)
A foreign object may not write files.
Parameters:
file - The filename.
Throws:
java.lang.SecurityException - A foreign object tried to write a file.
Overrides:
checkWrite in class java.lang.SecurityManager

checkMethodAccess

public void checkMethodAccess(java.lang.Class type,
                              java.lang.String method,
                              java.lang.Object arg)
Checks if the method invoked on the given type is allowed. By default all foreign objects or methods invoking the given method are denied access.
Parameters:
type - The class.
method - The method name.
arg - The argument passed to the method that may affect the access decision.
Throws:
java.lang.SecurityException - A foreign object tried to invoke a restricted method.

isForeign

protected boolean isForeign()
Return true if the current object that is initiating the calling chain is a foreign object.

invokedByRemoteMessage

protected boolean invokedByRemoteMessage()
Returns true if this thread of execution was initiated by a remote method invocation.

validThreadAccess

protected boolean validThreadAccess()

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240