Tenant isolation
QUE enforces multi-tenant isolation at the PostgreSQL layer through row-level security. Every query executes under the tenant's JWT role, and the application service layer never assumes authorization the database did not verify. The `is_company_member(company_id, user_id)` helper function gates all member access, and the `security_events` table is super-admin-only to prevent audit trail tampering by compromised tenant owners. Verification: Phase 13 cross-tenant E2E test suite.
Encryption scopes
All secrets at rest are encrypted using AES-256-GCM with a random 12-byte nonce per operation. The encryption key is derived from the deployment's `ENCRYPTION_KEY` environment variable (never committed to source). Secrets are decrypted only at the point of use and never stored in plaintext anywhere in the application layer. Scope covers all integration secrets, API key hashes, and webhook signing secrets.
Secret rotation procedure
Rotation follows a five-stage pipeline: Inventory → Stage → Validate → Rollback → Revoke. Rotation is quarterly or immediate upon suspected exposure. Production and non-production environments use separate credentials. The procedure is documented in the disaster recovery runbook and verified through the rotation test suite.
Disaster recovery drill results
| Metric | Target | Verification |
|---|---|---|
| RPO (backup age threshold) | 24 hours | Backup health monitoring + Prometheus alert |
| RTO (restore time) | 4 hours | Quarterly restore drill (drill_results table) |
| Drill cadence | 90-day maximum | Admin DR dashboard + alert on overdue |
| WAL gap detection | < 5 minutes | Continuous WAL archive state monitoring |
Tamper-evident audit trail
Every security event written to `security_events` carries a `chain_hash` computed as `SHA-256(prev_chain_hash + event_fingerprint)`. The chain is per-tenant, meaning each tenant's audit trail is independently verifiable. Any tampering with a historical record breaks the chain and is detected by the `verifyChainIntegrity()` function. Retention: INFO=30d, WARNING=90d, HIGH/CRITICAL=365d/5yr.
Alert rules and monitoring
| Category | Count | Stack |
|---|---|---|
| Rate limiting & fail-closed | 2 rules | Prometheus + Alertmanager |
| Payment fraud & disputes | 3 rules | Prometheus + Alertmanager |
| Account takeover & abuse | 3 rules | Prometheus + Alertmanager |
| Disaster recovery | 2 rules | Prometheus + Alertmanager |
| Webhook delivery | 2 rules | Prometheus + Alertmanager |
| Audit chain integrity | 3 rules | Prometheus + Alertmanager |
| Integration platform | 5 rules | Prometheus + Alertmanager |
GDPR data erasure (Article 17)
| Tier | Tables | Treatment |
|---|---|---|
| Tier 1 (direct PII) | bookings, customers, staff_members, event_types | Deleted on confirmed erasure request |
| Tier 2 (audit) | security_events, webhook_delivery_attempts | Preserved but PII masked with SHA-256 pseudonymization |
The erasure pipeline requires double-confirmation (request with token, then confirm with token) before execution. Retention thresholds: bookings pruned at 365 days; customer eligibility at 180 days of inactivity; GDPR processing SLA of 30 days; request expiry at 45 days. Every erasure is logged to security_events with the chain hash.
Incident response
| Severity | Definition | Escalation |
|---|---|---|
| SEV1 | Platform down or data risk | Immediate → L1-L4 |
| SEV2 | Partial outage | < 30 min → L2-L4 |
| SEV3 | Degraded performance | < 2 hours → L3 |
| SEV4 | Cosmetic / minor | Next business day → L3 |
Claim-to-evidence mapping
Every claim on the public /security page traces to a specific artifact in this pack. No claim is published unless it is verifiable against the evidence. The full compliance evidence pack is available at docs/compliance-evidence-pack.md in the repository.