Stop AR from falling back to plaintext when connecting to PostgreSQL on self-managed
Problem
AR's driver defaults to sslmode=prefer (pgx v5.11.0) when PGSSLMODE is not set. That checks no certificate. It also falls back to plaintext.
An operator who skips the runbook step gets plaintext with no warning. This is accepted risk 6 in self-managed-limitations.md.
In pgx, require with a root certificate acts as verify-ca. It checks the CA but not the host name.
Proposal
Change AR's default so it never falls back to plaintext. For example:
- Default to
verify-full, or - Refuse to start without TLS.
Done when
- AR does not connect in plaintext when
PGSSLMODEis unset. - Accepted risk 6 is removed.
Context
The runbook part is done in !3208 (merged). Both services now use verify-full. A trusted-ca ConfigMap is mounted at /etc/ssl/custom, and PGSSLROOTCERT points to it.
- AR:
PGSSLMODE: verify-full - IAM:
ssl_mode = "verify-full"
No chart value was needed. configMapVolumes plus PGSSLROOTCERT works on both stock charts.
@WarheadsSE tested on AR chart 2.144.0 (GLAZ v10.1.0) and iam-data-access chart 1.56.0. The install guide (docs/dev/self-managed-install.md, ## Versions) now pins AR chart 2.149.0 (GLAZ v10.3.0) and iam-data-access chart 1.80.2. The final set is frozen just before the GitLab 19.5 self-managed cut-off, and needs a cold run then.
Related to !3208 (merged)