You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a Cozy administrator or as a user, I would like to enable TLS configuration on the databases application when I deploy them.
Certificate should be handled via cert-manager or manually.
Hey,
issue is still valid, would be nice to have parameters to configure TLS directly in DBaaS, which is something already supported by official helm charts / operator :)
Timofei Larkin (@lllamnyp) The user confirms the issue is still valid and requests parameters to configure TLS directly in DBaaS, similar to what's supported by official helm charts/operator. Could you please assist with this?
I've been analyzing the codebase to understand how TLS could be added across all DBaaS services. Here's a detailed implementation plan based on existing patterns (notably the cert-manager setup in packages/system/cozystack-api/templates/certmanager.yaml).
I'd love to get feedback from maintainers before starting any PRs.
Phase 0: Shared helper in cozy-lib
New file: packages/library/cozy-lib/templates/_tls.tpl
A reusable Helm template cozy-lib.tls.certchain that generates 4 cert-manager resources (SelfSigned Issuer → CA Certificate → CA Issuer → Leaf Certificate) from parameters:
Add ca.crt to -credentials secret for client verification
packages/system/postgres-rd/cozyrds/postgres.yaml
Add postgres-{{ .name }}-ca to secrets.include + tls to openAPISchema
CNPG automatically enables ssl = on when serverTLSSecret and serverCASecret are set. Non-TLS clients can still connect (default mode prefer), ensuring backward compatibility.
# Conditional addition in CNPG Cluster spec{{- if .Values.tls.enabled }}certificates:
serverTLSSecret: {{ .Release.Name }}-server-certserverCASecret: {{ .Release.Name }}-ca{{- end }}
Phase 2: MariaDB
Operator: mariadb-operator — native TLS support via spec.tls
File
Change
packages/apps/mariadb/values.yaml
Add tls.enabled: true
packages/apps/mariadb/templates/certmanager.yaml
New — cozy-lib.tls.certchain with SANs: {name}, {name}-primary, {name}-secondary, *.{ns}.svc
Happy to start with a PR for Phase 0 + Phase 1 (cozy-lib helper + PostgreSQL) as a proof of concept. Would appreciate feedback on the overall approach before diving in!
Activity
dosubot commentedon Oct 17, 2025
Hi, mattia-eleuteri. I'm Dosu, and I'm helping the CozyStack team manage their backlog and am marking this issue as stale.
Issue Summary
Next Steps
Thank you for your understanding and contribution!
mattiae commentedon Oct 18, 2025
Hey,
issue is still valid, would be nice to have parameters to configure TLS directly in DBaaS, which is something already supported by official helm charts / operator :)
dosubot commentedon Oct 18, 2025
Timofei Larkin (@lllamnyp) The user confirms the issue is still valid and requests parameters to configure TLS directly in DBaaS, similar to what's supported by official helm charts/operator. Could you please assist with this?
kvaps commentedon Oct 20, 2025
This is still in our roadmap
[linstor] Build linstor-server with custom patches (#1726)
[linstor] Build linstor-server with custom patches (#1726)
[linstor] Build linstor-server with custom patches (#1726)
[linstor] Build linstor-server with custom patches (#1726)
mattia-eleuteri commentedon Feb 23, 2026
TLS for DBaaS Services — Implementation Plan
I've been analyzing the codebase to understand how TLS could be added across all DBaaS services. Here's a detailed implementation plan based on existing patterns (notably the cert-manager setup in
packages/system/cozystack-api/templates/certmanager.yaml).I'd love to get feedback from maintainers before starting any PRs.
Phase 0: Shared helper in cozy-lib
New file:
packages/library/cozy-lib/templates/_tls.tplA reusable Helm template
cozy-lib.tls.certchainthat generates 4 cert-manager resources (SelfSigned Issuer → CA Certificate → CA Issuer → Leaf Certificate) from parameters:releaseName,releaseNamespacednsNames(list of SANs)Usage in each chart:
{{- include "cozy-lib.tls.certchain" (dict "releaseName" .Release.Name "releaseNamespace" .Release.Namespace "dnsNames" (list ...)) }}Generated resources:
Issuer:{releaseName}-selfsigned(selfSigned)Certificate:{releaseName}-ca(isCA: true, secret:{releaseName}-ca)Issuer:{releaseName}-ca-issuer(ca, secretName:{releaseName}-ca)Certificate:{releaseName}-server-cert(leaf, secret:{releaseName}-server-cert)Reference pattern:
packages/system/cozystack-api/templates/certmanager.yamlPhase 1: PostgreSQL (pilot)
Operator: CloudNative-PG (CNPG) — native TLS support via
spec.certificatespackages/apps/postgres/values.yamltls.enabled: true(default)packages/apps/postgres/templates/certmanager.yamlcozy-lib.tls.certchainwith SANs:{name}-r,{name}-ro,{name}-rw,{name}-rw.{ns}.svc,*.{ns}.svc.cluster.localpackages/apps/postgres/templates/db.yamlspec.certificatesblock referencing cert-manager secretspackages/apps/postgres/templates/init-script.yamlca.crtto-credentialssecret for client verificationpackages/system/postgres-rd/cozyrds/postgres.yamlpostgres-{{ .name }}-catosecrets.include+tlstoopenAPISchemaCNPG automatically enables
ssl = onwhenserverTLSSecretandserverCASecretare set. Non-TLS clients can still connect (default modeprefer), ensuring backward compatibility.Phase 2: MariaDB
Operator: mariadb-operator — native TLS support via
spec.tlspackages/apps/mariadb/values.yamltls.enabled: truepackages/apps/mariadb/templates/certmanager.yamlcozy-lib.tls.certchainwith SANs:{name},{name}-primary,{name}-secondary,*.{ns}.svcpackages/apps/mariadb/templates/mariadb.yamlspec.tls.enabled: true+spec.tls.serverSecretRef+spec.tls.caSecretRefpackages/system/mariadb-rd/cozyrds/mariadb.yamlmariadb-{{ .name }}-catosecrets.include+tlsto schemaMariaDB accepts non-TLS connections by default unless
require_secure_transportis forced.Phase 3: Redis (higher complexity)
Operator: Spotahome redis-failover — TLS via
customConfig+ volume mountspackages/apps/redis/values.yamltls.enabled: truepackages/apps/redis/templates/certmanager.yamlcozy-lib.tls.certchainwith SANs for redis and sentinelpackages/apps/redis/templates/redisfailover.yamltls-port 6380, cert file paths incustomConfig+ volume mountspackages/apps/redis/templates/service.yamlpackages/system/redis-rd/cozyrds/redis.yamlredis-{{ .name }}-catosecrets.include+ schemaRedis listens on both ports (6379 non-TLS + 6380 TLS) for backward compatibility.
Phase 4: MongoDB
Operator: Percona Server MongoDB — native TLS support via
spec.tlspackages/apps/mongodb/values.yamltls.enabled: truepackages/apps/mongodb/templates/certmanager.yaml*.{name}-rs0.{ns}.svc.{clusterDomain}for replica setpackages/apps/mongodb/templates/mongodb.yamlspec.tls.mode: preferTLS+spec.secrets.ssl/sslInternalpackages/system/mongodb-rd/cozyrds/mongodb.yamlmongodb-{{ .name }}-catosecrets.include+ schemapreferTLSaccepts both TLS and non-TLS connections.Phase 5: Kafka (already partially TLS)
Operator: Strimzi — manages its own internal PKI
Kafka already has a TLS listener on port 9093. Strimzi automatically creates CAs and certificates.
packages/apps/kafka/values.yamltls.disablePlainListener: falseto allow forcing TLS-onlypackages/apps/kafka/templates/kafka.yamlplainlistener conditionalpackages/system/kafka-rd/cozyrds/kafka.yamlkafka-{{ .name }}-cluster-ca-certtosecrets.includeNo cert-manager resources needed — Strimzi manages its own PKI.
Phase 6: RabbitMQ, NATS, ClickHouse
Same pattern as previous phases, adapting TLS configuration per operator:
rabbitmq.com/v1beta1 RabbitmqCluster):spec.tls.secretName+spec.tls.caSecretNameconfig.merge.tlswith volume mountsopenSSL.server+ volume mounts for certsEach gets its own
certmanager.yamlusingcozy-lib.tls.certchainand ApplicationDefinition updates.Backward Compatibility Strategy
tls.enabled: true) for new installationstls.enabled: falsedisables all cert-manager resources and TLS configrequire){release}-casecret is added tosecrets.includein ApplicationDefinitions so client apps can verify the server certificateVerification Plan
helm templateto verify correct cert-manager resource generationtls.enabled: falseproduces zero TLS resourcesrenewBefore: 720htriggers automatic renewal without downtimepsql "sslmode=verify-ca sslrootcert=ca.crt"mysql --ssl-ca=ca.crtredis-cli --tls --cacert ca.crtmongosh --tls --tlsCAFile ca.crtRecommended Implementation Order
_tls.tplHappy to start with a PR for Phase 0 + Phase 1 (cozy-lib helper + PostgreSQL) as a proof of concept. Would appreciate feedback on the overall approach before diving in!