fix(ddb): add PostSync Job for per-database schema permissions

ROOT CAUSE: CNPG Database CR creates databases but doesn't grant schema
permissions to the owner role. Bootstrap DB owner 'app' retains CREATE
privilege on public schema, blocking authentik/temporal from creating tables.

SECURITY FIX: Removed insecure 'GRANT TO PUBLIC' from postInitApplicationSQL.

SOLUTION: PostSync Job connects as 'app' (DB owner) and grants schema
permissions to named roles (authentik, temporal) in their respective databases.
Runs after Database CRs reconcile, survives CNPG database recreation.

Pattern: Per-database grants via PostSync, not cluster-wide PUBLIC grants.
This commit is contained in:
Story Crater Bot
2026-07-23 09:02:19 -07:00
parent 1c98628417
commit 2499cc241f
3 changed files with 114 additions and 5 deletions
+1
View File
@@ -8,6 +8,7 @@ namespace: ddb
# GitOps-managed database schemas (ArgoCD wave 6).
# These depend on ddb-cluster existing (bootstrap wave 0).
resources:
- grant-schema-permissions-job.yaml
- authentik-database.yaml
- temporal-database.yaml
- temporal-visibility-database.yaml