Skip to content

Commit 8504427

Browse files
tgrunnagleclaude
andauthored
Document category-based redis ACLs (#4946)
Update documentation around embedded authorization server redis configuration to use category-based ACLs. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d687eb7 commit 8504427

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

docs/redis-storage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,19 @@ Create a ConfigMap or init container to provision the ACL file. The ACL user nee
205205

206206
```
207207
# /data/users.acl
208-
user toolhive-auth on ><your-secure-password> ~thv:auth:* &* +GET +SET +SETNX +DEL +EXISTS +EXPIRE +PEXPIRE +PTTL +MGET +SADD +SREM +SMEMBERS +EVAL +MULTI +EXEC +EVALSHA +PING
208+
user toolhive-auth on ><your-secure-password> ~thv:auth:* &* +@read +@write +@keyspace +@scripting +@transaction +@connection
209209
```
210210

211211
This ACL entry:
212212
- `on` — Enables the user
213213
- `><your-secure-password>` — Sets the password
214214
- `~thv:auth:*` — Allows access to all keys with the `thv:auth:` prefix
215215
- `&*` — Allows access to all Pub/Sub channels; required by the go-redis Sentinel client to receive `+switch-master` failover notifications. In a multi-tenant Redis deployment, consider restricting this to specific channels if your Redis version supports it.
216-
- `+GET +SET +DEL ...` — Grants only the commands used by the ToolHive auth server
216+
- `+@read +@write +@keyspace +@scripting +@transaction +@connection` — Grants command categories used by the ToolHive auth server
217217

218-
> **Development / quick-start only:** You can replace the explicit command list with `+@all` to allow all commands, but this is not recommended for production environments.
218+
> **Development / quick-start only:** You can replace the category grants with `+@all` to allow all commands, but this is not recommended for production environments.
219219

220-
> **Security note:** The auth server uses `GET`, `SET`, `SETNX`, `DEL`, `EXISTS`, `EXPIRE`, `PEXPIRE`, `PTTL`, `MGET`, `SADD`, `SREM`, `SMEMBERS`, `EVAL`, `EVALSHA`, `MULTI`, `EXEC`, and `PING`. Restrict the ACL to this set to follow the principle of least privilege.
220+
> **Security note:** The auth server uses commands from the `@read`, `@write`, `@keyspace`, `@scripting`, `@transaction`, and `@connection` categories. These categories cover the specific commands the server needs (`GET`, `SET`, `DEL`, `EXPIRE`, `EVAL`, `MULTI`/`EXEC`, `PING`, etc.) while following the principle of least privilege at the category level.
221221

222222
### Step 4: Create the ToolHive Auth Config
223223

examples/operator/redis-storage/redis-credentials.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# External Secrets Operator, or Vault) instead of plaintext manifests.
77
#
88
# The corresponding Redis ACL entry should be:
9-
# user toolhive-auth on ><password> ~thv:auth:* &* +GET +SET +SETNX +DEL +EXISTS +EXPIRE +SADD +SREM +SMEMBERS +EVAL +MULTI +EXEC +EVALSHA +PING
9+
# user toolhive-auth on ><password> ~thv:auth:* &* +@read +@write +@keyspace +@scripting +@transaction +@connection
1010
# (see sentinel-service.yaml for the full ACL Secret that provisions this into Redis)
1111
apiVersion: v1
1212
kind: Secret

examples/operator/redis-storage/sentinel-service.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@
3333
# The ACL entry grants the toolhive-auth user access to:
3434
# ~thv:auth:* — keys with the ToolHive auth prefix
3535
# &* — all Pub/Sub channels (required for Sentinel failover notifications)
36-
# +GET +SET … — only the commands the auth server uses (principle of least privilege)
36+
# +@read +@write +@keyspace +@scripting +@transaction +@connection
37+
# — command categories the auth server uses (principle of least privilege)
3738
apiVersion: v1
3839
kind: Secret
3940
metadata:
4041
name: redis-acl
4142
namespace: redis
4243
type: Opaque
4344
stringData:
44-
users.acl: "user toolhive-auth on ><your-redis-password> ~thv:auth:* &* +GET +SET +SETNX +DEL +EXISTS +EXPIRE +PEXPIRE +PTTL +MGET +SADD +SREM +SMEMBERS +EVAL +MULTI +EXEC +EVALSHA +PING"
45+
users.acl: "user toolhive-auth on ><your-redis-password> ~thv:auth:* &* +@read +@write +@keyspace +@scripting +@transaction +@connection"
4546
---
4647
# Headless Service gives Redis pods stable, individually addressable DNS names:
4748
# redis-0.redis.redis.svc.cluster.local

0 commit comments

Comments
 (0)