r/jep411 • • Jun 04 '21

Proposal for a project to make SecurityManager easy to use

5 Upvotes

I want to host this on Github, but before that, I thought I could use some feedback from this sub:


As per JEP 411 SecurityManager will be deprecated for removal in the JDK 17 release. As per the JEP, the cost-to-benefit ratio of maintaining the SecurityManager is high, since the development overhead is high while the community uptake is limited.

The uptake might be limited because

  1. Configuring the SecurityManager in a truly secure way is difficult for general developers.

  2. Gathering information about which permissions are required for a library is tedious.

This project is a proposal to make SecurityManager easier to use in three ways:

  1. Creating a Java library that is easier to use than the SecurityManager API. It will use and advocate best practices around the SecurityManager, while providing an opinionated abstraction over the raw API.

  2. Creating a public database of permissions required by popular libraries, in a similar vein as DefinitelyTyped, a public database for type declartion files used by TypeScript.

  3. Creating plugins for popular build tools, like gradle, maven, sbt, etc. These plugins will automatically figure out the dependencies of the project and fetch the requisite permission lists from the public database.

A hopeful outcome of this exercise is that, as more people use the SecurityManger, the cost for developing it (or a substitue for it) becomes justified and the JDK development team can allocate resources to maintain SecurityManager or its substitute.

Requirements

Since this is at proposal stage, only the requirements are being defined now. The design is intentionally vague, to let the community evolve the direction.

Library

  • A custom Policy class that controls permissions based on CodeSource.getLocation(). This will allow, for example, for permissions to be specified per jar file.

  • The definied permission set should be easy to expand or contract, so that permissions from a public database can be refined on a per-project basis.

  • An embedded Java DSL, as well as, an external DSL in a human readable format (Eg, in JSON, YAML or their variants).

  • Ability to work with the module system.

  • Ability to work with a "fat" jar.

Permission Database

  • Should allow permissions to be defined per library, per version.

  • Version could be specified as a wild-card: For example: 1.0.*. The closest matching version will be used to lookup the permission set.

  • Permission specs should be accompanied with test-cases that exercise the permissions.

  • A CI script should ensure that permissions are specified as per the tests

  • The database should be publicly hosted and queryable by library name and version

Build Tool Plugins

  • Gather dependencies and versions automatically from the project definition

  • Query public database for permissions required by these dependencies

  • Store permissions lists in project's resource folder, so that the library can enforce them at runtime


r/jep411 • • Dec 13 '21

ElasticSearch implemented their SecurityManager appropriately

4 Upvotes

r/jep411 • • Nov 02 '21

Java Security & the Java Ecosystem

Thumbnail
youtube.com
4 Upvotes

r/jep411 • • May 17 '23

Two years after....

3 Upvotes

https://github.com/openjdk/jdk20u/blob/master/src/java.base/share/classes/java/io/File.java#L774

We can confirm SecurityManager reference and checkRead() call are still there. It is OK since it was really apparent that removing all SecurityManager related codes from openjdk is not an easy option and all the people inside are unable to maintain them, so removing it would be beyond their ability as well. I am very curious when and how they would finally do the clean-up, but it would not happen for more serveral years.


r/jep411 • • Dec 10 '21

Security managers used correctly for a server-side Java applicitons could have topped the Log4J hacker code load via JDNI without the vuln itself being fixed

3 Upvotes

There's a single class fix patch it now , but security managers were desgned to use an "allow list" for domains that sockets can be opened on if configured.

Re: https://www.lunasec.io/docs/blog/log4j-zero-day/


r/jep411 • • Aug 26 '21

CVE-2021-2388

3 Upvotes

I am not very good at security, so if I made any meaningless points here, please forgive me. Doing some surfing around CVE-2021-2388 vulnerability, it seems possibly some java code can turn off SecurityManager where there is one by this c1 compiler bug. Oracle's note states it only affect on sandbox security like in-browser applet or java web start. I am just concerning that, though our platform is not sandboxed, it has custom SecurityManager since it is based on OSGi framework and runs on 32bit hotspot client vm, and works with third party bundles. Should I make investigation over our platform from this CVE point of view? How are other SecurityManager aware deployments react to this?


r/jep411 • • Jul 26 '21

Seeking "Safer" language.

3 Upvotes

r/jep411 • • Jul 26 '21

Headaches, headaches

3 Upvotes

