Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,14 @@ void jarHellCheck(PluginDescriptor candidateInfo, Path candidateDir, Path plugin
*/
private PluginDescriptor installPlugin(InstallablePlugin descriptor, Path tmpRoot, List<Path> deleteOnFailure) throws Exception {
final PluginDescriptor info = loadPluginInfo(tmpRoot);

Path legacyPolicyFile = tmpRoot.resolve(PluginDescriptor.ES_PLUGIN_POLICY);
if (Files.exists(legacyPolicyFile)) {
terminal.errorPrintln("WARNING: this plugin contains a legacy Security Policy file. Starting with version 8.18, " +
"Entitlements replace SecurityManager as the security mechanism. Plugins must migrate their policy files to the new " +
"format. For more information, please refer to " + PluginSecurity.ENTITLEMENTS_DESCRIPTION_URL);
}

if (RuntimeVersionFeature.isSecurityManagerAvailable()) {
PluginPolicyInfo pluginPolicy = PolicyUtil.getPluginPolicyInfo(tmpRoot, env.tmpDir());
if (pluginPolicy != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
*/
public class PluginSecurity {

public static final String ENTITLEMENTS_DESCRIPTION_URL =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicated in #125207, but should be easy to merge later

"https://www.elastic.co/guide/en/elasticsearch/plugins/current/creating-classic-plugins.html";

/**
* prints/confirms policy exceptions with the user
*/
Expand Down