A security manager is an object that defines a security policy for an application. This policy specifies actions that are unsafe or sensitive. Any actions not allowed by the security policy cause a SecurityException to be thrown. An application can also query its security manager to discover which actions are allowed.
Questions tagged [securitymanager]
218 questions
3
votes
1 answer
Java SocketPermission policy question
I have a client and server program that attempt to communicate with each other. In my policy file for the server, I have specified the following:
grant signedBy "vivin" {
permission java.io.FilePermission "-", "read, write";
permission…

Vivin Paliath
- 94,126
- 40
- 223
- 295
3
votes
0 answers
Block reflection field/method access from classloader
I'm doing a plugin system with a security manager to restrict the plugin's actions. My problem is, it will be easy to bypass the system when people are able to access every field using reflection.
I don't want to block reflection for everything,…

Florian
- 31
- 4
3
votes
1 answer
How to build a sandbox environment
Hi SecurityManager Experts out there ;-)
I have written a small plugin framework that loads plugins with separate isolated classloaders. For a successfull undeploy of a plugin it is important to make sure that no reference to classes loaded by the…

UNIQUEorn
- 420
- 6
- 17
3
votes
2 answers
If the current thread has the authority to exit Java virtual machine
I'm trying the class SecurityManager. I want to check if the current thread has the authority to exit Java virtual machine. Below is the code I came up with.
SecurityManager appsm =…
user5849987
3
votes
0 answers
java.security.AccessControlException in Tomcat with DISABLED SecurityManager
I have a web application written in Java using Apache Derby database in Tomcat 7. The exception will not occur on every call to the web application, but only after about 5 to 10 successful requests.
This is what happens (from my log):
The exception…

A.T.
- 127
- 9
3
votes
1 answer
Tomcat configuration for Spring app
I have built web application for use in Tomcat. It depends on Spring. I have the following exception when trying to access it:
java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
I read tomcat docs,…

Denis
- 1,130
- 3
- 17
- 32
3
votes
3 answers
SecurityManager.IsGranted() behaviour
can anybody please explain the following c# behaviour? I have written a small console application just to learn about CAS, but I can not seem to understand why the following lines of code work like they do:
string[] myRoles = new string[] { "role1",…
MadViking
3
votes
1 answer
Load external Java method from inside of a XSL stylesheet with JDK internal Xalan and SecurityManager
In our project we currently moved to Java 8 and want to use now the internal XML libraries instead of additional ones.
For that we removed e.g. our xalan.jar from our classpath.
This leads to ClassNotFoundExceptions when trying to render our XML…

Jens
- 53
- 5
3
votes
1 answer
Is it possible to write an exclusive Java Security policy for the default Security Manager?
I would like to write a java security policy which allows all permissions, except of a specific type.
An example might be:
app can only read system properties called MY_ACCESSIBLE_SYSTEM_PROP_1 and MY_ACCESSIBLE_SYSTEM_PROP_2
app cannot read any…

Armand
- 23,463
- 20
- 90
- 119
3
votes
1 answer
Java RMI To use SecurityManager or not to use SecurityManager
After significant searching and trial and error, I still can not determine if a Security Manager is necessary and if so, how to make it work.
Code to start server:
Registry registry;
try {
…

KSK
- 149
- 3
- 15
3
votes
1 answer
How to unit test Java code that is expected to run within an applet Security Manager
I have some Java library code which sometimes runs as an unsigned applet. Because of this it is not always allowed to do some operations (for instance checking for system properties).
I would like to run some unit tests with an Applet-like…

lexicalscope
- 7,158
- 6
- 37
- 57
3
votes
1 answer
Enabling java security manager limits udp sockets count
I have the java app with a custom security policy and when I tried to open 100 udp sockets I've got exception:
java.net.SocketException: maximum number of DatagramSockets reached
Test app:
import java.net.DatagramSocket;
import…

Zur13
- 370
- 5
- 11
3
votes
1 answer
Can I trust Java SecurityManager sandbox?
I'm writing a JavaFX2 application that accepts arbitrary code to be loaded from remote locations. For me using a custom SecurityManager, ClassLoader and ProtectionDomain was the way to go. Unfortunately this seems to be the same setup that's used to…

Flavio
- 846
- 1
- 9
- 21
3
votes
6 answers
Program runs out of memory after resolving many domains under a security manager?
I have a service where domain names to be resolved come from untrusted sources. Recently, it kept crashing from running out of memory. I narrowed down the possible reasons, and came to the conclusion that it must be related to the recent flux of DNS…

Dog
- 7,707
- 8
- 40
- 74
3
votes
1 answer
How to sandbox a class?
Say I have a web site where people can upload their code in class form. How could I limit what can actually be done within that class?

James P.
- 19,313
- 27
- 97
- 155