Skip to content

Commit

Permalink
Add hot reload TLS certificate section #433 (#6875)
Browse files Browse the repository at this point in the history
* adding hot reload TLS certificate section #433

Signed-off-by: AntonEliatra <anton.rubin@eliatra.com>

* fixing issues on hot reload #433

Signed-off-by: AntonEliatra <anton.rubin@eliatra.com>

* Update tls.md

Signed-off-by: AntonEliatra <anton.rubin@eliatra.com>

* Apply suggestions from code review

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: AntonEliatra <anton.rubin@eliatra.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: AntonEliatra <anton.rubin@eliatra.com>

* Update tls.md

Signed-off-by: AntonEliatra <anton.rubin@eliatra.com>

---------

Signed-off-by: AntonEliatra <anton.rubin@eliatra.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
(cherry picked from commit fa38567)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 18, 2024
1 parent 28efa24 commit 80088f6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions _api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ This reference includes the REST APIs supported by OpenSearch. If a REST API is
- [Supported units]({{site.url}}{{site.baseurl}}/api-reference/units/)
- [Tasks]({{site.url}}{{site.baseurl}}/api-reference/tasks/)
- [Transforms API]({{site.url}}{{site.baseurl}}/im-plugin/index-transforms/transforms-apis/)
- [Hot reload TLS certificates]({{site.url}}{{site.baseurl}}/security/configuration/tls/#hot-reloading-tls-certificates)



40 changes: 40 additions & 0 deletions _security/configuration/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,43 @@ The default insecure SSL password settings have been deprecated. In order to use
* plugins.security.ssl.transport.truststore_password_secure

These settings allow for the use of encrypted passwords in the settings.

## Hot reloading TLS certificates

Updating expired or nearly expired TLS certificates does not require restarting the cluster. Instead, enable hot reloading of TLS cerificates by adding the following line to `opensearch.yml`:


`plugins.security.ssl_cert_reload_enabled: true`

This setting is `false` by default.
{: .note }

After enabling hot reloading, use the Reload Certificates API to replace the expired certificates. The API expects the old certificates to be replaced with valid certificates issued with the same `Issuer/Subject DN` and `SAN`. The new certificates also need be stored in the same location as the previous certificates in order to prevent any changes to the `opensearch.yml` file.

Only a [superadmin]({{site.url}}{{site.baseurl}}/security/configuration/tls/#configuring-admin-certificates) can use the Reload Certificates API.

Check failure on line 276 in _security/configuration/tls.md

View workflow job for this annotation

GitHub Actions / vale

[vale] _security/configuration/tls.md#L276

[OpenSearch.Spelling] Error: superadmin. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.
Raw output
{"message": "[OpenSearch.Spelling] Error: superadmin. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_security/configuration/tls.md", "range": {"start": {"line": 276, "column": 9}}}, "severity": "ERROR"}
{: .note }

### Reload TLS certificates on the transport layer
The following command reloads TLS certificates on the transport layer:

```json
curl --cacert <ca.pem> --cert <admin.pem> --key <admin.key> -XPUT https://localhost:9200/_plugins/_security/api/ssl/transport/reloadcerts
```
{% include copy.html %}

You should receive the following response:
```{ "message": "successfully updated transport certs"}```

### Reload TLS certificates on the http layer

Check failure on line 290 in _security/configuration/tls.md

View workflow job for this annotation

GitHub Actions / vale

[vale] _security/configuration/tls.md#L290

[OpenSearch.Spelling] Error: http. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.
Raw output
{"message": "[OpenSearch.Spelling] Error: http. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_security/configuration/tls.md", "range": {"start": {"line": 290, "column": 36}}}, "severity": "ERROR"}

The following command reloads TLS certificates on the `http` layer:

```json
curl --cacert <ca.pem> --cert <admin.pem> --key <admin.key> -XPUT https://localhost:9200/_plugins/_security/api/ssl/http/reloadcerts
```
{% include copy.html %}

You should receive the following response:

```{ "message": "successfully updated http certs"}```

0 comments on commit 80088f6

Please sign in to comment.