|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.SecurityManager
|
+--osl.foundry.FoundrySecurityManager
This class implements the security behavior of the main foundry node. The basic policy is that only the direct actions of an Actor thread are limited. We can't just limit Actor threads in general because the same thread is often used while making up-calls through the various libraries.
The security check for a thread works by looking at the class context for the call to a particular security function. The context is scanned from front to back. If an instance of Actor is encountered before any instance of one of the classes listed below, then a security exception is raised. Similarly, if no instance of one of the "privileged" classes is encountered in the context, then an exception is raised. Otherwise, no exception is thrown and the activity is allowed to continue.
A class is "privileged" if it is an instance of one of the following classes:
All other classes are considered "unprivileged".
| Field Summary | |
protected static java.lang.Class |
actorClass
This field caches the Class object for Actor. |
protected static java.lang.String[] |
legalClasses
This field holds the complete class names of all the "legal" classes. |
protected static java.lang.Class[] |
legalTable
|
protected static java.lang.Class |
ourClass
This field caches the Class object for FoundrySecurityManager. |
| Fields inherited from class java.lang.SecurityManager |
inCheck |
| Constructor Summary | |
FoundrySecurityManager()
|
|
| Method Summary | |
void |
addPrivilegedClass(java.lang.Class toAdd)
Add a new class to the set of privileged classes. |
void |
checkAccept(java.lang.String host,
int port)
Check if the caller is allowed to accept a socket connection. |
void |
checkAccess(java.lang.Thread g)
Check if the calling thread can modify the thread g. |
void |
checkAccess(java.lang.ThreadGroup g)
Check if the calling thread can modify the thread group g. |
void |
checkAwtEventQueueAccess()
Check if the caller can get access to the AWT event queue. |
void |
checkConnect(java.lang.String host,
int port)
Check if the caller is allowed to open a socket connection. |
void |
checkConnect(java.lang.String host,
int port,
java.lang.Object context)
Check if the caller is allowed to open a socket connection. |
void |
checkCreateClassLoader()
Check if the calling thread is allowed to create a class loader. |
void |
checkDelete(java.lang.String file)
Check if the caller is allowed to delete a file. |
void |
checkExec(java.lang.String cmd)
Check if the caller is allowed to create a subprocess. |
void |
checkExit(int status)
Check if the caller is allowed to halt the JVM. |
void |
checkLink(java.lang.String lib)
Check if the caller is allowed to load a dynamic library. |
void |
checkListen(int port)
Check if the caller is allowed to way for a connection on a port. |
void |
checkMemberAccess(java.lang.Class clazz,
int which)
Tests if a client is allowed to access members. |
void |
checkMulticast(java.net.InetAddress maddr)
Check if the caller is allowed to perform an IP multicast. |
void |
checkMulticast(java.net.InetAddress maddr,
byte ttl)
Check if the caller is allowed to perform an IP multicast. |
void |
checkPackageAccess(java.lang.String pkg)
Check if caller is allowed to access a package. |
void |
checkPackageDefinition(java.lang.String pkg)
Check if the caller is allowed to define a class in a package. |
void |
checkPrintJobAccess()
Check if the caller is allowed to initiate a print job request. |
void |
checkPropertiesAccess()
Check if the caller is allowed to access or modify system properties. |
void |
checkPropertyAccess(java.lang.String key)
Check if the caller is allowed to access or modify a system property. |
void |
checkRead(java.io.FileDescriptor fd)
Check if the caller is alowed to read from a file. |
void |
checkRead(java.lang.String file)
Check if the caller is allowed to read a file. |
void |
checkRead(java.lang.String file,
java.lang.Object context)
Check if the caller is allowed to read a file given a security context. |
void |
checkSecurityAccess(java.lang.String action)
Don't know what exactly this is used for but according to java.lang.SecurityManager: "Tests access to certain operations for a security API action". |
void |
checkSetFactory()
Check if the caller is allowed to set a socket factory. |
void |
checkSystemClipboardAccess()
Check if the caller can access the system clipboard. |
boolean |
checkTopLevelWindow(java.lang.Object window)
Check if the caller is allowed to create a top-level window. |
void |
checkWrite(java.io.FileDescriptor fd)
Check if the caller is allowed to write to a file. |
void |
checkWrite(java.lang.String file)
Check if the caller is allowed to write to a file. |
protected boolean |
verifyThread()
This method returns true if the current thread (according to the class context) should be allowed access, and false otherwise. |
| 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 |
| Field Detail |
protected static java.lang.Class actorClass
protected static java.lang.Class ourClass
protected static java.lang.String[] legalClasses
protected static java.lang.Class[] legalTable
| Constructor Detail |
public FoundrySecurityManager()
| Method Detail |
protected boolean verifyThread()
public void checkCreateClassLoader()
public void checkAccess(java.lang.Thread g)
g - The thread to be checked.java.lang.System#getSecurityManager(),
Thread.resume(),
Thread.setDaemon(boolean),
Thread.setName(java.lang.String),
Thread.setPriority(int),
Thread.stop(),
Thread.suspend()public void checkAccess(java.lang.ThreadGroup g)
g - The thread group to be checked.java.lang.System#getSecurityManager(),
ThreadGroup.destroy(),
ThreadGroup.resume(),
ThreadGroup.setDaemon(boolean),
ThreadGroup.setMaxPriority(int),
ThreadGroup.stop(),
ThreadGroup.suspend()public void checkExit(int status)
status - The exit status.java.lang.Runtime#exit(int),
java.lang.System#getSecurityManager()public void checkExec(java.lang.String cmd)
cmd - The system command to execute.java.lang.Runtime#exec(java.lang.String),
java.lang.Runtime#exec(java.lang.String, java.lang.String[]),
java.lang.Runtime#exec(java.lang.String[]),
java.lang.Runtime#exec(java.lang.String[], java.lang.String[]),
java.lang.System#getSecurityManager()public void checkLink(java.lang.String lib)
lib - The name of the library to load.java.lang.Runtime#load(java.lang.String),
java.lang.Runtime#loadLibrary(java.lang.String),
java.lang.System#getSecurityManager()public void checkRead(java.io.FileDescriptor fd)
fd - The file descriptor.FileDescriptorpublic void checkRead(java.lang.String file)
file - The file name.
public void checkRead(java.lang.String file,
java.lang.Object context)
file - The file name.context - A security context.SecurityManager.getSecurityContext()public void checkWrite(java.io.FileDescriptor fd)
fd - A file descriptor.FileDescriptorpublic void checkWrite(java.lang.String file)
file - The filename.public void checkDelete(java.lang.String file)
file - The filename.File.delete(),
java.lang.System#getSecurityManager()
public void checkConnect(java.lang.String host,
int port)
host - The host name port to connect to.port - The protocol port to connect to.host and port.
public void checkConnect(java.lang.String host,
int port,
java.lang.Object context)
host - The host name port to connect to.port - The protocol port to connect to.context - A security context.host and
port.SecurityManager.getSecurityContext()public void checkListen(int port)
port - The port number.
public void checkAccept(java.lang.String host,
int port)
host - The host name of the socket connection.port - The port number of the socket connection.java.lang.System#getSecurityManager(),
java.net.ServerSocket#accept()public void checkMulticast(java.net.InetAddress maddr)
multicast - Internet address to be used.
public void checkMulticast(java.net.InetAddress maddr,
byte ttl)
multicast - Internet address to be used.ttl - Value in use, if it is multicast send.public void checkPropertiesAccess()
java.lang.System#getProperties(),
java.lang.System#setProperties(java.util.Properties)public void checkPropertyAccess(java.lang.String key)
key - A system property key.java.lang.System#getProperty(java.lang.String)public boolean checkTopLevelWindow(java.lang.Object window)
window - The new window to be created.true if the caller is trusted to put up
top-level windows; false otherwise.java.awt.Windowpublic void checkPrintJobAccess()
public void checkSystemClipboardAccess()
public void checkAwtEventQueueAccess()
public void checkPackageAccess(java.lang.String pkg)
pkg - The package name.ClassLoader.loadClass(java.lang.String, boolean)public void checkPackageDefinition(java.lang.String pkg)
pkg - The package name.ClassLoader.loadClass(java.lang.String, boolean)public void checkSetFactory()
java.net.ServerSocket#setSocketFactory(java.net.SocketImplFactory),
Socket.setSocketImplFactory(java.net.SocketImplFactory),
URL.setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory)
public void checkMemberAccess(java.lang.Class clazz,
int which)
public void checkSecurityAccess(java.lang.String action)
public void addPrivilegedClass(java.lang.Class toAdd)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||