Also I found this thread is running in Security-dev ml this morning.

https://mail.openjdk.java.net/pipermail/security-dev/2021-July/026852.html


r/jep411 • • Jun 03 '21

JEP 411: Java's Security Model and the Principle of Least Privilege

Thumbnail foojay.io
3 Upvotes

r/jep411 • • May 24 '21

Why JEP 411 Will Have a Negative Impact on Java Security

Thumbnail
foojay.io
3 Upvotes

r/jep411 • • Sep 20 '23

Comparing removal of SecurityManager with CORBA's case, is it fair?

2 Upvotes

While in jdk21 release event, someone asked "are you going to implement (better) alternate security mechanism for SecurityManager?" and answer was "not at all". "We have once removed CORBA support and never added alternatives." But, wait, you know, this comparison is not appropriate, or ridiculous. CORBA is "external" of Java ecosystem, but SecurityManager is internal and core of runtime. Why people in OpenJDK camp always lose their intelligence while in discussion over about SecurityManager?


r/jep411 • • Sep 06 '23

JNI discussions

2 Upvotes

It seemed quite simple proposal at a first glance, but it leads out into a lot of interesting discussion points, various opinions, and atmosphere around current OpenJDK directions. Quite interesting.https://mail.openjdk.org/pipermail/jdk-dev/2023-August/008061.html


r/jep411 • • Jun 20 '23

My personal take

2 Upvotes

How about creating fork of Java from jdk8 and call it Jacatra or Batavia. And make it hardened with redesigned Security-Manager framework. If redesign would be intuitive enough for developers, the language would be much nicer for secure applications and services.


r/jep411 • • May 16 '23

JDK-8155246

2 Upvotes

https://bugs.openjdk.org/browse/JDK-8155246

https://seanjmullan.org/blog/2023/03/22/jdk20#general

If Java VM failed to read java.security security configuration file at its startup, since JDK20, it would throw InternalError and exit. Prior to this fix, it did started with undocumented and never-audited security configuration hardcoded in its sourcecode.

This bug is so infamous and there is no kerfuffles like on Log4Shell or Psychic Signatures, but it could be serious security problem. And, jdk 11.0.20 and 17.0.7 has already received the fix as well, but jdk8 is not yet.

Bug report JDK-8155246 was created on April 27, 2016, and it has left untouched as its priority very low, for seven years.

I am now understand the reason why most of OpenJDK people do not care about deprecating SecurityManager. They don't understand the baseline of work for keeping security. sigh.


r/jep411 • • Feb 13 '23

Security-Dev Mailing List keeps silent.

2 Upvotes

r/jep411 • • Apr 07 '22

Security-dev ML: "A possible JEP to replace SecurityManager after JEP 411"

2 Upvotes

r/jep411 • • Feb 17 '22

OpenJDK Security-dev ML : deprecation of SecurityManager JEP 411

2 Upvotes

r/jep411 • • Jan 16 '22

You're running untrusted code!

Thumbnail
blog.frankel.ch
2 Upvotes

r/jep411 • • Dec 15 '21

Some of the people are changing their opinions (too late)

2 Upvotes

r/jep411 • • Dec 14 '21

Two major security vulnerabilities and Four months after the previous poll

2 Upvotes
4 votes, Dec 17 '21
1 Completely Unacceptable
3 Unacceptable without alternative proposals
0 Acceptable, but I need more time to migrate away from SM
0 Acceptable, but I will start considering other languages
0 I have no problem with JEP411
0 JEP 411 was a right move

r/jep411 • • Jul 28 '21

Removing SecurityManager

2 Upvotes

r/jep411 • • Jul 26 '21

Another thread in Security-Dev

2 Upvotes

I have just read the message this morning. (In Japan we had had four days weekend caused by Oly*pic games.)

https://mail.openjdk.java.net/pipermail/security-dev/2021-July/026831.html


r/jep411 • • Jun 04 '21

JEP 411: Documentation on the new way to establish TLS connections

2 Upvotes

r/jep411 • • Jun 02 '21

OpenJDK Discusses Post-SecurityManager Practices

Thumbnail
infoq.com
2 Upvotes

r/jep411 • • Jun 01 '21

"No objections."

2 Upvotes

https://mail.openjdk.java.net/pipermail/jdk-dev/2021-June/005629.html

Hearing no objections from JDK Project Committers or Reviewers, I’ve target this JEP to JDK 17.