Skip to content

Commit fe4d391

Browse files
committed
fixup! Code review comments
1 parent 967bd9d commit fe4d391

File tree

1 file changed

+82
-84
lines changed

1 file changed

+82
-84
lines changed

deploy-manage/remote-clusters/remote-clusters-api-key.md

Lines changed: 82 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ The local cluster must trust the remote cluster on the remote cluster interface.
2323
To add a remote cluster using API key authentication:
2424

2525
1. [Review the prerequisites](#remote-clusters-prerequisites-api-key)
26-
2. [Establish trust with a remote cluster](#remote-clusters-security-api-key)
27-
1. (Optional) [Configure remote cluster strong verification](#remote-cluster-strong-verification) for additional security
26+
2. [Establish trust with a remote cluster](#remote-clusters-security-api-key)
2827
3. [Connect to a remote cluster](#remote-clusters-connect-api-key)
29-
4. [Configure roles and users](#remote-clusters-privileges-api-key)
28+
4. (Optional) [Configure strong identity verification](#remote-cluster-strong-verification)
29+
5. [Configure roles and users](#remote-clusters-privileges-api-key)
3030

3131

3232
If you run into any issues, refer to [Troubleshooting](/troubleshoot/elasticsearch/remote-clusters.md).
@@ -340,6 +340,85 @@ cluster:
340340
3. The address for the proxy endpoint used to connect to `cluster_three`.
341341

342342

343+
## Strong identity verification [remote-cluster-strong-verification]
344+
```{applies_to}
345+
deployment:
346+
stack: preview 9.3
347+
```
348+
349+
Cross-cluster API keys can be configured with strong identity verification to provide an additional layer of security. To enable this feature, a
350+
cross-cluster API key is created on the remote cluster with a certificate identity pattern that specifies which certificates are allowed
351+
to use it. The local cluster must then sign each request with its private key and include a certificate whose subject Distinguished Name
352+
(DN) matches the pattern. The remote cluster validates both that the certificate is trusted by its configured certificate authorities
353+
and that the certificate's subject matches the API key's identity pattern.
354+
355+
Each remote cluster alias on the local cluster can have different remote signing configurations.
356+
357+
### How strong identity verification works [_how_strong_verification_works]
358+
359+
When a local cluster makes a request to a remote cluster using a cross-cluster API key:
360+
361+
1. The local cluster signs the request headers with its configured private key and sends the signature and certificate chain as header
362+
in the request to the remote cluster.
363+
2. The remote cluster verifies that the API key is valid.
364+
3. If the API key has a certificate identity pattern configured, the remote cluster extracts the Distinguished Name (DN) from the
365+
certificate chain's leaf certificate and matches it against the certificate identity pattern.
366+
4. The remote cluster validates that the provided certificate chain is trusted.
367+
5. The remote cluster validates the signature and checks that the certificate is not expired.
368+
369+
If any of these validation steps fail, the request is rejected.
370+
371+
### Configure strong identity verification [_configure_strong_verification]
372+
373+
To use strong identity verification, the local and remote clusters must be configured to sign request headers and to verify request
374+
headers. This can be done through the cluster settings API or `elasticsearch.yaml`.
375+
376+
#### On the local cluster [_certificate_identity_local_cluster]
377+
378+
When [adding the remote cluster](#using-the-es-api) to the local cluster, you must configure it to sign cross-cluster requests with a certificate–private key pair. You can generate a signing certificate using [elasticsearch-certutil](#remote-clusters-security-api-key-remote-action) or use an existing certificate. The private key can be encrypted and the password must be stored securely as a secure setting in Elasticsearch keystore. Refer to the [remote cluster settings reference](elasticsearch://reference/elasticsearch/configuration-reference/remote-clusters.md#remote-cluster-signing-settings) for details.
379+
380+
```yaml
381+
cluster.remote.my_remote_cluster.signing.certificate: "path/to/signing/certificate.crt"
382+
cluster.remote.my_remote_cluster.signing.key: "path/to/signing/key.key"
383+
```
384+
385+
::::{note}
386+
Replace `my_remote_cluster` with your remote cluster alias, and the paths with the paths to your certificate and key files.
387+
::::
388+
389+
#### On the remote cluster [_certificate_identity_remote_cluster]
390+
391+
The remote cluster must be configured with a certificate authority that trusts the certificate that was used to sign the request headers.
392+
393+
```yaml
394+
cluster.remote.signing.certificate_authorities: "path/to/signing/certificate_authorities.crt"
395+
```
396+
397+
When creating a cross-cluster API key on the remote cluster, specify a `certificate_identity` pattern that matches the Distinguished
398+
Name (DN) of the local cluster's certificate. Use the [Create Cross-Cluster API key](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-cross-cluster-api-key) API:
399+
400+
```console
401+
POST /_security/cross_cluster/api_key
402+
{
403+
"name": "my-cross-cluster-api-key",
404+
"access": {
405+
"search": [
406+
{
407+
"names": ["logs-*"]
408+
}
409+
]
410+
},
411+
"certificate_identity": "CN=local-cluster.example.com,O=Example Corp,C=US"
412+
}
413+
```
414+
415+
The `certificate_identity` field supports regular expressions. For example:
416+
417+
* `"CN=.*.example.com,O=Example Corp,C=US"` matches any certificate with a CN ending in "example.com"
418+
* `"CN=local-cluster.*,O=Example Corp,C=US"` matches any certificate with a CN starting with "local-cluster"
419+
* `"CN=.*"` matches any certificate (not recommended for production)
420+
421+
For a full list of available strong identity verification settings for remote clusters, refer to the [remote cluster settings reference](elasticsearch://reference/elasticsearch/configuration-reference/remote-clusters.md#remote-cluster-signing-settings).
343422

344423

345424
## Configure roles and users [remote-clusters-privileges-api-key]
@@ -426,84 +505,3 @@ POST /_security/user/cross-search-user
426505
```
427506

428507
Note that you only need to create this user on the local cluster.
429-
430-
431-
## Remote cluster strong verification [remote-cluster-strong-verification]
432-
```{applies_to}
433-
deployment:
434-
stack: preview 9.3
435-
```
436-
437-
Cross-cluster API keys can be configured with strong verification to provide an additional layer of security. To enable this feature, a
438-
cross-cluster API key is created on the remote cluster with a certificate identity pattern that specifies which certificates are allowed
439-
to use it. The local cluster must then sign each request with its private key and include a certificate whose subject Distinguished Name
440-
(DN) matches the pattern. The remote cluster validates both that the certificate is trusted by its configured certificate authorities
441-
and that the certificate's subject matches the API key's identity pattern.
442-
443-
Each remote cluster alias on the local cluster can have different remote signing configurations.
444-
445-
### How strong verification works [_how_strong_verification_works]
446-
447-
When a local cluster makes a request to a remote cluster using a cross-cluster API key:
448-
449-
1. The local cluster signs the request headers with its configured private key and sends the signature and certificate chain as header
450-
in the request to the remote cluster.
451-
2. The remote cluster verifies that the API key is valid.
452-
3. If the API key has a certificate identity pattern configured, the remote cluster extracts the Distinguished Name (DN) from the
453-
certificate chain's leaf certificate and matches it against the certificate identity pattern.
454-
4. The remote cluster validates that the provided certificate chain is trusted.
455-
5. The remote cluster validates the signature and checks that the certificate is not expired.
456-
457-
If any of these validation steps fail, the request is rejected.
458-
459-
### Configure strong verification [_configure_strong_verification]
460-
461-
To use certificate identity validation, the local and remote clusters must be configured to sign request headers and to verify request
462-
headers.
463-
464-
#### On the local cluster [_certificate_identity_local_cluster]
465-
466-
When [adding the remote cluster](#using-the-es-api) to the local cluster, you must configure it to sign cross-cluster requests with a certificate–private key pair. You can generate a signing certificate using [elasticsearch-certutil](#remote-clusters-security-api-key-remote-action) or use an existing certificate.
467-
468-
```yaml
469-
cluster.remote.my_remote_cluster.signing.certificate: "path/to/signing/certificate.crt"
470-
cluster.remote.my_remote_cluster.signing.key: "path/to/signing/key.key"
471-
```
472-
473-
::::{note}
474-
Replace `my_remote_cluster` with your remote cluster alias, and the paths with the paths to your certificate and key files.
475-
::::
476-
477-
#### On the remote cluster [_certificate_identity_remote_cluster]
478-
479-
The remote cluster must be configured with a certificate authority that trusts the certificate that was used to sign the request headers.
480-
481-
```yaml
482-
cluster.remote.signing.certificate_authorities: "path/to/signing/certificate_authorities.crt"
483-
```
484-
485-
When creating a cross-cluster API key on the remote cluster, specify a `certificate_identity` pattern that matches the Distinguished
486-
Name (DN) of the local cluster's certificate. Use the [Create Cross-Cluster API key](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-cross-cluster-api-key) API:
487-
488-
```console
489-
POST /_security/cross_cluster/api_key
490-
{
491-
"name": "my-cross-cluster-api-key",
492-
"access": {
493-
"search": [
494-
{
495-
"names": ["logs-*"]
496-
}
497-
]
498-
},
499-
"certificate_identity": "CN=local-cluster.example.com,O=Example Corp,C=US"
500-
}
501-
```
502-
503-
The `certificate_identity` field supports regular expressions. For example:
504-
505-
* `"CN=.*.example.com,O=Example Corp,C=US"` matches any certificate with a CN ending in "example.com"
506-
* `"CN=local-cluster.*,O=Example Corp,C=US"` matches any certificate with a CN starting with "local-cluster"
507-
* `"CN=.*"` matches any certificate (not recommended for production)
508-
509-
For a full list of available strong verification settings for remote clusters, refer to the [remote cluster settings reference](elasticsearch://reference/elasticsearch/configuration-reference/remote-clusters.md#remote-cluster-signing-settings).

0 commit comments

Comments
 (0)