-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
java.io.FilePermission is no longer allowed for custom plug-in. #69464
Comments
Pinging @elastic/es-core-infra (Team:Core/Infra) |
@plebedev Thanks for the detailed report, and sorry for the situation. This is working as intended, at least in part. We are making plugins more restricted with system access to narrow the surface area they can affect if compromised.
Note that this will require wrapping access to the file in |
@rjernst - thanks for the comment. In our current implementation we do wrap the file access in I'm curious if it is possible to allow |
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 elastic#69464
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
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
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
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
@plebedev Thanks again for the report. I've restored the ability to grant FilePermission read from plugins for now. We will restrict this again in the future, as I described above, so I suggest you do switch to using a symlink, and then the FilePermission in your own policy can just disappear in the future when that change occurs. |
Thanks! |
Elasticsearch version (
bin/elasticsearch --version
):Version: 7.11.1, Build: default/tar/ff17057114c2199c9c1bbecc727003a907c0db7a/2021-02-15T13:44:09.394032Z, JVM: 11.0.6
Plugins installed: []
JVM version (
java -version
):java version "11.0.6" 2020-01-14 LTS
OS version (
uname -a
if on a Unix-like system):18.7.0 Darwin Kernel Version 18.7.0: Fri Oct 30 12:37:06 PDT 2020; root:xnu-4903.278.44.0.2~1/RELEASE_X86_64 x86_64
Description of the problem including expected versus actual behavior:
We manage our own ES cluster on k8s, and have developed a custom plug-in that needs to read a secret installed on a pod. For this we added the following to plugin-security.policy file:
With 7.10, this works as expected. However, the installation of the plugin fails with 7.11.1:
(see stack trace below).
Here is the full file:
In 7.11, the following file was added:
https://github.com/elastic/elasticsearch/blob/v7.11.0/server/src/main/java/org/elasticsearch/bootstrap/PolicyUtil.java
that explicitly list permissions allowed for plug-ins, and java.io.FilePermission is not part of it.
If I simply remove this grant I will get this error:
If this is a bug, this needs to be fixed. If this is an intended behavior, the documentation needs to be updated that this is a breaking change, and the appropriate alternative provided.
Steps to reproduce:
You can use https://github.com/elastic/elasticsearch/tree/v7.11.1/plugins/examples/painless-whitelist as a baseline, add plugin-security.policy file (as described https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugin-authors.html#plugin-authors-jsm) with the permission above and try to install on 7.11.1.
Provide logs (if relevant):
The text was updated successfully, but these errors were encountered: