securitymanager

Why can't I shutdown my own ExecutorService under a SecurityManager?

Under the default security manager, if I create an ExecutorService (ThreadPoolExecutor in this case), I cannot shut it down, shutdown() just calls checkPermission("modifyThread") and thus immediately dies: import java.util.concurrent.*; class A { public static void main( String[] args) { Thread ct = Thread.currentThread(); ...

NoClassDefFoundError when creating objects under SecurityManager

I'm trying to secure my application by running the bits of code that deal with user-provided content under a very restrictive SecurityManager. It's AccessController.doPrivileged() turned on its head - normally this is used to provide a block of code with extra permissions but I'm using it to constrain a block of code to a very small san...

Java security: Sandboxing plugins loaded via URLClassLoader

Question summary: How do I modify the code below so that untrusted, dynamically-loaded code runs in a security sandbox while the rest of the application remains unrestricted? Why doesn't URLClassLoader just handle it like it says it does? EDIT: Updated to respond to Ani B. EDIT 2: Added updated PluginSecurityManager. My application ha...

Is there a way to use multiple SecurityManager(s) in Java?

Hi there! I'd like to know if there is a way to use multiple security managers in java, and if so, how to specify them a particular .policy file? I've been looking at the java se 6 doc about Security, but couldn't find any answer there... Thanks everyone for help! ...