From d8d1f0d4f017a7ba20028c42aed2b63f363854b5 Mon Sep 17 00:00:00 2001 From: Tim Brooks Date: Thu, 8 Mar 2018 09:33:39 -0700 Subject: [PATCH] Give transport-nio plugin socket permissions (#28900) This is related to #27260. The transport-nio plugin needs socket permissions to operate as a transport. This commit gives it these permissions in the policy file. --- .../plugin-metadata/plugin-security.policy | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugins/transport-nio/src/main/plugin-metadata/plugin-security.policy diff --git a/plugins/transport-nio/src/main/plugin-metadata/plugin-security.policy b/plugins/transport-nio/src/main/plugin-metadata/plugin-security.policy new file mode 100644 index 00000000000..2dbe07bd8a5 --- /dev/null +++ b/plugins/transport-nio/src/main/plugin-metadata/plugin-security.policy @@ -0,0 +1,23 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +grant codeBase "${codebase.elasticsearch-nio}" { + // elasticsearch-nio makes and accepts socket connections + permission java.net.SocketPermission "*", "accept,connect"; +};