Security hardening: Docker Compose and Homebrew connect the app to...
Free, open-source timeline editor for exact dates at any scale.
Brought to you by:
athanclark
Originally created by: athanclark
Docker Compose (and Homebrew): the web application connects to PostgreSQL as a superuser
PGUSER: openchronology is shared by migrate, app and mail-worker.POSTGRES_USER: openchronology makes this the superuser in the official postgres image.CREATE EXTENSION IF NOT EXISTS pgmp), which is why the migrating role must be superuser.DATABASE_URL=postgresql://$user@/openchronology?host=/tmp uses the Homebrew user, the cluster's superuser.postgres) creates pgmp once, and the server runs as a non-superuser owner role (postinst:114-121, module.nix:253-256). Compose instead uses one role for everything, and that role is the container's bootstrap superuser. Homebrew does the same with the user's own superuser account. Homebrew's own initdb also uses trust authentication for local and 127.0.0.1 connections; that is Homebrew's default, not this project's. On a multi-user Mac, any local user can therefore connect as that superuser.COPY ... TO PROGRAM or pg_read_server_files, then a shell as postgres in the database container. From there, ALTER SYSTEM and reading or changing every database.POSTGRES_USER is created with superuser power.node.POSTGRES_USER as the bootstrap superuser, which migrate uses to CREATE EXTENSION pgmp. Add an init script in /docker-entrypoint-initdb.d that creates a separate non-superuser openchronology_app role owning the database, and give the app and mail-worker services that role's credentials. For Homebrew, create a dedicated non-superuser role in openchronology-setup and use it in DATABASE_URL.From the security review of 2026-11-06 (commit 6776c44), finding L-13: hardening or information, filed publicly because it describes no way in. The exploitable findings are private security advisories.
🤖 Generated with Claude Code
Ticket changed by: athanclark