Security & Governance
Security built into
the database layer.
YBNW One's security model does not rely on application-level guards that can be misconfigured or bypassed. Data isolation, access control, and audit logging are enforced at the PostgreSQL level — the lowest layer possible.
Multi-Tenant Isolation
Row-Level Security: isolation that cannot be bypassed.
Every table in the YBNW One database has a Row-Level Security policy filtering all data by workspace_id. This runs at the PostgreSQL execution layer — not in application code.
Access Control
795 named permissions. 12 predefined roles.
Every action maps to a named permission constant. Roles are collections of permissions. Nothing is accessible by default.
The 12 predefined roles
Three-layer permission enforcement
ProtectedRoute component wraps every route. Evaluates hasPermission(requiredPermission) against current user's role. Redirects to dashboard if check fails — the restricted page does not render at all.
Supabase Edge Functions validate the authenticated user's role before executing business logic. Server-side check is independent of the frontend — bypassing the UI does not grant API access.
RLS is the final layer. Even if both frontend and API checks were bypassed (which cannot occur in normal operation), PostgreSQL still enforces workspace-level isolation at the query level.
Encryption
Data encrypted in transit and at rest.
In Transit: TLS 1.3
All browser-to-platform communication uses TLS 1.3. HTTPS enforced everywhere — no unencrypted HTTP connections permitted. HSTS headers prevent protocol downgrade attacks. Certificate managed and auto-renewed via Vercel's edge network.
At Rest: AES-256
All data stored in Supabase PostgreSQL is encrypted at rest using AES-256. Storage-level encryption managed by Supabase infrastructure on AWS, with AWS KMS for key management.
Sensitive Field Encryption
Specific PII and financial credential fields are encrypted at column level using pgcrypto before storage: employee bank details, vendor bank details, employee NI number, employee date of birth. Decrypted only when retrieved by an authenticated user with the required permission.
File Storage Encryption
Documents, receipts, CVs, contracts, and uploaded files stored in Supabase Storage with server-side AES-256 encryption. File access requires a signed URL generated by an authenticated API call — files are not accessible directly by URL without authentication. Signed URLs expire after a configurable window.
API Key Separation
Supabase anon key (safe to expose in frontend, restricted by RLS) and service role key (server-side only, never exposed to browser, injected as environment variable at Edge Function runtime — never in code) are strictly separated.
Stripe Payment Security
No card data ever touches the YBNW One platform — all payment data handled exclusively by Stripe. Stripe webhook payloads are verified using the Stripe-Signature header and a signing secret before any payload is processed. Stripe holds PCI DSS Level 1 certification.
Authentication
Who can access the platform, and how.
Audit Logging
Every action. Every user. Every timestamp.
The audit log is immutable and cannot be edited, cleared, or deleted by any user — including workspace administrators.
What is logged
Every record creation, update, and deletion. Every approval decision. Every permission change. Every login and logout. Every document access, download, and signature. Every AI query and response. Every configuration change. Every user invitation and deactivation.
Log entry fields
event_type, user_id, user_email, workspace_id, table_name, record_id, action (CREATE/UPDATE/DELETE/VIEW), old_values (JSONB snapshot), new_values (JSONB snapshot), ip_address, user_agent, created_at (UTC timestamp).
Immutability
Audit log records are written to a separate append-only table. No UPDATE or DELETE permission is granted on the audit log table to any role. Entries can only be inserted — never modified or deleted. Enforced at the database layer via write protection.
Search and export
Administrators search by user, date range, event type, table, and record ID. Export to CSV for external audit tools or regulatory submission. Searching the audit log itself creates an audit entry.
⏳ Retention: 7 years
Audit logs retained for a minimum of 7 years by default (configurable). Legal holds prevent deletion of specific records or date ranges required for litigation or regulatory review. Deletion certificates issued on data destruction.
Anomaly Alerts
Automatic alerts for: bulk data export (>500 records in one session), sensitive data access outside business hours, permission escalation events, 3+ failed MFA attempts, access from a previously unseen IP range. Delivered to workspace administrator by email and in-app notification.
GDPR & Data Protection
Built for UK and EU data protection law.
Compliance Alignment
How YBNW One maps to major frameworks.
RLS-enforced access control (A.9), AES-256 encryption (A.10), immutable audit logs (A.12), MFA (A.9.4), DPA and sub-processor management (A.15), incident response procedures (A.16), documented ISMS policies (A.5).
Data minimisation, purpose limitation, EU data residency, Article 30 ROPA, DSAR workflow (30-day clock), 72-hour breach notification, right to erasure on termination, DPA for all customers, lawful basis tracking.
Security (CC6): RLS, MFA, encrypted storage. Availability (A1): monitored uptime, PITR backups. Processing Integrity (PI1): audit trail, immutable log. Confidentiality (C1): workspace isolation, column encryption. Privacy (P1): GDPR controls.
Boundary firewalls (Vercel WAF), secure configuration (pinned deps, no default credentials), access control (RBAC + RLS + MFA), malware protection (Vercel edge scanning), patch management (automated Dependabot + 24hr critical patch SLA).
Technical safeguards: access control (RBAC), audit controls (immutable log), transmission security (TLS 1.3), encryption at rest (AES-256). Administrative: workforce training records (L&D module). Business Associate Agreement (BAA) available on request.
No card data handled by YBNW One — Stripe processes all payment data. YBNW One is out-of-scope for PCI DSS except webhook processing. Stripe-Signature verification on all webhook payloads. Stripe holds PCI DSS Level 1 certification.
Security questions?
We answer security questions before you sign anything.
If your organisation requires a security questionnaire, penetration test evidence, DPA review, or architecture walkthrough — contact us and we will provide whatever your security team needs.