chore(memory): TR_PW rotation, init log fix, LRN-127
This commit is contained in:
1 parent
5f63d2229c
commit
6ceced5c06
4 files changed
+72
-2
No files matched your search
@@ -878,3 +878,11 @@ Trap: substring tests like `*"no such"*` (meant for "No such container" / "no su
|
||||
Apply: never classify Docker errors by substring; exact whole-sentence match per kind on stderr, everything else refuses (see the inspect -f learning).
|
||||
|
||||
Limit: wording of this client version only.
|
||||
|
||||
## LRN-127 — Postgres image init logs role password: log_statement must be off on server command line (2026-11-11)
|
||||
**Context**: db:trial first real create 2026-11-11 (255dd67). TR_PW found in `docker logs faunosteo_trial_db` line 379: `postgres@postgres LOG: statement: ALTER USER supabase_admin WITH PASSWORD '…'`.
|
||||
**Cause** (demonstrated): image `supabase/postgres:17.11.0.004` init script `/docker-entrypoint-initdb.d/migrate.sh` sends role password as SQL text (lines 36/46/54/59) on init temp server; image `/etc/postgresql/postgresql.conf:545` has `log_statement = 'ddl'` → statement + password to stderr = container log. Our `/etc/postgresql.schema.sql` session `set log_statement='none'` runs after → too late. Per-role `log_statement=none` (image migration 20250205060043) also after.
|
||||
**Fix** (5f63d22): `-c log_statement=none` appended to `exec docker-entrypoint.sh postgres ...` in DB_INIT. Entrypoint `_main` → `docker_temp_server_start "$@"` → `pg_ctl -o "$(printf '%q ' "$@")"` passes every arg after `postgres` to temp server and final server; command line (PGC_S_ARGV) beats postgresql.conf + auto.conf; no init script sets log_statement other than none (grep). Harness check db-trial-check.sh:726, positive control red 372/1 → green 373/0. Static proof only: real proof = create on fresh volume + container log scan (counts only, SUPABASE.md §5.2). Trade-off: DDL no longer logged on trial server.
|
||||
**Not closed** (named, owner scope): failing init statement still logged (`log_min_error_statement = error`); migrate.sh puts password on psql argv during init; db-sandbox.sh same DB_INIT without flag; DEV CLI stack likely same log line.
|
||||
**Remediation of exposed value**: one-off TR_PW rotation 2026-11-11 (owner): 5 roles one tx (local logging off), secrets.env, auth/storage/rest recreated by `pnpm db:trial start`; old pw refused on scram path (container network IP; 127.0.0.1 is trust, proves nothing), new ok ×5; db container frozen env keeps dead old value.
|
||||
**Future application**: any self-hosted Postgres image with init scripts → set logging GUCs on server command line, never in init SQL; mandatory pre-production check in DEPLOY.md security prerequisites. Password probe must use non-trust pg_hba path + control with wrong password.
|
||||
Reference in new issue
Block a user