Files
cozystack/packages/apps/redis
Aleksei Sviridkin eedd08f6fc fix(redis): stop granting the tenant the server private key under TLS
The dashboard Role handed the tenant the release's leaf Secret whenever
tls.authClients was yes, on the reasoning that a client needing to
authenticate can reuse the server identity as its own. That Secret holds
tls.key, so any subject at the tenant's use level could read the private
key of the certificate Redis and Sentinel present and impersonate those
endpoints to every client that trusts the release CA.

Withhold it. The tenant keeps read access to the CA-only Secret, which is
what verifying the server actually requires and which carries no private
key at all.

This leaves authClients=optional and =yes without a client certificate a
tenant can obtain, since the CA private key needed to sign one is also
withheld by design. Document that limitation in README.md rather than
paper over it: in-cluster components are unaffected because the operator
mounts the leaf for them, but an external client has no supported path to
a certificate this CA accepts, so those two values are only usable when
the certificate is supplied out of band.

Also correct the neighbouring comment, which described the per-release CA
as trusted by the whole cluster. It is self-signed and scoped to one
release, and nothing outside that release trusts it.

Add the test target the package was missing. The TLS suite added with
this feature sat in tests/ with no way to invoke it, so CI had never run
any of it; the assertions covering this Role were passing only in
principle. All 24 now run, including the two that pin the leaf Secret as
withheld at both authClients values.

The authClients sentence also says to quote the value: an unquoted yes or
no in a manifest is read as a boolean and the string field rejects it.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-09-02 17:56:06 +03:00
..
2024-08-12 14:47:11 +02:00
2025-09-24 12:32:37 +02:00

Managed Redis Service

Redis is a highly versatile and blazing-fast in-memory data store and cache that can significantly boost the performance of your applications. Managed Redis Service offers a hassle-free solution for deploying and managing Redis clusters, ensuring that your data is always available and responsive.

Deployment Details

Service utilizes the freshworks-oss Redis Operator (a maintained fork of the archived Spotahome operator) for efficient management and orchestration of Redis clusters.

storageClass is annotated as immutable in the chart schema — see docs/storage-immutability.md for the contract and which consumers enforce it.

Parameters

Common parameters

Name Description Type Value
replicas Number of Redis replicas. int 2
resources Explicit CPU and memory configuration for each Redis replica. When omitted, the preset defined in resourcesPreset is applied. object {}
resources.cpu CPU available to each replica. quantity ""
resources.memory Memory (RAM) available to each replica. quantity ""
resourcesPreset Default sizing preset used when resources is omitted. string t1.nano
size Persistent Volume Claim size available for application data. quantity 1Gi
storageClass StorageClass used to store the data. string ""
external Enable external access from outside the cluster. bool false

TLS parameters

Name Description Type Value
tls TLS configuration. When omitted, TLS is enabled automatically when external is true. object {}
tls.enabled Enable TLS for Redis and Sentinel connections. When omitted, defaults to the value of external. Encryption is provided by the redis-operator fork that mounts the certificate Secret into both Redis and Sentinel pods at /tls. *bool null
tls.authClients Maps to the Redis tls-auth-clients directive. Defaults to no — the server certificate is presented but client certificates are not validated. yes requires a client certificate signed by this release's CA, which the platform does not issue. string {}
version Redis major version to deploy string v8

Application-specific parameters

Name Description Type Value
authEnabled Enable password generation. bool true

Parameter examples and reference

resources and resourcesPreset

resources sets explicit CPU and memory configurations for each replica. When left empty, the preset defined in resourcesPreset is applied.

resources:
  cpu: 4000m
  memory: 4Gi

resourcesPreset sets named CPU and memory configurations for each replica. This setting is ignored if the corresponding resources value is set.

Presets follow a cloud-style <series>.<size> naming convention. Five series cover the full CPU-to-memory ratio range (t1 1:0.5, c1 1:1, s1 1:2, u1 1:4, m1 1:8) and each series ships eight sizes (nano through 4xlarge). The legacy flat names (nano, micro, small, medium, large, xlarge, 2xlarge) remain accepted as deprecated aliases of their 1:1 instance-type equivalents.

See docs/operations/resource-presets.md for the full size matrix and the legacy-to-instance-type mapping.

tls

tls.enabled turns on TLS for Redis and Sentinel connections. When it is not set the value of external is used, so a Redis reachable from outside the cluster is encrypted by default.

Enabling TLS makes the chart issue a per-release cert-manager chain: a self-signed bootstrap Issuer, a CA certificate, a CA Issuer, and the server leaf certificate the operator mounts into the Redis and Sentinel pods. The CA belongs to this release alone; it is not a cluster-wide trust root, and nothing outside the release trusts it.

To verify the server, a client needs that CA certificate. The operator publishes it as the Secret <release>.ca-cert, which holds only ca.crt and no private key, and the release grants tenant read access to it:

kubectl get secret redis-<name>.ca-cert -o jsonpath='{.data.ca\.crt}' | base64 -d > ca.crt
redis-cli --tls --cacert ca.crt -h <host> -p 6379

Neither the CA private key (<release>.ca-tls) nor the server leaf and its private key (<release>.tls) is readable by the tenant. The first would allow minting certificates that any client trusting this release accepts; the second would allow impersonating this release's Redis endpoints.

tls.authClients maps to the Redis tls-auth-clients directive and defaults to no, meaning the server presents its certificate and does not ask connecting clients for one. Setting it to optional or yes makes Redis request, and for yes require, a client certificate signed by the same per-release CA. Quote the value in a manifest: an unquoted yes or no is read as a boolean and the string field rejects it.

Note that the platform does not currently mint a client certificate for the tenant, and the CA private key needed to sign one is deliberately out of reach. Redis and Sentinel pods and the metrics sidecar authenticate with the leaf certificate the operator mounts for them, so they are unaffected, but an external client has no supported way to obtain a certificate this CA will accept. Use authClients: yes only when the client certificate is supplied out of band by whoever also controls the CA.