Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

really ban exitVM with security policy #11982

Merged
merged 1 commit into from Jul 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/src/main/java/org/elasticsearch/bootstrap/Security.java
Expand Up @@ -57,7 +57,16 @@ static void configure(Environment environment) throws Exception {
Policy.setPolicy(new ESPolicy(createPermissions(environment)));

// enable security manager
System.setSecurityManager(new SecurityManager());
System.setSecurityManager(new SecurityManager() {
// we disable this completely, because its granted otherwise:
// 'Note: The "exitVM.*" permission is automatically granted to
// all code loaded from the application class path, thus enabling
// applications to terminate themselves.'
@Override
public void checkExit(int status) {
throw new SecurityException("exit(" + status + ") not allowed by system policy");
}
});

// do some basic tests
selfTest();
Expand Down