Skip to content

Conversation

@jfreden
Copy link
Contributor

@jfreden jfreden commented Mar 21, 2025

This PR adds ClusterStateSecrets and ProjectSecrets (renamed to ClusterSecrets and ProjectSecrets).

The reason for moving these into core is to allow plugins to deserialize project and cluster secrets in cluster state as opposed to relying on reloadable plugin to do so. This enables features to read secrets from the same cluster state update as project creation.

@elasticsearchmachine elasticsearchmachine added serverless-linked Added by automation, don't add manually v9.1.0 labels Mar 21, 2025
@jfreden jfreden marked this pull request as ready for review March 24, 2025 09:54
@jfreden jfreden added the :Security/Security Security issues without another label label Mar 24, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Mar 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@jfreden jfreden requested a review from ywangd March 24, 2025 09:54
@elasticsearchmachine
Copy link
Collaborator

Hi @jfreden, I've created a changelog YAML for you.

@ywangd
Copy link
Member

ywangd commented Mar 25, 2025

I think this PR should be a non-issue since none of the classes is used in Stateful.

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

Unfortunately this won't work for repository plugins since they do not have access to x-pack code and I don't think we want make them depend on it either. The classes will have to be part of the server package for broader access.

Also, I personally think it's fine to move these classes between repos. But it would be great to get confirmation from @tvernum since it incurs license changes.

@jfreden jfreden requested a review from a team as a code owner March 25, 2025 13:01
@jfreden jfreden changed the title Make project and cluster secrets customs available in core Make project and cluster secrets customs available in server Mar 25, 2025
@jfreden
Copy link
Contributor Author

jfreden commented Mar 25, 2025

Good catch @ywangd ! I've moved them to server.

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

LGTM with one minor comment

Copy link
Member

Choose a reason for hiding this comment

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

There is also a ClusterStateSecretsMetadataTests file that can potentially be moved over as well.

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind. I just realized this is for a different class ClusterStateSecretsMetadata. It is a bit strange though that the secrets and the its metadata are now in separate repos.

Copy link
Member

Choose a reason for hiding this comment

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

I guess you didn't move ClusterStateSecretsMetadata because it is something only the managing service cares about. Also, if we migrate cluster secrets to be managed by file setting service, the metadata class is no longer necessary since file setting service manages its own set of metadata.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for raising this. Yes, that's what I was thinking. The reserved cluster state service will handle all that for us.

@jfreden jfreden merged commit acb1061 into elastic:main Mar 26, 2025
22 checks passed
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
…#125406)

* Make project and cluster secrets customs available in core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Security/Security Security issues without another label serverless-linked Added by automation, don't add manually Team:Security Meta label for security team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants