> Long term then it would be interesting to explore degrading and eventually dropping the security manager but that is beyond the scope of what I would like to discuss here.
That is a bold topic to immediately declare out of scope. I am looking for somewhere to reply, so I am forking this thread to a new subject to share my thoughts.
I am an engineer on the Elasticsearch team at Elastic. Elasticsearch is a popular server application implemented in Java that runs on the JVM. We run with the security manager enabled, and there is no option to disable it. We have two major motivations for using the security manger:
- as a server application, to reduce the scope of any exploits in the JDK, our code, or our third-party dependencies (e.g., prevent directory traversals, prevent RCE, etc.)
- we provide a plugin framework (e.g., to add scripting languages) and use the security manager to sandbox untrusted code
For additional background, please see the mail thread "SecurityManager environments" on jigsaw-dev.
>The bigger question is of course whether it is interesting to run with a security manager in 2017.
Of course it is. Java is often used to code servers[no citation needed]. The question should be: what can be done to make using the security manager easier for servers? When looking at the major exploits in the Java ecosystem in the last few years (e.g., the commons collections CVE that led to RCE in e.g., JBoss (among others), the Apache Struts CVE that played a role in the Equifax breach), every time my mind turns to: this would not be as large a problem if the server was using the security manager. The JDK needs to be a platform that enables developing secure server applications. Seeing this question raised without any explicit or implicit mention of this need is surprising.
> We have seen a few cases where applications set a security manager in order to enforce some policy, like preventing plugins calling System.exit but these are cases that would be better served with other solutions.
We do this, although we had to wrap the security manager in our own implementation because we still need to be able to exit on our own. However: an API to serve this use-case solely is not enough to meet our current needs from the security manager.
> A big challenge is the System.setSecurityManager API as allows a security manager to be set in a running VM.
We use the System#setSecurityManager API. I do not think our use-case is unreasonable: there are privileges that are required upfront, and then we drop them. I am okay with the run mode that you propose (as long as System#setSecurityManager in this run mode is not a no-op but a hard exception), I am not okay with dropping this API entirely (so do not deprecate the System#setSecurityManager API).
On Mon, Nov 20, 2017 at 9:48 AM Alan Bateman <[hidden email]> wrote:
On 23/11/2017 19:21, Jason Tedor wrote:
> > Long term then it would be interesting to explore degrading and
> eventually dropping the security manager but that is beyond the scope
> of what I would like to discuss here.
> That is a bold topic to immediately declare out of scope. I am looking
> for somewhere to reply, so I am forking this thread to a new subject
> to share my thoughts.
Starting a new thread is fine as it's beyond the scope of the topic that
I was looking to discuss. As I mentioned, Sean and Jeff are planning a
survey and that would be a good time to bring up use-cases and suggestions.
> The JDK needs to be a platform that enables developing secure server
> applications. Seeing this question raised without any explicit or
> implicit mention of this need is surprising.
Sorry, that's a bit unfair as there has been massive effort put into the
platform to support the development of secure applications. Security is
much more than the security manager.
|Free forum by Nabble||Edit this page|