Skip to content

Commit 6bd199a

Browse files
committed
DOC-4692 RS: Copied certificate-based authentication to 7.8 version
1 parent e604e1d commit 6bd199a

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
Title: Certificate-based authentication
3+
alwaysopen: false
4+
categories:
5+
- docs
6+
- operate
7+
- rs
8+
description: Certificate-based authentication allows secure, passwordless access to the REST API and databases.
9+
linkTitle: Certificate-based authentication
10+
weight: 70
11+
url: '/operate/rs/7.8/security/certificates/certificate-based-authentication/'
12+
---
13+
14+
You can set up certificate-based authentication for specific users to enable secure, passwordless access to the Redis Enterprise Software [REST API]({{<relref "/operate/rs/references/rest-api">}}) and databases.
15+
16+
## Set up certificate-based authentication
17+
18+
To set up certificate-based authentication:
19+
20+
1. [Add the `mtls_trusted_ca` certificate.](#add-cert)
21+
22+
1. [Configure cluster settings.](#config-cluster)
23+
24+
1. If you want to enable certificate-based authentication for databases, you must [enable mutual TLS for the relevant databases](#enable-mtls-dbs). Otherwise, you can skip this step.
25+
26+
1. [Create certificate auth_method users.](#create-cert-users)
27+
28+
### Add mtls_trusted_ca certificate {#add-cert}
29+
30+
Add a trusted CA certificate `mtls_trusted_ca` to the cluster using an [update cluster certificate]({{<relref "/operate/rs/references/rest-api/requests/cluster/certificates#put-cluster-update_cert">}}) request:
31+
32+
```sh
33+
PUT /v1/cluster/update_cert
34+
{
35+
"name": "mtls_trusted_ca",
36+
"certificate": "<content of certificate PEM file>"
37+
}
38+
```
39+
40+
### Configure cluster settings {#config-cluster}
41+
42+
[Update cluster settings]({{<relref "/operate/rs/references/rest-api/requests/cluster#put-cluster">}}) with mutual TLS configuration.
43+
44+
For certificate validation by Subject Alternative Name (SAN), use:
45+
46+
```sh
47+
PUT /v1/cluster
48+
{
49+
"mtls_certificate_authentication": true,
50+
"mtls_client_cert_subject_validation_type": "san_cn",
51+
"mtls_authorized_subjects": [{
52+
"CN": "<Common Name>"
53+
}]
54+
}
55+
```
56+
57+
For certificate validation by full Subject Name, use:
58+
59+
```sh
60+
PUT /v1/cluster
61+
{
62+
"mtls_certificate_authentication": true,
63+
"mtls_client_cert_subject_validation_type": "full_subject",
64+
"mtls_authorized_subjects": [{
65+
"CN": "<Common Name>",
66+
"OU": [<array of Organizational Unit strings>],
67+
"O": "<Organization>",
68+
"C": "<2-letter country code>",
69+
"L": "<Locality (city)>",
70+
"ST": "<State/Province>"
71+
}]
72+
}
73+
```
74+
75+
Replace the placeholder values `<>` with your client certificate's subject values.
76+
77+
### Enable mutual TLS for databases {#enable-mtls-dbs}
78+
79+
Before you can connect to a database using certificate-based authentication, you must enable mutual TLS (mTLS). See [Enable TLS]({{<relref "/operate/rs/security/encryption/tls/enable-tls">}}) for detailed instructions.
80+
81+
### Create certificate auth_method users {#create-cert-users}
82+
83+
When you [create new users]({{<relref "/operate/rs/references/rest-api/requests/users#post-user">}}), include `"auth_method": "certificate"` and `certificate_subject_line` in the request body :
84+
85+
```sh
86+
POST /v1/users
87+
{
88+
"auth_method": "certificate",
89+
"certificate_subject_line": "CN=<Common Name>, OU=<Organization Unit>, O=<Organization>, L=<Locality>, ST=<State/Province>, C=<Country>"
90+
}
91+
```
92+
93+
Replace the placeholder values `<>` with your client certificate's subject values.
94+
95+
## Authenticate REST API requests
96+
97+
To use the REST API with certificate-based authentication, you must provide a client certificate, signed by the trusted CA `mtls_trusted_ca`, and a private key.
98+
99+
The following example uses [cURL](https://curl.se/) to send a [REST API request]({{<relref "/operate/rs/references/rest-api/requests">}}):
100+
101+
```sh
102+
curl --request <METHOD> --url https://<hostname-or-IP-address>:9443/<API-version>/<API-path> --cert client.pem --key client.key
103+
```
104+
105+
## Authenticate database connections
106+
107+
To connect to a database with certificate-based authentication, you must provide a client certificate, signed by the trusted CA `mtls_trusted_ca`, and a private key.
108+
109+
The following example shows how to connect to a Redis database with [`redis-cli`]({{<relref "/operate/rs/references/cli-utilities/redis-cli">}}):
110+
111+
```sh
112+
redis-cli -h <hostname-or-IP-address> -p <port> --tls --cacert <redis_cert>.pem --cert redis_user.crt --key redis_user_private.key
113+
```
114+
115+
## Limitations
116+
117+
- Certificate-based authentication is not implemented for the Cluster Manager UI.

0 commit comments

Comments
 (0)