Skip to content

Commit 8ee37b0

Browse files
authored
Merge branch 'trunk' into docs/spice-cloud-monitoring-connect
2 parents f50ae9d + 118fcc6 commit 8ee37b0

2 files changed

Lines changed: 118 additions & 0 deletions

File tree

website/docs/api/tls/index.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,70 @@ When TLS is enabled in the runtime, the Spice CLI can be configured to connect t
118118
```bash
119119
spice sql --tls-root-certificate-file /path/to/root.pem
120120
```
121+
122+
## Mutual TLS (mTLS)
123+
124+
:::info Enterprise Feature
125+
mTLS (client certificate authentication) is included in the Enterprise distribution of Spice.ai. [Learn more](https://docs.spice.ai/docs/enterprise).
126+
:::
127+
128+
mTLS extends standard TLS by requiring the client to also present a certificate during the TLS handshake. This provides cryptographic authentication of both the server and the client.
129+
130+
### Enable mTLS via spicepod.yaml
131+
132+
Set `client_auth_mode` to `request` or `required` and provide a CA bundle to verify client certificates:
133+
134+
```yaml
135+
runtime:
136+
tls:
137+
enabled: true
138+
certificate_file: /path/to/server.crt
139+
key_file: /path/to/server.key
140+
client_auth_mode: required
141+
client_auth_ca_file: /path/to/client-ca.pem
142+
```
143+
144+
### Enable mTLS via command line
145+
146+
```bash
147+
spiced --tls-enabled true \
148+
--tls-certificate-file /path/to/server.crt \
149+
--tls-key-file /path/to/server.key \
150+
--tls-client-auth-mode required \
151+
--tls-client-auth-ca-file /path/to/client-ca.pem
152+
```
153+
154+
### Client auth modes
155+
156+
| Mode | Behavior |
157+
|------|----------|
158+
| `none` *(default)* | Standard one-way TLS. No client certificate is requested. |
159+
| `request` | The server requests a client certificate but accepts connections without one. Presented certificates are verified against the CA. Useful for migration or audit-only deployments. |
160+
| `required` | A valid client certificate is required. The Flight listener rejects no-cert connections at the TLS handshake. The HTTP listener admits no-cert connections so `/health` and `/v1/ready` remain accessible for Kubernetes probes, but all other HTTP endpoints return 401 without a verified client certificate. |
161+
162+
### Connecting with a client certificate
163+
164+
Use cURL with a client certificate:
165+
166+
```bash
167+
curl --cacert ca.pem --cert client.crt --key client.key \
168+
https://localhost:8090/v1/sql -d 'SELECT 1'
169+
```
170+
171+
Use the Spice CLI with a client certificate:
172+
173+
```bash
174+
spice sql --tls-root-certificate-file ./ca.pem \
175+
--client-tls-certificate-file ./client.crt \
176+
--client-tls-key-file ./client.key
177+
```
178+
179+
### Probe and metrics access
180+
181+
Kubernetes liveness/readiness probes (`/health`, `/v1/ready`) and the metrics endpoint (`/metrics`) are always accessible without a client certificate, even under `client_auth_mode: required`.
182+
183+
### Client CA hot-reload
184+
185+
When `client_auth_ca_file` is used, the CA bundle is watched for changes and reloaded atomically alongside the server certificate and key. When `client_auth_ca` (inline) is used, the CA is loaded once at startup.
186+
187+
For a complete walkthrough, see the [mTLS Cookbook recipe](https://github.com/spiceai/cookbook/tree/trunk/mtls).

website/docs/reference/spicepod/runtime.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,57 @@ runtime:
290290
key_file: /path/to/key.pem
291291
```
292292

293+
### `runtime.tls.client_auth_mode`
294+
295+
:::info Enterprise Feature
296+
mTLS (client certificate authentication) is included in the Enterprise distribution of Spice.ai. [Learn more](https://docs.spice.ai/docs/enterprise).
297+
:::
298+
299+
Controls whether the runtime requires, requests, or ignores client certificates on its public endpoints (HTTP, Flight, Metrics). Defaults to `none`.
300+
301+
| Mode | Behavior |
302+
|------|----------|
303+
| `none` *(default)* | Standard one-way TLS. No client certificate is requested. |
304+
| `request` | The server sends a `CertificateRequest` but accepts connections without a certificate. Presented certificates are verified against the configured CA. Useful for migration or audit-only deployments. |
305+
| `required` | A valid client certificate is required. The Flight (gRPC) listener rejects connections without a certificate at the TLS handshake. The HTTP listener admits no-cert connections so `/health` and `/v1/ready` remain accessible for Kubernetes probes, but all other HTTP endpoints return 401 without a verified client certificate. The metrics listener has no client-auth gate. |
306+
307+
Requires `client_auth_ca_file` or `client_auth_ca` to be set when mode is `request` or `required`.
308+
309+
```yaml
310+
runtime:
311+
tls:
312+
enabled: true
313+
certificate_file: /path/to/cert.pem
314+
key_file: /path/to/key.pem
315+
client_auth_mode: required
316+
client_auth_ca_file: /path/to/client-ca.pem
317+
```
318+
319+
### `runtime.tls.client_auth_ca_file`
320+
321+
Path to a PEM-encoded CA bundle used to verify client certificates. The file is watched for changes and reloaded atomically alongside the server certificate and key.
322+
323+
```yaml
324+
runtime:
325+
tls:
326+
...
327+
client_auth_ca_file: /path/to/client-ca.pem
328+
```
329+
330+
### `runtime.tls.client_auth_ca`
331+
332+
Inline PEM (or `${ secrets:... }`) form of the client CA bundle. Mutually exclusive with `client_auth_ca_file`. Inline material is loaded once at startup and is not hot-reloaded.
333+
334+
```yaml
335+
runtime:
336+
tls:
337+
...
338+
client_auth_ca: |
339+
-----BEGIN CERTIFICATE-----
340+
...
341+
-----END CERTIFICATE-----
342+
```
343+
293344
## `runtime.task_history`
294345

295346
The task history section specifies runtime task history configuration. For more details, see the [Task History documentation](../task_history).

0 commit comments

Comments
 (0)