Skip to content

remote-clusters-privileges-cert.asciidoc - Clarification of user api key privileges #127172

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

Open
wants to merge 2 commits into
base: 8.18
Choose a base branch
from

Conversation

rseldner
Copy link
Contributor

Clarified the NOTEs about user API key behavior in TLS based trust and recommended API key trust model for stricter access control

Will create a corresponding PR for current (need to validate the syntax for other doc references)
https://github.com/elastic/docs-content/blob/main/deploy-manage/remote-clusters/remote-clusters-cert.md

Clarified **user** API key behavior in TLS based trust and recommended API key trust model for stricter access control
@rseldner rseldner added >docs General docs changes Team:Docs Meta label for docs team labels Apr 22, 2025
Copy link
Contributor

Documentation preview:

@elasticsearchmachine elasticsearchmachine added v8.18.1 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Apr 22, 2025
@elasticsearchmachine
Copy link
Collaborator

@rseldner please enable the option "Allow edits and access to secrets by maintainers" on your PR. For more information, see the documentation.

@rseldner rseldner marked this pull request as ready for review April 25, 2025 14:55
@rseldner rseldner requested a review from n1v0lg April 25, 2025 14:55
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

Comment on lines +36 to +37
NOTE: When using a user <<security-api-create-api-key, API key>>, the required privileges must be granted on the **local cluster** only. The remote cluster will authorize based on the privileges embedded in the API key; **it does not use roles**. As a result, an API key may have broader or more limited access than the same user’s current role on the remote cluster.
For stricter and more predictable access control, consider using the <<remote-clusters-api-key, cross-cluster API key trust model>>, which gives remote clusters full control over what data is accessible via cross-cluster operations. See <<remote-clusters-migration>>
Copy link
Contributor

@shainaraskas shainaraskas Apr 25, 2025

Choose a reason for hiding this comment

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

did a small copyedit

one thing that remains unclear to me is the role of the API key in this flow, given that it is discussing TLS cert authentication. perhaps we have a better link we can provide to explain how the API key is related?

Suggested change
NOTE: When using a user <<security-api-create-api-key, API key>>, the required privileges must be granted on the **local cluster** only. The remote cluster will authorize based on the privileges embedded in the API key; **it does not use roles**. As a result, an API key may have broader or more limited access than the same user’s current role on the remote cluster.
For stricter and more predictable access control, consider using the <<remote-clusters-api-key, cross-cluster API key trust model>>, which gives remote clusters full control over what data is accessible via cross-cluster operations. See <<remote-clusters-migration>>
[NOTE]
====
When using a user <<security-api-create-api-key, API key>>, the required privileges must be granted on the local cluster.
The remote cluster does not use roles, and instead authorizes the request based on the privileges embedded in the API key. As a result, an API key may have broader or more limited access than the same user’s current role on the remote cluster.
For stricter and more predictable access control, consider using the <<remote-clusters-api-key, cross-cluster API key trust model>>, which gives remote clusters full control over what data is accessible through cross-cluster operations. To learn how to migrate from TLS certificate authentication to API key authentication, refer to <<remote-clusters-migration>>.
====

Copy link
Contributor

@shainaraskas shainaraskas Apr 25, 2025

Choose a reason for hiding this comment

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

fyi this snippet appears in at least two places:

https://www.elastic.co/guide/en/elasticsearch/reference/8.18/_configure_privileges_for_cross_cluster_replication_2.html

https://www.elastic.co/guide/en/elasticsearch/reference/8.18/remote-clusters-cert.html#remote-clusters-privileges-ccr

as a result, we might want to pare back this note so it still makes sense in the context of the ccr-centric page

Copy link
Contributor Author

@rseldner rseldner May 1, 2025

Choose a reason for hiding this comment

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

one thing that remains unclear to me is the role of the API key in this flow, given that it is discussing TLS cert authentication. perhaps we have a better link we can provide to explain how the API key is related?

We were already making a note about the use of an API key with this trust model. I am building on that same note with more specifics.

The doc is about TLS based trust between remote clusters.
But the way the CCS/CCR requests are authorized are contingent on how those requests were authenticated (i.e. a request from someone using username/password is authorized differently than someone using an apikey)

I believe the same applies to both CCS and CCR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to leave the word "requests" in then if this is specifically about the user submitting the request after CCR/CCS is set up

Suggested change
NOTE: When using a user <<security-api-create-api-key, API key>>, the required privileges must be granted on the **local cluster** only. The remote cluster will authorize based on the privileges embedded in the API key; **it does not use roles**. As a result, an API key may have broader or more limited access than the same user’s current role on the remote cluster.
For stricter and more predictable access control, consider using the <<remote-clusters-api-key, cross-cluster API key trust model>>, which gives remote clusters full control over what data is accessible via cross-cluster operations. See <<remote-clusters-migration>>
[NOTE]
====
When a request to a remote cluster is authenticated using an <<security-api-create-api-key, API key>>, the required privileges must be granted on the local cluster.
The remote cluster does not use roles, and instead authorizes the request based on the privileges embedded in the API key. As a result, an API key may have broader or more limited access than the same user’s current role on the remote cluster.
For stricter and more predictable access control, consider using the <<remote-clusters-api-key, cross-cluster API key trust model>>, which gives remote clusters full control over what data is accessible through cross-cluster operations. To learn how to migrate from TLS certificate authentication to API key authentication, refer to <<remote-clusters-migration>>.
====

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Docs Meta label for docs team v8.18.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants