fix(indexer): isolate database roles and QA mutations #1426

Merged
PlasticDigits merged 2 commits from fix/issue-1396-db-isolation into main 2026-10-06 06:25:02 +00:00
Owner

Indexer startup previously applied migrations with its application credential, and seed-qa --clean could connect and migrate before checking mode or arguments. Integration processes also reused mutable database history. This change separates runtime DML, one-shot migrations and dedicated QA credentials, authenticates isolated QA targets before mutation, and creates fresh databases per integration process.

Implements the source remediation for #1396 and its comments.

  • Runtime cannot administer roles/databases/schema, read or change migration history, or access unrelated applications; separate migrator/QA ACLs verified.
  • Default Compose keeps loopback publication; host networking is explicit opt-in with loopback listen addresses and nondefault credentials.
  • Production seed/clean and spoofed QA targets reject before connection; isolated QA migration/check/seed/clean works.
  • Parallel worktree/process checks preserve parent data and control migration history.

The server verifies least privilege and a protected schema marker and never migrates. Local migration/server launchers isolate inherited credentials. Charts fixtures use the same QA guard. GitLab, GitHub and Woodpecker sources use dedicated QA credentials. DB1396 invariants, agent instructions, acceptance checklist and staged transition/rollback docs are cross-linked.

Validation: make verify-issue-1396 — 28 PASS, 0 FAIL, 2 SKIP, with both runs passing 561 library tests, 4 CLI tests, 6 database tests, 43 API security tests and 28 API tests. make verify-issue-1400 — 9 PASS, 0 FAIL, 0 SKIP, including signed-policy image build/tests. Secret-log lint, YAML parsing, whitespace and independent agent review passed.

The two explicit platform skips are custom-bridge published-loopback queries timing out on this host, and host IPv6 being disabled. Internal/default-bridge confinement and host-mode IPv4 probes passed. Production role rollout/live exposure and deployment of the updated immutable trusted CI policy require separate receipts; local results do not attest them. Agents may record unavailable checklist items as SKIP and report PASS WITH SKIPS; executed failures remain FAIL.

Review/commands: agent checklist, receipt, invariants, transition and rollback.

Rollout requires the separate migration job and scoped credentials before starting the new server. Deploy the integrated trusted CI policy bundle before treating hosted enforcement as accepted. No production database, shared history or deployment was mutated by these checks.

Indexer startup previously applied migrations with its application credential, and `seed-qa --clean` could connect and migrate before checking mode or arguments. Integration processes also reused mutable database history. This change separates runtime DML, one-shot migrations and dedicated QA credentials, authenticates isolated QA targets before mutation, and creates fresh databases per integration process. Implements the source remediation for #1396 and its comments. - [x] Runtime cannot administer roles/databases/schema, read or change migration history, or access unrelated applications; separate migrator/QA ACLs verified. - [x] Default Compose keeps loopback publication; host networking is explicit opt-in with loopback listen addresses and nondefault credentials. - [x] Production seed/clean and spoofed QA targets reject before connection; isolated QA migration/check/seed/clean works. - [x] Parallel worktree/process checks preserve parent data and control migration history. The server verifies least privilege and a protected schema marker and never migrates. Local migration/server launchers isolate inherited credentials. Charts fixtures use the same QA guard. GitLab, GitHub and Woodpecker sources use dedicated QA credentials. DB1396 invariants, agent instructions, acceptance checklist and staged transition/rollback docs are cross-linked. Validation: `make verify-issue-1396` — **28 PASS, 0 FAIL, 2 SKIP**, with both runs passing 561 library tests, 4 CLI tests, 6 database tests, 43 API security tests and 28 API tests. `make verify-issue-1400` — **9 PASS, 0 FAIL, 0 SKIP**, including signed-policy image build/tests. Secret-log lint, YAML parsing, whitespace and independent agent review passed. The two explicit platform skips are custom-bridge published-loopback queries timing out on this host, and host IPv6 being disabled. Internal/default-bridge confinement and host-mode IPv4 probes passed. Production role rollout/live exposure and deployment of the updated immutable trusted CI policy require separate receipts; local results do not attest them. Agents may record unavailable checklist items as SKIP and report PASS WITH SKIPS; executed failures remain FAIL. Review/commands: [agent checklist](docs/qa/issue-1396/README.md), [receipt](docs/qa/issue-1396/verification.md), [invariants](skills/AGENTS_INDEXER_DATABASE_ISOLATION.md), [transition and rollback](docs/runbooks/indexer-database-isolation.md). Rollout requires the separate migration job and scoped credentials before starting the new server. Deploy the integrated trusted CI policy bundle before treating hosted enforcement as accepted. No production database, shared history or deployment was mutated by these checks.
fix(indexer): isolate database roles and QA mutations
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
9fbd52c89b
Separate runtime DML from one-shot migrations and scoped QA credentials. Guard seed and fixture commands before database access and isolate integration databases per process.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/cl8y-dex-terraclassic!1426
No description provided.