Change what Rowsafe may do on a server
Root decides what Rowsafe may do on each server; Rowsafe does it only when someone clicks and confirms.
Some actions need root (restarts, updates, reboots, a pooler, the firewall). Rowsafe does them only when someone clicks and confirms, and only if root allowed them on that server.
- Touches only the database: allowed unless root says no. Restarts, database updates (a Mark first), clusters for forks, the pooler, settings files, closing SQLite files to other users, restoring files to folders you protect.
- Touches the server: waits for root's yes. Security updates, reboots, the firewall, and a pooler on public addresses.
Root changes them on the server. In the dashboard, owners and admins turn one off in one click; turning one on needs a passkey. Examples use a server named db-1.
When you install
The installer asks once, then shows what's allowed. On a PostgreSQL server:
==> What may Rowsafe do on this server?
Rowsafe only does these when someone clicks them in your dashboard and
confirms. You can change them any time with `sudo rowsafe-allow`.
Restart or stop PostgreSQL, when someone clicks Restart or Rewind? [Y/n]
Create a new PostgreSQL cluster here (ports 5440-5499), when someone forks a database to this server? [Y/n]
Install PostgreSQL updates and upgrades, when someone clicks Update? A Mark is saved first. [Y/n]
Install this server's security updates, when someone clicks Install? [y/N] y
Reboot this server, when someone clicks Reboot? A Mark is saved first. [y/N]
Install and manage PgBouncer (connection pooling), when someone turns pooling on? Nothing is installed now. [Y/n]
Limit who can reach PostgreSQL (port 5432) with the firewall, when someone picks the addresses? SSH and other ports are never touched. [y/N]
==> What Rowsafe may do on db-1, only when someone clicks it and confirms
allowed restart restart or stop PostgreSQL (Restart, Rewind)
allowed create-cluster create a PostgreSQL cluster for a fork
allowed updates install PostgreSQL updates and upgrades
allowed security-updates install this server's security updates
allowed pooler install and manage PgBouncer (pooling)
not allowed reboot reboot this server (after an update)
not allowed pooler-public let PgBouncer listen on public addresses
not allowed firewall limit who can reach PostgreSQL (firewall)
Allow one: sudo rowsafe-allow reboot
Stop allowing one: sudo rowsafe-allow --remove restartIt asks only what applies (by database) and, when re-run, only what's new. Without a terminal (cloud-init, CI) it takes the suggested answers; override with --allow-NAME or --no-allow-NAME (options).
See and change it later
On the server, as root:
sudo rowsafe-allow # what Rowsafe may do here
sudo rowsafe-allow restart security-updates # allow these
sudo rowsafe-allow --remove reboot # stop allowing thisIt prints the new state; the dashboard shows it within a minute. Nothing else changes.
| Name | Rowsafe may | Needs | By default |
|---|---|---|---|
restart | restart, stop and start the database: Restart, and Rewind the whole database in place | allowed | |
create-cluster | create a new PostgreSQL cluster (ports 5440-5499) when you fork a database to this server | restart | allowed |
updates | install the database's minor updates and upgrade it to a new major (Updates) | restart | allowed |
security-updates | install the server's security updates | restart | asks |
reboot | reboot the server, for example after a kernel update | security-updates | asks |
pooler | install and manage the connection pooler: PgBouncer, ProxySQL or chproxy (connection pooling) | allowed | |
pooler-public | let the pooler listen on public addresses, when someone chooses that | pooler | asks |
firewall | limit who can reach the database's port (any engine) with the firewall (Security), never SSH or other ports | asks | |
tuning | MongoDB, ClickHouse, Redis and Valkey: write the settings you change under Tuning into Rowsafe's own settings file | allowed | |
sqlite-modes | SQLite: close the database files you listed to the server's other users, when someone clicks Apply fix under Security | allowed |
"Allowed" means yes is suggested (and taken without a terminal); "asks" means no is.
- Allow dependencies together:
sudo rowsafe-allow security-updates reboot. Alone,rebootwould change nothing and say so. - Turning one off turns off what needs it.
sudo rowsafe-allow --remove restartalso stops updates, security updates, reboots and new clusters. unavailablecomes with the reason, like the firewall without nftables (apt install nftablesfirst) or clusters without Debian'spg_createcluster.- Upload folders, one by one:
sudo rowsafe-allow --files /var/www/uploadsbacks the folder up and lets Rowsafe restore files there;--remove filesstops it. See Files.
In the dashboard
Under What Rowsafe may do on this server, owners and admins can:
- Turn one off in one click, no passkey (except the firewall and the public pooler). Nothing running stops; Rowsafe just can't do it anymore.
- Turn one on with a passkey paired at the server. The server checks it, so no one can allow more than root did. See one-click permissions.
Older servers need the install command once more (curl -fsSL https://rowsafe.sh | sudo sh); the dashboard says so.
By database
Same names for every engine; the installer asks only what applies.
| Name | PostgreSQL | MySQL, MariaDB | MongoDB | ClickHouse | Redis, Valkey |
|---|---|---|---|---|---|
restart | Restart, rewind in place | Restart, rewind in place | Restart | Restart | Restart |
create-cluster | new clusters for forks | ||||
updates, security-updates, reboot | yes | yes | yes | yes | yes (updates: minor updates only) |
pooler, pooler-public | PgBouncer | ProxySQL | (drivers pool) | chproxy | not yet |
firewall | yes | yes | yes | yes | not yet |
tuning | (not needed) | (not needed) | mongod.conf | config.d, users.d | not yet |
MongoDB, ClickHouse, Redis and Valkey rewind without stopping, so don't need restart for it. PostgreSQL and MySQL tune through SQL, so don't need tuning.
Some rights belong to the database's own account and are asked separately: standbys for MySQL and MariaDB (--mysql-standby) and MongoDB (--mongodb-standby), and clone targets for MongoDB (--mongodb-clones) and ClickHouse (--clickhouse-clones). See MySQL and MariaDB, MongoDB, ClickHouse.
Install options
Answer with options:
curl -fsSL https://rowsafe.sh | sudo sh -s -- --allow-restart --allow-updates --no-allow-firewallEach name has --allow-NAME and --no-allow-NAME. See the installer reference.
For configuration management, permissions-only mode (no terminal, no network):
sudo /usr/local/lib/rowsafe/install.sh --permissions --no-prompt --allow-restart --no-allow-rebootExit codes: 0 done, 2 refused and changed nothing, 1 failed while changing. The last lines show the state and any reason.
Limits
- Root decides. Rowsafe's API and AI agents can't change permissions. The dashboard turns them on only with root's paired passkey.
- Servers installed before
rowsafe-allowneedcurl -fsSL https://rowsafe.sh | sudo shonce (self-updates don't add it). Until then, use the options. - Docker: set them where the containers are defined. See Docker.
Files on the server
| Path | |
|---|---|
/usr/local/sbin/rowsafe-allow | The command (root 0755). |
/usr/local/lib/rowsafe/install.sh | Root's copy of the installer, which rowsafe-allow runs. Kept on every install and update, only after checking it against the signed release manifest. |
/etc/rowsafe/*-allowed | What root allowed (root 0644): restart-allowed, create-cluster-allowed, updates-allowed, pooler-allowed, firewall-allowed, files-allowed. The agent only reads them. |