Class sun.server.http.ServletSecurity
All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.http.ServletSecurity
java.lang.Object
|
+----java.lang.SecurityManager
|
+----sun.server.http.ServerSecurity
|
+----sun.server.http.ServletSecurity
- public class ServletSecurity
- extends ServerSecurity
This class defines and implements a servlet security policy for the
http server.
It extends ServerSecurity, which itself extends
java.lang.SecurityManager.
The server sandbox protects access to these Jeeves resources:
- HTTP request objects
- HTTP response objects
- Files served by Jeeves
- Jeeves' own configuration files
- ACL entries
- Threads controlled by other servlets
- Capabilities context of other servlets
- Networking APIs
-
ServletSecurity()
- Construct and initialize.
-
checkAccept(String, int)
- For now servlets can't accept connections on any port.
-
checkAccess(Thread)
- Servlets are not allowed to manipulate threads outside
servlet thread groups.
-
checkAccess(ThreadGroup)
- Servlets are not allowed to manipulate thread groups outside
servlet thread groups.
-
checkACLaccess(Principal, Acl, String)
- Check if a principal can get, set or delete the ACL for an object.
-
checkConnect(String, int)
- Check if a servlet can connect to the given host:port.
-
checkConnect(String, int, Object)
- Checks to see if the servlet and the indicated execution context
are both allowed to connect to the indicated host and port.
-
checkConnect(String, String)
- Check if a servlet from a host can connect to another
host.
-
checkCreateClassLoader()
- Servlets are not allowed to create class loaders, or even execute any
of ClassLoader's methods.
-
checkExec(String)
- Servlets are not allowed to fork processes.
-
checkExit(int)
- Servlets are not allowed to exit the VM.
-
checkLink(String)
- Servlets are not allowed to link dynamic libraries.
-
checkListen(int)
- For now servlets can't listen on any port.
-
checkPackageAccess(String)
- Check if a servlet can access a package.
-
checkPackageDefinition(String)
- Check if a servlet can define classes in a package.
-
checkPropertiesAccess()
- Servlets are not allowed to access the entire system properties
list, only properties explicitly labeled as accessible to servlets.
-
checkPropertyAccess(String)
- Servlets can access the system property named by key
only if its twin key.servlet property is set to true.
-
checkRead(FileDescriptor)
- Servlets are not allowed to open file descriptors unless
it is done through a socket, in which case other access
restrictions still apply.
-
checkRead(String)
- Check if an servlet can read a particular file.
-
checkRead(String, Object)
- Checks to see if the current context or the indicated context are
both allowed to read the given file name.
-
checkRead(String, URL)
-
-
checkSetFactory()
- Check if a servlet can set a networking-related object factory.
-
checkWrite(FileDescriptor)
- Servlets are not allowed to open file descriptors unless
it is done through a socket, in which case other access
restrictions still apply.
-
checkWrite(String)
- Check if a servlet can write a particular file.
-
getSecurityContext()
- The only variable that currently affects whether a servlet can
perform certain operations is the host it came from.
-
reset()
- Reset from Properties
ServletSecurity
public ServletSecurity()
- Construct and initialize.
reset
public void reset()
- Reset from Properties
getSecurityContext
public Object getSecurityContext()
- The only variable that currently affects whether a servlet can
perform certain operations is the host it came from.
- Overrides:
- getSecurityContext in class SecurityManager
checkCreateClassLoader
public synchronized void checkCreateClassLoader()
- Servlets are not allowed to create class loaders, or even execute any
of ClassLoader's methods.
- Overrides:
- checkCreateClassLoader in class SecurityManager
checkAccess
public synchronized void checkAccess(Thread t)
- Servlets are not allowed to manipulate threads outside
servlet thread groups.
- Overrides:
- checkAccess in class SecurityManager
checkAccess
public synchronized void checkAccess(ThreadGroup g)
- Servlets are not allowed to manipulate thread groups outside
servlet thread groups.
- Overrides:
- checkAccess in class SecurityManager
checkExit
public synchronized void checkExit(int status)
- Servlets are not allowed to exit the VM.
- Overrides:
- checkExit in class SecurityManager
checkExec
public synchronized void checkExec(String cmd)
- Servlets are not allowed to fork processes.
- Overrides:
- checkExec in class SecurityManager
checkLink
public synchronized void checkLink(String lib)
- Servlets are not allowed to link dynamic libraries.
- Overrides:
- checkLink in class SecurityManager
checkPropertiesAccess
public synchronized void checkPropertiesAccess()
- Servlets are not allowed to access the entire system properties
list, only properties explicitly labeled as accessible to servlets.
- Overrides:
- checkPropertiesAccess in class SecurityManager
checkPropertyAccess
public synchronized void checkPropertyAccess(String key)
- Servlets can access the system property named by key
only if its twin key.servlet property is set to true.
For example, the property
java.home
can be read by
servlets only if java.home.servlet
is true
.
- Overrides:
- checkPropertyAccess in class SecurityManager
checkRead
public synchronized void checkRead(String file)
- Check if an servlet can read a particular file.
- Overrides:
- checkRead in class SecurityManager
checkRead
public synchronized void checkRead(String file,
URL base)
checkRead
public void checkRead(String file,
Object context)
- Checks to see if the current context or the indicated context are
both allowed to read the given file name.
- Parameters:
- file - the system dependent file name
- context - the alternate execution context which must also
be checked
- Throws: SecurityException
- If the file is not found.
- Overrides:
- checkRead in class SecurityManager
checkWrite
public synchronized void checkWrite(String file)
- Check if a servlet can write a particular file.
- Overrides:
- checkWrite in class SecurityManager
checkRead
public synchronized void checkRead(FileDescriptor fd)
- Servlets are not allowed to open file descriptors unless
it is done through a socket, in which case other access
restrictions still apply.
- Overrides:
- checkRead in class SecurityManager
checkWrite
public synchronized void checkWrite(FileDescriptor fd)
- Servlets are not allowed to open file descriptors unless
it is done through a socket, in which case other access
restrictions still apply.
- Overrides:
- checkWrite in class SecurityManager
checkListen
public synchronized void checkListen(int port)
- For now servlets can't listen on any port.
- Overrides:
- checkListen in class SecurityManager
checkAccept
public synchronized void checkAccept(String host,
int port)
- For now servlets can't accept connections on any port.
- Overrides:
- checkAccept in class SecurityManager
checkConnect
public synchronized void checkConnect(String host,
int port)
- Check if a servlet can connect to the given host:port.
- Overrides:
- checkConnect in class SecurityManager
checkConnect
public void checkConnect(String host,
int port,
Object context)
- Checks to see if the servlet and the indicated execution context
are both allowed to connect to the indicated host and port.
- Overrides:
- checkConnect in class SecurityManager
checkConnect
public synchronized void checkConnect(String fromHost,
String toHost)
- Check if a servlet from a host can connect to another
host. This usually means that you need to determine whether
the hosts are inside or outside the firewall. For now servlets
can only access the host they came from.
checkPackageAccess
public synchronized void checkPackageAccess(String pkg)
- Check if a servlet can access a package.
- Overrides:
- checkPackageAccess in class SecurityManager
checkPackageDefinition
public synchronized void checkPackageDefinition(String pkg)
- Check if a servlet can define classes in a package.
- Overrides:
- checkPackageDefinition in class SecurityManager
checkSetFactory
public synchronized void checkSetFactory()
- Check if a servlet can set a networking-related object factory.
- Overrides:
- checkSetFactory in class SecurityManager
checkACLaccess
public synchronized void checkACLaccess(Principal principal,
Acl acl,
String access)
- Check if a principal can get, set or delete the ACL for an object.
- Overrides:
- checkACLaccess in class ServerSecurity
All Packages Class Hierarchy This Package Previous Next Index