mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-03 10:37:21 +09:00
Per-app TLS issues a per-release self-signed CA, but the only objects that carry ca.crt — the cert-manager CA and leaf Secrets — also carry private keys. Granting a tenant read on those to obtain the trust anchor also hands over a server or CA private key. Add cozy-lib.tls.caCertSecret, which renders a canonical Opaque Secret holding only ca.crt and labelled internal.cozystack.io/tenantresource= true. The tenantsecret registry surfaces label-bearing Secrets under core.cozystack.io/tenantsecrets, which the base tenant roles already grant, so tenants reach the trust anchor without any grant on a Secret that contains tls.key. The helper fails closed on empty input and refuses any PEM carrying private key material. Covered by helm-unittest in the cozy-lib test chart. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>