Production security checklist
Secure your project before real users depend on it. This checklist covers the settings that, when missed, leave data exposed or accounts open to takeover.
Run through it when you:
- Get ready to launch, or move a project from testing to production.
- Open sign-ups to the public.
- Add tables, sign-in methods, or teammates to a live project.
- Answer a security review or a customer's security questionnaire.
This page covers the security part of the Production checklist. That checklist also covers performance, availability, deployment, and rate limits. To find issues in your database at any time, run Security Advisor.
To have your AI agent check your project against this list, copy this prompt:
Database#
The Data API exposes your tables to anyone who has your publishable key, and that key ships in your app. These checks make sure each table returns only what a request is allowed to see, and that direct connections come only from networks you expect.
To secure your database:
- Enable Row Level Security (RLS) on every table in the Database > Tables section of the Supabase Dashboard. A table without RLS and reasonable policies lets any client read and change its data. To learn more, see Row Level Security.
- Enable RLS and create policies on every replicated table that holds sensitive data:
- Go to the Database > Policies section of the Dashboard to enable RLS and create policies.
- Go to the Database > Publications section of the Dashboard to add or remove replicated tables. To add or remove them with SQL, see Postgres Changes.
- To send sensitive changes only to authorized users, use Broadcast with Realtime Authorization. RLS doesn't filter Postgres Changes
DELETEevents.
- Turn on SSL Enforcement in the Database > Settings > SSL Configuration section of the Dashboard.
- Enable Network Restrictions in the Database > Settings > Network Restrictions section of the Dashboard.
Account and organization#
Members of your Supabase organization can change your projects' settings and read their data, depending on their role. These checks protect the accounts that have that access, and make sure you can't get locked out.
To secure your account and organization:
- Protect your Supabase account with multi-factor authentication (MFA):
- If you sign in with GitHub, enable two-factor authentication (2FA) on GitHub. Your GitHub account gives you administrative rights to your Supabase organization, so also protect it with a strong password. For 2FA, use a security key or an authenticator app.
- If you sign in with an email and password, set up MFA for your Supabase account.
- If your organization is on the Pro, Team, or Enterprise plan, enable MFA enforcement on your organization. Every member then needs a valid MFA-backed session to work with organization and project resources.
- Add more than one owner to your organization in the Organization > Team section of the Dashboard. If one owner is unreachable or loses access to their account, you still have Owner access to your organization.
Auth#
These settings decide how your users sign up and sign in to your app. Tighten them before real users arrive, so sign-ups are confirmed, codes and links expire within an hour, and Auth emails come from your own domain.
To change these settings from a terminal, use the Management API update Auth config endpoint.
To secure Auth:
- Enable email confirmations in the Authentication > Sign In / Providers section of the Dashboard.
- Remove any test phone numbers you added for testing.
- Set the expiry for one-time passwords (OTPs) in the Authentication > Sign In / Providers section of the Dashboard. Use 3600 seconds (1 hour) or lower. The same setting controls how long confirmation, password recovery, email change, and invitation links stay valid, so a shorter expiry also shortens those. If you need more entropy, increase the length of the OTP.
- If your application needs a higher level of security, set up multi-factor authentication for your users.
- Use a custom SMTP server for Auth emails, so your users see mail from a trusted domain, ideally the domain your app runs on. Get SMTP credentials from any major email provider, such as SendGrid or AWS SES.
Threat review#
The Database, Account and organization, and Auth checks cover settings that every project shares. Finish with the parts that only your app has.
To review the risks that are specific to your app:
- Work out how an attacker could abuse your app, and mitigate each risk you find.
- Review the common web application risks in the OWASP Top 10.