fix(installer): reconcile protected owner grants - #323
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 073e0dea3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 35676673 | Triggered | PostgreSQL Credentials | 9fb5c45 | scripts/test-install-managed-migrations.sh | View secret |
| 35676674 | Triggered | Generic Password | 9fb5c45 | web/scripts/ci/prove-installer-legacy-migration-repair.sh | View secret |
| 35677352 | Triggered | Generic Password | 62c8a5e | scripts/test-install-managed-migrations.sh | View secret |
| 35676673 | Triggered | PostgreSQL Credentials | 62c8a5e | scripts/test-install-managed-migrations.sh | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Summary
The post-migration installer grant refreshed the app role across every public table, including tables owned by Forge protected routine roles. That made the next upgrade reject an otherwise valid durable catalog fingerprint.
This change:
forge upgradeandforge repairpostgresorpostgresql, literalforgelogin, nonempty URI-safe password, exactlocalhost:5432/forge, and no query or fragment suffixservice_modevalue in the install manifest to benativebefore normal repair can reconcile local privilegespsql -X, explicit user and database arguments, and cleared ambient PostgreSQL routing and credential variablespostgresoperating-system fallback on Linux; custom TCP administrator credentials cannot redirect installer or repairforge repair --dry-run, custom or remote database URLs, missing database URLs, non-native or malformed manifests, and--skip-migratenever invoke the local reconcilerforgetable and column grants from protected-owner tablesSELECTon the two local-projection tablesforgetable and column authority, rejecting leakedPUBLICDML, column grants, and projectionSELECTeven when directforgeACLs appear canonicalPUBLIC SELECTexception on the S3 release-state table and unrelated-principal shared-SQL grants that do not confer authority toforgepg_classrow and livepg_attributerow, so concurrent table and column ACL changes serialize with reconciliationINHERITapp-role state only when every other role attribute and membership edge is safe, then transactionally hardens it toNOINHERITforge upgradeas the correct retry command for upgrade failuresNo migration, repair artifact, or search-path contract changed.
Validation
bash -nfor installer, repair, and focused proof scriptsbash scripts/test-install-managed-migrations.sh-X, socket, port, user, and database arguments--skip-migrate, and isolated hook behaviorgit diff --checkcd web && npm run lintcd web && npx tsc --noEmit