Skip to content
Rowsafe
Docs

Security check: who can reach your database

Pulse checks who can reach your database, from inside and from the internet, and fixes it in one click.

The security check looks at who may connect to your database and how. Every 15 minutes it reads the settings, tries your port from the internet like a stranger, grades the result A to F, and fixes most findings with one click. Rowsafe never sees a password.

Open a database, then Pulse → Security (the grade is also on Overview). Every plan. This page shows PostgreSQL; see other engines, Redis and Valkey and SQLite.

Fix what it found

Open Security

Open the database, then Pulse and Security. One sentence says where you stand, like "Anyone on the internet can try to log in."

Let only your app servers connect

Click Only allow your app servers. Rowsafe lists addresses seen in the last 14 days (your apps' ticked), their networks, and the server's own. Add others (10.0.1.25, 10.0.0.0/16) and click Allow. If a recent address would be cut off, Rowsafe names it and asks you to type the database name.

Turn on encryption and modern passwords

Click each remaining fix: Turn on encryption, Require encryption, Use modern password hashing, Renew the certificate. For users with MD5 passwords, Set a new password (below).

Check again

Rowsafe rechecks after every change. Check now does it at once.

Each change shows its result, like "Rules open to every address now let only 10.0.1.5/32, 10.0.1.0/24. The previous rules are kept in pg_hba.conf.rowsafe-20260925T101500.123456Z." Put back the previous rules undoes it.

What it checks

AreaWhat Rowsafe looks at
Who can connectlisten_addresses, and the rules in pg_hba.conf (as PostgreSQL reads them): rules open to every address (all, 0.0.0.0/0, ::/0), trust (no password) for network connections, the unencrypted password method
From the internetWhether the port answers from the internet, whether PostgreSQL offers encryption, and how far a stranger's login gets
EncryptionWhether TLS is on, and when the certificate expires
Passwordspassword_encryption (MD5 or scram-sha-256), which users still have MD5 passwords, and superusers logging in over the network
PrivilegesCREATE on schema public for everyone, and untrusted languages (such as plpython3u) someone marked trusted
Row-level securityFor apps on Supabase or PostgREST: tables your API's users can reach without row-level security, and policies that let every row through (below)
PostgreSQL versionWhether it still gets security fixes, and when that ends

Only each user's password type is read, never the password or hash.

The grade

A is 90 to 100, B 80 to 89, C 65 to 79, D 50 to 64, F below 50. Strangers getting in without a password is always F; any other warning caps it at B. Findings also count toward the health score (up to 25 points).

The check from the internet

Every 30 minutes, and after each access change, Rowsafe's servers:

  1. open a TCP connection to your port;
  2. ask whether PostgreSQL offers TLS, and read the certificate;
  3. start a login as rowsafe_outside_check and hang up when asked for a password. No password is ever sent.

Only the server's own public addresses are tried, never private ones. Results: not reachable, blocked by a firewall, turns strangers away, anyone can try passwords, or lets strangers in without a password. A firewall that allows only some sources may treat Rowsafe differently from others.

PostgreSQL may log no pg_hba.conf entry for host "...", user "rowsafe_outside_check". To stop the check, switch off Check from the internet under Security → More options.

New passwords

Set a new password makes a 24-character password in your browser. Rowsafe gets only its SCRAM-SHA-256 verifier (the one-way fingerprint PostgreSQL stores), sets it with ALTER ROLE ... PASSWORD kept out of the log, then drops it.

The password is shown once, with a copy button. Rowsafe never sees it. Apps using that user need it right away.

The firewall

Use the firewall too makes the server's firewall drop connections to the database's port from all but your addresses. It needs root's yes: --allow-firewall at install. The dashboard shows Allowed on this server or Not allowed on this server.

  • nftables, in its own table (inet rowsafe), matching only the database's port. SSH and other ports are never touched.
  • The installer lists the ports and asks again for new ones. Ports below 1024, SSH's port and ports no database listens on are always refused.
  • Docker-published ports bypass the firewall, so they're refused: limit them in your compose file.
  • If the agent can't reach Rowsafe and the database within a minute of a change, the server restores the old rules by itself.
  • Rules survive reboots, but a flush ruleset of your own firewall removes them (the internet check will show it).
  • Remove the firewall rule removes it; --no-allow-firewall or uninstalling removes the helper too.

What keeps it safe

  • pg_hba.conf changes are tested first. Rowsafe keeps a copy, has PostgreSQL check the new rules (pg_hba_file_rules), then reloads. If a rule is rejected or the agent can't reconnect, the copy goes back at once. Old lines stay as comments; local and narrower rules are untouched.
  • Nothing restarts, except Listen on this server only (More options), which sets listen_addresses to localhost and restarts, where restarts are allowed. Refused while apps connect over the network.
  • New certificates are self-signed, valid 3 years. sslmode=require works at once; verify-full needs a CA certificate you provide. Rowsafe never replaces a certificate it didn't make.
  • Owners and admins only, confirmed with the database name and audited. AI agents can apply fixes as their person; setting a password is for people only.

Row-level security (Supabase, PostgREST)

If your app talks to the database through an API such as Supabase or PostgREST, row-level security decides which rows each user may read and change. Pulse checks it for you.

It only looks when the database seems to use it: the roles anon or authenticated exist (or roles PostgREST's authenticator switches to), a table has row-level security on, or a policy exists. Plain apps see nothing new.

FindingWhat it meansWhat Rowsafe does
Anyone can read or change tables without signing inRow-level security is off on a table anon can use. With Supabase, the public (anon) key is in every visitor's browser, so anyone can read every rowTurn on row-level security
Every signed-in user can read all rowsThe same, for authenticated onlyTurn on row-level security
Policies let anyone change every rowA policy for anon or everyone (UPDATE, DELETE or ALL) whose rule is always true (USING (true), WITH CHECK (1 = 1))Explains, with an example under Do it yourself
Policies let signed-in users change other people's rowsThe same, for signed-in usersThe same
Anyone can add rowsAn INSERT policy for anon that is always true. Fine for a sign-up or contact formThe same
Policies let everyone read every rowA SELECT policy that is always true. Fine for public dataThe same
Your API's users can't use a tableRow-level security is on with no policies. Right for tables only your server usesShows a policy to start from
Row-level security reads whole tablesA policy filters a table of 10,000+ rows by a column no index starts with, so every API query scans itIndex the column, without blocking the app
Public Storage bucketsSupabase Storage buckets anyone can download fromSays so; fine for avatars and images

Turning on row-level security for a table without policies locks your app's visitors and signed-in users out of it until you add policies. Your server code (Supabase's service role) and the table's owner keep full access. Rowsafe says which tables have no policies and asks you to confirm. Tables that already have policies get their own button: turning it on there makes those policies apply.

Rowsafe doesn't write policies for you: only you know who should see what. A policy whose rule is always true may be exactly what you want (a public product list), so those are notes, not errors, unless anyone can change or delete rows.

Alerts when it changes. The agent checks every 15 minutes, reading only the catalog. When a check finds a gap that wasn't there before (a new table without row-level security, a policy that lets every row through, a bucket made public), you get one alert on your channels, linked to the finding and its fix in Pulse. It resolves when the gap is gone and isn't repeated on every check. What a database already had when Rowsafe first checked it is in Pulse, not an alert. Turn it off with the rls_drift alert rule, for the team or one database.

Without the dashboard, rowsafe pulse postgres://… runs the same check on any database you can reach, including hosted Supabase, and rowsafe fix turns row-level security on (Pulse on any database). Use the direct connection string for fixes: through a pooler, rowsafe fix asks for it.

On a server without the dashboard

On a server running Rowsafe on its own, sudo rowsafe security NAME shows the same grade and findings, and sudo rowsafe security fix NAME FINDING runs the same fixes after you type the database's name. The firewall and restarts still need root's yes on the server. The check from the internet needs the dashboard. PostgreSQL only, for now.

MySQL, MariaDB, MongoDB and ClickHouse

Same check every 15 minutes, including from the internet (it reads the greeting, or for ClickHouse tries one query without a password; never logs in). It looks at:

  • Who can connect: listen addresses, MongoDB without access control, passwordless remote users, MySQL anonymous accounts and root@'%', ClickHouse users open to every network.
  • Encryption, old password formats (mysql_native_password, SCRAM-SHA-1, ClickHouse plaintext), MySQL's test database, unsupported versions.

Fixes:

  • Remove anonymous accounts and Remove the test database (when empty) on MySQL and MariaDB.
  • Passwords for users without one in Databases & users.
  • Only allow your app servers via the firewall, where root allowed it.
  • Config-file changes (MongoDB access control and bindIp, ClickHouse's default user, TLS) have steps under Do it yourself.

Redis and Valkey

Same check every 15 minutes, including from the internet (a PING; never logs in). Settings and users (ACL LIST) are read on the server; password hashes never leave it. It looks for:

  • A default user without a password: anyone who reaches the port gets in. Critical when exposed on the network with protected mode off, or reachable from the internet.
  • Who can reach the port (bind) and encryption (TLS), when apps connect over the network.
  • Users with commands apps never need (FLUSHALL, FLUSHDB, CONFIG, DEBUG, KEYS, SHUTDOWN, MODULE, ACL, REPLICAOF): a bug or leaked password could wipe every key or stop the server.
  • Versions with the October 2025 Lua flaws (CVE-2025-49844 "RediShell", critical, and CVE-2025-46817, CVE-2025-46818, CVE-2025-46819): anyone who may run scripts can run code on the server. Fixed in Redis 8.2.2, 8.0.4, 7.4.6, 7.2.11 and 6.2.20 (7.0 has no fix: move to 7.2.11+), and Valkey 8.1.4, 8.0.6 and 7.2.11 (9.0 includes it).
ButtonWhat changesWhat apps see
Require a passwordThe agent makes a strong password for the default user on the server, sets it, and shows it to you once with the new connection URL. It travels encrypted to your browser; Rowsafe never sees or stores it.Apps and replicas that connect without the password are refused from that moment. Put the new URL in their settings (redis://default:PASSWORD@HOST:6379/0; clients without user names send the password alone).
Turn on protected modeWhile the default user has no password, the server accepts connections from itself only.Anything connecting from another server is turned away. Rowsafe refuses it while something connects over the network, and in Docker (apps connect from other containers there): require a password instead.
Take them away from userThe dangerous commands above are removed from that user; everything else it may do stays.Apps signed in as that user get an error for those commands (some clear a cache with FLUSHDB). If you manage the server as that user with redis-cli, keep it and give apps their own users.
Turn off scripts for userUntil you update, EVAL, EVALSHA, FUNCTION and FCALL are taken away from that user, which closes the Lua flaws for it.Apps that use Lua scripts (job queues like BullMQ, rate limiters, locks) get an error.
  • Each asks for confirmation and says who's affected. Nothing restarts.
  • Saved with ACL SAVE or CONFIG REWRITE; if neither can write, the change lasts until restart (the result says so).
  • Rowsafe's own user and replica users are never changed.
  • TLS and bind need a config change and restart: steps under Do it yourself.
  • Older setups lack the rights to manage users; re-run the installer (in Docker, rowsafe-agent redis login).

SQLite

SQLite is a file, so the question is who on the server can reach it. No internet check. Every 15 minutes (or on Check again) Rowsafe looks for:

  • the database or its -wal, -shm, -journal files readable or writable by every user;
  • the file inside a folder a web server serves (from nginx, Caddy and Apache settings it can read, and usual web folders);
  • its folder writable by everyone (no sticky bit);
  • copies next to it everyone can read (.bak, .backup, .old, dated).

Close to other users removes only other users' access (o-rwx on files, o-w on the folder), after you confirm. Owner, group and ACLs stay, so your app keeps access; the confirmation names any program that would lose it.

  • It needs a root helper allowed at install (--allow-sqlite-modes, or sudo rowsafe-allow sqlite-modes). Without it, the chmod is under Do it yourself. In Docker the agent changes the files itself.
  • A file in a web folder has no button: move it, or block SQLite files in the web server (the finding shows how).

Limits

  • pg_hba.conf editing needs PostgreSQL 10+, no include/include_dir, no multi-line rules, and a superuser agent (the default).
  • Docker: the agent can't change the container's files, and published ports bypass the firewall. Fix findings in your compose file.
  • trust rules stay trust after Only allow your app servers. Give those users passwords, then switch to scram-sha-256 (the finding shows how).
  • Minor versions are covered by updates, not here.
  • Row-level security is read from the catalogs only; what Rowsafe gets is table and policy names, flags, privileges and Supabase bucket names, never rows or a policy's text. "Always true" means a rule that is literally true or 1 = 1; a rule that is effectively open in another way (auth.uid() IS NOT NULL on a table everyone shares) isn't caught. Views, functions (SECURITY DEFINER) and Supabase Edge Functions aren't checked. A missing WITH CHECK isn't flagged: PostgreSQL then applies the USING rule to new rows, and an INSERT policy without one lets nothing in. At most 20 databases per server, 100 tables and 100 policies each.
Edit on GitHub