java-security-manager

How to run Apache Sling with an enabled SecurityManager?

家住魔仙堡 提交于 2021-01-29 21:47:31
问题 Did anybody run Apache Sling with an enabled Java SecurityManager? That'd need a special java.policy file to allow the actions done by all deployed bundles, and it'd be extremely helpful to have a basic version that already allows what's needed by the bundles provided with the basic Sling Starter, and to which one could add policies for additional deployed code. I'd also be interested if someone can tell that employing the SecurityManager is infeasible in a Sling setting, perhaps due to its

How to run Apache Sling with an enabled SecurityManager?

一世执手 提交于 2021-01-29 20:12:49
问题 Did anybody run Apache Sling with an enabled Java SecurityManager? That'd need a special java.policy file to allow the actions done by all deployed bundles, and it'd be extremely helpful to have a basic version that already allows what's needed by the bundles provided with the basic Sling Starter, and to which one could add policies for additional deployed code. I'd also be interested if someone can tell that employing the SecurityManager is infeasible in a Sling setting, perhaps due to its

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

倖福魔咒の 提交于 2020-07-03 03:42:08
问题 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 possible out of the box, is there a reasonable pattern for implementing a custom security check using System.setOut() / System.setErr() ? 来源: https://stackoverflow.com/questions/62584518/is-it-possible-to-use-securitymanager-to-control-which

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

与世无争的帅哥 提交于 2020-07-03 03:41:09
问题 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 possible out of the box, is there a reasonable pattern for implementing a custom security check using System.setOut() / System.setErr() ? 来源: https://stackoverflow.com/questions/62584518/is-it-possible-to-use-securitymanager-to-control-which

JVM Security Manager File permissions - custom policy

我是研究僧i 提交于 2020-01-02 10:15:12
问题 I've found a somehow unexpected behaviour using JVM Security Manager custom policies. repo: https://github.com/pedrorijo91/jvm-sec-manager in branch master, go into the /code folder: custom policy file grants File read permission for file ../allow/allow.txt no permission for the file ../deny/deny.txt the code in the HelloWorld.java tries to read both files There's a run.sh script to run the command Now everything works as expected: the allowed file reads, but the other throws a security

Block some permissions and grant other permissions in java security policy

会有一股神秘感。 提交于 2019-12-11 16:48:45
问题 I want to implement a security policy file in the following way :- Restrict access to all files except for files in 3 directories, i.e. if code accesses files from these 3 directories, it should be allowed but file access for any other directory is restricted. Grant all other permissions to the code base. How can I proceed for creating policy file for this requirement. 回答1: You need to create next policy file (yourPolicy.policy): grant codeBase "file:/location_of_your_code/-" { permission

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

浪子不回头ぞ 提交于 2019-12-10 10:12:52
问题 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 security manager and override checkExit(int status) to make sure the reason for the stop is not something calling System.exit() . Basically I wrote this: System.setSecurityManager(new SecurityManager() { @Override public void checkExit(int status) {

JVM Security Manager File permissions - custom policy

£可爱£侵袭症+ 提交于 2019-12-06 14:27:26
I've found a somehow unexpected behaviour using JVM Security Manager custom policies. repo: https://github.com/pedrorijo91/jvm-sec-manager in branch master, go into the /code folder: custom policy file grants File read permission for file ../allow/allow.txt no permission for the file ../deny/deny.txt the code in the HelloWorld.java tries to read both files There's a run.sh script to run the command Now everything works as expected: the allowed file reads, but the other throws a security exception: java.security.AccessControlException: access denied ("java.io.FilePermission" "../deny/deny.txt"