Habify BaseHabify Base
Đội ngũ An toàn Thông tin Habify (Security & Data Governance Team)Updated: 2026-11-249 min read

Complying with Vietnam Personal Data Protection Law 91/2025/QH15 & Decree 356

Vietnam Personal Data Protection Law 91/2025/QH15 mandates clear Controller vs Processor boundaries, strict technical safeguards, and cross-border impact controls. Habify Base enforces isolation from the physical PostgreSQL layer up.

Key Takeaways

  • Dedicated physical PostgreSQL 18 database per project (hb_proj_<ulid>) preventing multi-tenant row mixing
  • Default-Deny RLS: Data API blocks any table without ENABLE + FORCE ROW LEVEL SECURITY and at least one policy
  • Unauthenticated hb_pk_* requests still run under SET LOCAL ROLE hb_rls_<ulid> with app.current_role = 'anon'
  • Time-boxed 2-hour read-only Support Access Grants plus continuous physical replica storage inside Vietnam (vn_replica)

Step 1: Enforce ENABLE + FORCE RLS on All User Data Tables

Author your table migration with strict user_id policies tied to current_setting('app.current_user_id', true) and push it with habify db push.

sql
CREATE TABLE public.customer_profiles (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id TEXT NOT NULL,
  full_name TEXT NOT NULL,
  phone TEXT,
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

ALTER TABLE public.customer_profiles ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.customer_profiles FORCE ROW LEVEL SECURITY;

CREATE POLICY owner_only_select ON public.customer_profiles
  FOR SELECT USING (
    current_setting('app.current_role', true) <> 'anon'
    AND user_id = current_setting('app.current_user_id', true)
  );

Step 2: Gate Support Inspection with 2-Hour Support Grants

Habify engineers have zero standing access to your project data. Whenever debugging is required, grant a temporary 2-hour read_metadata_logs session in Console.

Step 3: Export Signed DPA & Cross-Border Impact Pack

Download the Law 91/2025/QH15 compliant DPA and cross-border transfer assessment draft directly from your Project Compliance tab.

Frequently Asked Questions

What happens if I forget to add an RLS policy on a new table?

The Data API enforces Default-Deny: any public table missing ENABLE + FORCE RLS or lacking at least one policy is rejected immediately with RLS_POLICY_REQUIRED.