Questions tagged [java-security-manager]

58 questions
10
votes
0 answers

javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT

I'm storing AES decryption key in AndroidKeyStore to decrypt data from SQLiteDB. Unfortunately, sometimes I get this error (Any android device and any API) rarely. I would like to know what exactly this error means. javax.crypto.BadPaddingException:…
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…
xDantehh
  • 368
  • 4
  • 15
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
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
  • 215
  • 3
  • 9
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
  • 195
  • 2
  • 13
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
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
  • 42,340
  • 17
  • 131
  • 218
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
  • 115
  • 1
  • 3
  • 9
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
  • 345
  • 3
  • 12
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
  • 1,846
  • 17
  • 25
2
votes
1 answer

Why it is necessary to grant All Permission for java security manager in OSGi Security

I want to enable Java Security Manager in my server. But, by doing that, as stated in the question [1], it grants all permission to the OSGI bundles. When trying to enable Security for OSGi bundles, it is mentioned that to grant all permission from…
menaka_
  • 1,032
  • 1
  • 11
  • 20
2
votes
0 answers

Permission to allow JavaFX 8 windows to display always on top?

I have the Java Security Manager enabled on my application along with a custom security policy configured in the project directory. I am trying to display a JavaFX window always on top, however with the Security Manager enabled, I am unable to do…
Brandon
  • 341
  • 4
  • 7
  • 17
2
votes
0 answers

Spring fat jar boot throws class not found exception after installing security manager

I tried to use "java -jar " commandto boot the spring packaged fat jar after I installed my own security manager. It is just merely delegate all functions to its parent class. Then I can't start my application in command line, and it gives me the…
Landy Li
  • 21
  • 2
2
votes
0 answers

java SecurityManager denies explicitly allowed permissions on some systems

I am running an application with Drools in a WildFly 10.1.0-Final Application Server. As the code executed by Drools is untrusted, I decided to build a custom sandbox to allow for secure execution. Since no external modules may be added to the…
1
2 3 4