Skip to content

Commit

Permalink
Allow file read permissions in plugins (#69643)
Browse files Browse the repository at this point in the history
This commit adds back allowing FilePermission for reading files in
plugins. This is a temporary measure until plugins are automatically
granted read permissions for files within their own configuration
directory.

closes #69464
  • Loading branch information
rjernst committed Feb 27, 2021
1 parent 45d211a commit 8851e61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ void assertIllegalPermissions(List<String> illegalPermissions, PolicyParser pars
}

static final List<String> PLUGIN_TEST_PERMISSIONS = org.elasticsearch.common.collect.List.of(
// TODO: move this back to module test permissions, see https://github.com/elastic/elasticsearch/issues/69464
"java.io.FilePermission /foo/bar read",

"java.lang.reflect.ReflectPermission suppressAccessChecks",
"java.lang.RuntimePermission createClassLoader",
"java.lang.RuntimePermission getClassLoader",
Expand Down Expand Up @@ -274,7 +277,6 @@ public void testPrivateCredentialPermissionAllowed() throws Exception {
}

static final List<String> MODULE_TEST_PERMISSIONS = org.elasticsearch.common.collect.List.of(
"java.io.FilePermission /foo/bar read",
"java.io.FilePermission /foo/bar write",
"java.lang.RuntimePermission getFileStoreAttributes",
"java.lang.RuntimePermission accessUserInformation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public boolean test(Permission permission) {
private static final PermissionMatcher ALLOWED_MODULE_PERMISSIONS;
static {
List<Permission> namedPermissions = org.elasticsearch.common.collect.List.of(
// TODO: remove read permission, see https://github.com/elastic/elasticsearch/issues/69464
createFilePermission("<<ALL FILES>>", "read"),

new ReflectPermission("suppressAccessChecks"),
new RuntimePermission("createClassLoader"),
new RuntimePermission("getClassLoader"),
Expand Down

0 comments on commit 8851e61

Please sign in to comment.