|
Java Security - Deployment
An Introduction |
|
Prof. David Bernstein |
| Computer Science Department |
| bernstdh@jmu.edu |
Permission and Policy
SecurityManager and
AccessController
policytool
Policy
-Djava.security.manager argument ensures
that the default security manager is installed
grant codeBase "file:/home/sysadmin/" {
permission java.io.FilePermission "file:/home/public/", "read";
};
grant {
permission java.lang.RuntimePermission "modifyThread";
permission java.net.SocketPermission "*", "accept, connect,listen,resolve";
permission java.util.logging.LoggingPermission "control";
};
Note: An application can always read from the directory it was started in (and all subdirectories of that directory).
Policy
Class:
Principal objects,
columns corresponding to CodeSource objects,
and Permission objects in the body)public boolean implies(ProtectionDomain, Permission)
is called to see whether the Permission
is granted Policy objects can be constructed,
only one is in effect at any point in time