Skip to content

fix: a random password for each drill sandbox, kept off the process list (2.10.1) - #60

Merged
supertj merged 3 commits into
mainfrom
feature/random-sandbox-password
Nov 6, 2026
Merged

supertj merged 3 commits into
mainfrom
feature/random-sandbox-password

Conversation

@supertj

@supertj supertj commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Why

The drill sandbox holds restored production data. Its port is bound to 127.0.0.1, which keeps the network out but not the other accounts on the same machine, and every sandbox used the password drill. On a shared machine (a multi-user server, a shared CI runner) anyone with a shell account could connect for as long as the sandbox ran, or indefinitely with --keep.

What changes

  • drill: each sandbox gets 16 random bytes as its password. The value reaches docker through its environment (-e POSTGRES_PASSWORD with no value), so it never appears in argv. The connection string carries it as before; pg_restore and psql already get it through PGPASSWORD, not argv.
  • The --keep test now checks that the kept sandbox's password is random, that it connects, and that drill no longer does.
  • Skill doc, by-hand restore test: a password from openssl rand -hex 16, passed to docker the same way and to psql/pg_restore as a per-command PGPASSWORD (exported, it would also replace ~/.pgpass for the production connection).
  • Skill doc: PITR no longer claims a Small compute requirement. Supabase's backups page says "PITR is available on all compute sizes."
  • Version 2.10.1 (the GHCR workflow tags images with the package.json version, so this keeps the 2.10.0 image tag pointing at what npm has). Tessl manifest 1.0.1.

Nothing changes for users: the password only exists inside the sandbox, and reports are the same. The hosted worker keeps its locked version until its next upgrade.

Not in this PR

The plugin's npx -y backupdrill@2.10.0 pins move to 2.10.1 in a separate PR once 2.10.1 is on npm, as with #44 and #52.

Verification

  • pnpm test: 441 passed, 0 failed (includes the Docker --keep test with the new assertions).
  • tsc --noEmit clean.
  • The skill doc's new snippet run by hand against postgres:17-alpine: random password connects, a dump restores (5 rows back), drill is rejected, docker inspect shows the env var set, and a taken port prints container: not started.

…ist (2.10.1)

The sandbox holds restored production data. Its port is bound to 127.0.0.1,
which every account on the machine can reach, so the fixed password 'drill'
protected nothing on a shared machine. Each sandbox now gets 16 random bytes;
docker reads the value from its own environment, so it never appears in argv.

The skill's by-hand restore test does the same: a password from openssl rand,
passed to each command through PGPASSWORD rather than in the URL.
…fore any container starts

The CLI's Auth restore refuses a pg_restore without \restrict and an older psql,
so a 17.0-17.5 client used to fail only at the restore step, after the backup
and drill had run. The skill doc's comment no longer says the password is off
the process list, only off docker's arguments.
@supertj
supertj merged commit 7f435a7 into main Nov 6, 2026
1 check passed
@supertj
supertj deleted the feature/random-sandbox-password branch November 6, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant