Source document
docs/project-brain/07-SECURITY-BRAIN.md
Source version
0.0.0
Generated time
2026-07-06T14:59:22.796Z
Owner
Unassigned
Audience
Internal
Status
Approved

07 — SECURITY BRAIN

Context pack cho JWT · Gateway · RLS · Secrets · Threat model · Production readiness. Snapshot + trỏ canonical. Không in secret. Canonical: backend/SECURITY-CHECKLIST.

Auth Gateway (LIVE)

Tenant isolation — 4 lớp (defense-in-depth)

  1. Auth/context (TenantResolver, server-side) · 2. Repo filter tenantId · 3. Domain guard TENANT_MISMATCH · 4. RLS (DB). Cross-tenant → 404 (anti-enumeration). travel-os/07-MULTI-TENANT.

RLS (staging ON)

Secrets

Threat model & guardrails

Production readiness

Verify tools (read-only)

scripts/verify-rls-readiness.sh (DB metadata) · scripts/check-tenant-guard.sh (static request-path guard). backend/CUTOVER-READINESS.

Current state · risks · next