Skip to content

feat(redisstore): support authenticated TLS Redis connections - #659

Merged
jhrozek merged 1 commit into
mainfrom
feat/redisstore-tls
Aug 20, 2026
Merged

jhrozek merged 1 commit into
mainfrom
feat/redisstore-tls

Conversation

@jhrozek

@jhrozek jhrozek commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Redis session-store/event-log connections now support CA-verified TLS and ACL credentials (username/password), read from mounted Secret files rather than flags or chart values. Delegates client construction, TLS assembly, and connectivity checks to the shared toolhive-core/redis layer (see ADR 0228, rewritten in this PR to describe the shipped contract directly rather than as a delta from a superseded draft).

Address-only Redis stays the explicit plaintext opt-in (--redis-allow-plaintext) for local/Kind fixtures; the production/default path never infers plaintext from an address alone.

Fixes #374

Stack

This is the base of a 4-PR stack:

  1. #this — redisstore TLS support (fixes Store hardening: auth, TLS and snapshot integrity #374)
  2. feat(mecak8s): add production Helm deployment baseline
  3. feat(mecak8s): add Dex Kind fixture
  4. feat(mecak8s): converge kustomize manifests into the Helm chart (fixes Create a set of task targets to deploy mecak8s to kind #634)

Test plan

  • go test ./internal/adapter/redisstore/...
  • go build ./...

@jhrozek
jhrozek force-pushed the feat/redisstore-tls branch 2 times, most recently from 32ec9eb to 4ff5bb9 Compare August 20, 2026 09:20
Redis connections gain ACL credentials and verified TLS, with all secret
values read from Kubernetes Secret-mounted files — never from flags,
environment variables, or errors. Client construction, TLS assembly,
timeout defaults, and the connectivity ping delegate to the shared
github.com/stacklok/toolhive-core/redis layer (already in the dependency
graph via authn/oidc; no new modules enter go.sum). See ADR 0233 (this PR
consolidates the original 0228/0229 draft pair into one accepted ADR).

BREAKING: an address-only --redis-url is now rejected at Build. Plaintext
Redis requires the explicit --redis-allow-plaintext opt-in, which the
disposable kustomize fixture in deploy/mecak8s/ now passes. Production
deployments use --redis-tls (system trust store) or --redis-tls-ca
(private CA); any credential requires one of them.

Also adds the same opt-in to e2e/k8s/oidc_helpers_test.go's
baseAgentArgs() — the kind e2e suite's OIDC-patch/-restore helper, which
replaces the Deployment's args wholesale. Found by actually running
`task e2e:k8s`: without it, every OIDC-patched or -restored pod
crash-loops on "redis store: redisstore: plaintext Redis requires
explicit opt-in" the moment this commit's fail-closed check lands, which
would otherwise silently break the (untouched) e2e suite for every PR
built on top of this one.

Client-certificate (mTLS) authentication is not supported, because the
shared layer exposes no client-certificate field. Tracked upstream at
stacklok/toolhive-core#240.

This is the authenticated, TLS Redis slice of #374; it does not implement
the snapshot-integrity MAC or event-log integrity work.

Co-Authored-By: mecatl <[email protected]>
@jhrozek
jhrozek merged commit 5243a20 into main Aug 20, 2026
16 checks passed
@jhrozek
jhrozek deleted the feat/redisstore-tls branch August 20, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a set of task targets to deploy mecak8s to kind Store hardening: auth, TLS and snapshot integrity

2 participants