Skip to content
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

[documentation] ES|QL over CCS with API key based security #108735

Open
jakelandis opened this issue May 16, 2024 · 3 comments
Open

[documentation] ES|QL over CCS with API key based security #108735

jakelandis opened this issue May 16, 2024 · 3 comments
Assignees
Labels
:Analytics/ES|QL AKA ESQL >enhancement :Security/Security Security issues without another label Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Security Meta label for security team

Comments

@jakelandis
Copy link
Contributor

Description

API key based CCS allows for more granular control for what is allowed between clusters. ES|QL over CCS with API key based CCS has some unique requirements for how to set up the role that need to be documented.

There should not be any changes needed for the remote cluster's cross cluster API key. However, if users setup an cross cluster API key in 8.14 (or before), they will need to create a new one, or update the existing one in 8.15 to pick up the new permissions needed for ES|QL with ENRICH. (we are looking into removing the need for the user to do this, but as-is this will be required to use ES|QL with ENRICH over API key based CCS in 8.15+)

The documentation should focus on the role/security requirements for the local cluster (the cluster that initiates the query request to the remote cluster).

ES|QL over CCS with API key based CCS is first introduced (tech preview) in 8.14. The ENRICH keyword is not supported until 8.15.

The role in 8.14 for the local cluster will need to look like this:

POST /_security/role/remote1
{
  "indices": [
    { 
      "names" : [""],
      "privileges": ["read"]
    }
  ], 
  "remote_indices": [
    {
      "names": [ "logs-*" ],
      "privileges": [ "read","read_cross_cluster" ],
      "clusters" : ["my_remote_cluster"]
    }
  ]
}

Of note, is the need for read_cross_cluster. This is always required for ES|QL over CCS with API key based CCS. non-ES|QL queries only sometimes requires read_cross_cluster (depending on minimize round trips). This could be something users trip over when migrating to the ES|QL based queiries.

Also, of note is the local indices block with the empty names. This is better described in #108734 and is needed in 8.14, but are looking for ways to avoid this. This is only needed for role that can ONLY search the remote cluster. Typically users will have local permission + remote permissions.

The role needed in 8.15 to support the ENRICH keyword will need to look like this:

POST /_security/role/remote1
{
  "cluster": ["cross_cluster_search"], 
  "indices": [
    { 
      "names" : [""],
      "privileges": ["read"]
    }
  ], 
  "remote_indices": [
    {
      "names": [ "logs-*" ],
      "privileges": [ "read","read_cross_cluster" ],
      "clusters" : ["my_remote_cluster"]
    }
  ],
   "remote_cluster": [
        {
            "privileges": [
                "monitor_enrich"
            ],
            "clusters": [
                "my_remote_cluster"
            ]
        }
    ]
} 

of note is the local "cluster": ["cross_cluster_search"], This is needed because local enrich is a cluster level privilege and this permission covers enrich too (and technically, enrich is happening both remote and locally). I would suggest to document that this is always needed, ir-respective of ENRICH (and can be documented as required in 8.14 too). The fact it is only needed when using the ENRICH keyword is a bit misnomer and we should always recommend to set this for now and future use cases.

also of note is the new remote_cluster, which is new in 8.15, and is not documented at all yet. We need both ES|QL and security focused documentation since this is a security feature, but only currently used for ES|QL. This is needed to allow remote enrichment. With out this, users can not read from the .enrich indices on the remote cluster.

cc: @dnhatn @quux00 @leemthompo

@jakelandis jakelandis added >enhancement :Security/Security Security issues without another label :Analytics/ES|QL AKA ESQL labels May 16, 2024
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Security Meta label for security team labels May 16, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@leemthompo
Copy link
Contributor

@jakelandis I'm going to attack this in two parts.

  1. 8.14 updates — [DOCS][ESQL][8.14] Add API key based security model info for ESQL CCS #109155
  2. 8.15 updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement :Security/Security Security issues without another label Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Security Meta label for security team
Projects
None yet
Development

No branches or pull requests

3 participants