Questions tagged [java-security-manager]

69 questions
9
votes
2 answers

How to check caller class origin in SecurityManager?

I've got one ClassLoader for trusted application code and a seperate ClassLoader for user-submitted (untrusted) code. I want the user-submitted code to be restricted by the Security Manager. How do I check the caller origin from within the…
Henk Schurink
  • 419
  • 6
  • 17
5
votes
0 answers

How to set java security policy file to only avoid System.exit calls while executing JUnit tests via gradle?

I want to execute JUnit tests via gradle where I want to avoid invocation of System.exit() calls in these tests. I've read that setting a security policy file would do the trick. This is the security policy file that I am using grant { …
4
votes
0 answers

RMI class loading from codebase without deprecated SecurityManager?

I'm using RMI to invoke a method that is specified to return an object of class ClassX. ClassX xObj = remoteObject.meth(...); If the remote method actually returns an instance of a locally unknown subclass SubclassOfX of ClassX, this class…
Any1
  • 41
  • 3
4
votes
1 answer

java.security.properties - changes not applied

I try to append security properties to java.security. Hence I add a property "java.security.properties" specifying the file to be appended. I checked that security.overridePropertiesFile is set to true. For some reason the changes to the security…
Lao Tse
  • 171
  • 3
  • 12
4
votes
1 answer

When load some class in checkPermission method why SecurityManager emit recursive update exception?

I'm upgrading jdk 8 to 11. I load some class in checkPermission method then security manager emit recursive update exception. but use jdk1.8.0_202 everything works fine. What causes this problem? My environment. OS: macOS 10.15.6 JDK(Oracle):…
kospi
  • 355
  • 5
  • 14
4
votes
0 answers

Java SecurityManager custom access control design

We are running untrusted user code in a JVM with a security manager installed. That untrusted code should be able to use the Jackson libraries, and some operations in those libraries require the accessDeclaredMembers runtime permission. I don't want…
franck102
  • 221
  • 4
  • 14
4
votes
1 answer

Java Security Manager: Restrictions on code from external jar loaded via ServiceLoader

What am I trying to achieve? I am working on a java application that can be extended by additional jars that get integrated via ServiceLoader. These loaded extensions should run with some restrictions by the SecurityManager, of course simply to…
DataWorm
  • 73
  • 5
3
votes
1 answer

Memory leak at bouncycastle.jce.provider

I'm running a java (openjdk:11.0.8) application using bouncycastle.jce.provider: group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.65' I noticed a memory leak and the dump shows that almost all of the memory is comsumed…
3
votes
0 answers

Is it possible to use SecurityManager to control which classes can write to stdout/stderr?

I'm curious if it's possible to restrict who can write to System.out/System.err using a SecurityManager. Looking at System.java this doesn't appear to be possible out of the box, but perhaps there's another layer I haven't looked at? If it's not…
dimo414
  • 47,227
  • 18
  • 148
  • 244
3
votes
0 answers

Enforcing Java Security Policy based on signedBy

I'm trying to enforce a security policy, giving Java classes signed by a certain signer certain permissions. My security policy file looks as following: // ========== SYSTEM CODE PERMISSIONS ========================================= grant codeBase…
3
votes
0 answers

Java SecurityManager grant vs grant codebase

I am investigating java security manager. I see that 'grant' is required attribute for *.policy file and it is global. But how it will behave in case if I add 'grant codeBase' for the same resoure. For example: grant codeBase…
Alex85
  • 135
  • 1
  • 3
  • 10
3
votes
1 answer

Is it possible to sandbox just a Runnable

Is it possible to sandbox my Runnable within Java? Given a Runnable, I want the code inside of it (along with whatever threads it spawns) to run in a sandbox that only lets the code access a specific path on the fileystem. Once that Runnable…
offbynull
  • 381
  • 3
  • 16
3
votes
1 answer

A java SecurityManager that is identical to NO security manager except for a single check adjustment for System.exit

I am not well versed in java security managers and therefore want to confirm my understanding: I have a java process that randomly stops (shutdown hook runs) even though there is no trace of someone killing it. As a result I decided to install a…
Alexandros
  • 2,097
  • 20
  • 27
2
votes
1 answer

How to use Java Policy files

I'm the owner of a platform which allows anyone to upload their own products (jar files), I'm looking to secure the platform using java policy files. I'm using JRE azul-1.8.9_345, I'm testing with this program, public static void main(String[]…
8Sence W
  • 23
  • 3
2
votes
1 answer

How to create java RMI program without SecurityManager as it's deprecated?

As referring to the "Creating and Installing a Security Manager" for oracle's tutorial: https://docs.oracle.com/javase/tutorial/rmi/implementing.html It mentioned whenever we need to download code from the remote machine in a RMI program, the…
Tel lui
  • 139
  • 1
  • 2
  • 13
1
2 3 4 5