Repository navigation
Description
Part of #13
What is wrong: With the default CloudNativePG database, the api, worker and migrate containers read CMAPI_DATABASE_URL from key uri of Secret cmapi-db-app. No file in deploy/manifests sets sslmode for that connection, so libpq uses its default, sslmode=prefer. prefer does not verify the server's certificate or name, and it can fall back to plaintext.
Where: deploy/manifests/components/cmapi/20-api.yaml:52 and :87, and 30-worker.yaml:49 and :84, in env for CMAPI_DATABASE_URL. The lines exist at ecc5cb3. An external server is not affected in the same way: docs/12-existing-postgresql.md gives a URI with sslmode=verify-full and sslrootcert.
How to prove it: On a kind cluster with CNPG:
pg_stat_sslshowsssl = tfor the api, worker and migrate connections.- With a CA that does not cover the server, each container refuses to connect and does not fall back to plaintext.
- Both checks fail before the fix.
deploy/kind-test.sh holds the pg_stat_ssl check of the migrate connection today (line 107). The test of check 2 is new, in deploy/kind-test.sh, not written yet.
Measured or inferred: Measured on PostgreSQL 16 (PR #89 review): PGSSLROOTCERT with a CA that does not cover the server makes sslmode=prefer fall back to plaintext silently. PR #89 removes that variable from the migrate container for this reason (ruling 4 in docs/reviews/2026-11-05-pr89/README.md). That change does not add verification. The tracker records the later kind result: the migrate connection gives pg_stat_ssl True TLSv1.3. H1, H2 and H4 of the fix are PLAUSIBLE until the kind proof K1 runs (HANDOVER-AND-RESUME.md).
Severity: Medium. The connection has a weak control, with no direct loss. An attack needs a position inside the cluster network.
What must hold after the fix: Each container connects to CNPG with sslmode=verify-full against CNPG's CA, from Secret <cluster>-ca. Each container refuses to connect without TLS.
Research: Not complete. The record of the stopped work is docs/reviews/2026-11-06-pr112/night/91/.
Solution: Not complete. Branch fix-cnpg-verify-full holds a work-in-progress commit 920b938, and night/91/91-on-top-of-wip.patch continues it. Nothing is proven. OB1-PROMPT.md decides that this fix lands before the first CRC run.
Class: INV. The fix adds server verification, a control that the connection never had.
Activity
ephico2real2 commentedon Nov 6, 2026
Unfinished work on branch
fix-cnpg-verify-full. The implementer was stopped to save tokens, at the owner's request, during its kind proof, so nothing here is proven. Parked until Wave 1 is on CRC.Handover for clearing the session: the review's state saved, tracker …
PR #112's rulings, #118's diagnosis and proof, and the handover for s…
Handover: #91's kind proof commands were not written before the stop
OB1's prompt: the decisions made for it under the owner's mandate
[-]Connections to CNPG do not verify the server[/-][+]SEC-04: Connections to CNPG do not verify the server[/+]ephico2real2 commentedon Nov 13, 2026
Work tag: In-Progress. Commit
920b938on branchfix-cnpg-verify-fullholds unfinished work. The branch has no pull request, and its kind proof did not run. Read fromghandgitat 2026-11-13T09:18Z.#91: the kind proof supplies a wrong CA on manifests from before the …
#91: CI runs the database-probe test, and the kind measurements are i…
ephico2real2 commentedon Nov 13, 2026
In-QA: pull request #158 closes this issue. Proven on kind on 2026-11-13: before the fix each container connected with sslmode prefer and fell back to plaintext with a wrong CA; with the fix each connects verify-full and refuses it. CI on its head was not read yet when this was written.
Tracker counts and the class table at 11:20 UTC; #91, #154 and #155 a…