Skip to content

Conversation

@ldematte
Copy link
Contributor

@ldematte ldematte commented Mar 14, 2025

The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921

@ldematte ldematte added auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 :Core/Infra/Entitlements Entitlements infrastructure labels Mar 14, 2025
@ldematte ldematte requested review from a team as code owners March 14, 2025 10:47
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Mar 14, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@ldematte
Copy link
Contributor Author

Should this be >breaking or >feature or >enhancement, and be the entitlements issue that has a changelog attached?

@rjernst
Copy link
Member

rjernst commented Mar 14, 2025

the entitlements issue that has a changelog attached

This one. It's not breaking b/c this isn't user API related, but we should have a changelog entry.

@ldematte
Copy link
Contributor Author

👍
what about >enhancement?

@mark-vieira
Copy link
Contributor

👍 what about >enhancement?

Perhaps "upgrade" since this is all centered around the move to Java 24? None of the release notes sections are a great fit for non-functional stuff like this. Perhaps we need an new label/section for these kinds of things. We have a >refactoring label but those aren't included in release notes.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM. >upgrade is fine. We just want to make sure this is noted in the release notes.

Comment on lines 3 to 4
With JDK24, the Java SecurityManager has been completely disabled. In order to retain an additional protection
mechanism, Elasticsearch is replacing SecurityManager with our own protection mechanism, Entitlements."
Copy link
Contributor

Choose a reason for hiding this comment

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

optional nit

Suggested change
With JDK24, the Java SecurityManager has been completely disabled. In order to retain an additional protection
mechanism, Elasticsearch is replacing SecurityManager with our own protection mechanism, Entitlements."
With JDK24, the Java SecurityManager has been completely disabled. In order to retain a similar protection
mechanism, Elasticsearch is replacing SecurityManager with its own protection mechanism, Entitlements."

Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering, this makes it sound a bit like entitlements are just a JDK 24 thing. Should we explicitly mention that this is the case for all versions of ES supporting JDK 24 regardless of which JDK version used at runtime?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe like this?

Suggested change
With JDK24, the Java SecurityManager has been completely disabled. In order to retain an additional protection
mechanism, Elasticsearch is replacing SecurityManager with our own protection mechanism, Entitlements."
With JDK24, the Java SecurityManager has been completely disabled. In order to retain a similar protection
mechanism, Elasticsearch is replacing SecurityManager with its own protection mechanism, Entitlements.
This is the case for all versions of Elasticsearch supporting JDK24 regardless of the JDK version used at runtime."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I rephrased it so the focus in not on JDK 24 anymore, and stating we are making the switch permanently. But let me know if you think I should still add "This is the case for all versions of Elasticsearch supporting JDK24 regardless of the JDK version used at runtime."

Copy link
Contributor

Choose a reason for hiding this comment

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

that's great 👍

Copy link
Contributor

@mosche mosche left a comment

Choose a reason for hiding this comment

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

lgtm

@ldematte ldematte merged commit dfbf7f0 into elastic:9.0 Mar 18, 2025
16 checks passed
@ldematte ldematte deleted the entitlements/always-enabled-minimal branch March 18, 2025 08:11
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.18 Commit could not be cherrypicked due to conflicts
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 124865

ldematte added a commit to ldematte/elasticsearch that referenced this pull request Mar 18, 2025
The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921
ldematte added a commit to ldematte/elasticsearch that referenced this pull request Mar 18, 2025
The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921
elasticsearchmachine pushed a commit that referenced this pull request Mar 18, 2025
…) (#125073)

* Permanently switch from SecurityManager to Entitlements (#124865)

The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921

* Update changelog
ldematte added a commit that referenced this pull request Mar 18, 2025
… (#125076)

* Permanently switch from SecurityManager to Entitlements (#124865)

The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921

* Update changelog
ldematte added a commit to ldematte/elasticsearch that referenced this pull request Mar 18, 2025
The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921
rjernst pushed a commit that referenced this pull request Mar 18, 2025
…25117)

The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921
smalyshev pushed a commit to smalyshev/elasticsearch that referenced this pull request Mar 21, 2025
…) (elastic#125117)

The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
…) (elastic#125117)

The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Core/Infra/Entitlements Entitlements infrastructure Team:Core/Infra Meta label for core/infra team >upgrade v8.18.1 v8.19.0 v9.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants