TL;DR
Eighteen items, grouped by what they actually protect: credentials, access control, connections, queries, and backups. Five of them are the ones that stop a breach, and they're listed first. Do those before you launch. The rest can wait a week.
Your database is where all the stuff you actually care about lives: user data, payment info, the works. Misconfigure it and you have the fastest path to a breach that ends up on Hacker News. Postgres, MongoDB, Supabase, Firebase, it doesn't matter. These items apply.
Quick Checklist (5 Critical Items)
Authentication & Credentials 4
Access Control 5
Connection Security 3
Query Security 3
Backup & Recovery 3
Database-Specific Considerations
For Supabase: enable RLS on every table, then write a policy for each operation you allow. SELECT, INSERT, UPDATE and DELETE each need one. And keep the service_role key on the server, always, because it bypasses RLS completely.
For Firebase: the default security rules block all access, so you have to write your own. Test them in the Rules Simulator in the Firebase Console before you deploy. A rule that looks right and isn't is the usual way this goes wrong.
For MongoDB: turn on authentication, restrict network access, and validate documents before you insert them. NoSQL injection is real.
What is the most important database security measure?
Access control is the most critical database security measure. This includes strong authentication, authorization rules (like Supabase RLS or Firebase Security Rules), and the principle of least privilege. Without proper access control, attackers with database access can read or modify any data.
Should I encrypt my database?
Yes, use encryption at rest and in transit. Most managed database providers (Supabase, PlanetScale, Neon) encrypt data at rest by default. Always use SSL/TLS for connections. For highly sensitive fields like SSNs or payment data, consider application-level encryption as an additional layer.
How often should I backup my database?
It depends on how fast your data changes and how much of it you can afford to lose. Daily is the floor for most production apps. If your data moves faster than that, look at point-in-time recovery. And test the restore. A backup you can't restore from is worthless.
Scan Your Database Configuration
Our scanner checks for common database security issues including exposed credentials and missing access controls.