Hardening checklist
A checklist of concrete steps to reduce the risk of a Raft DB installation, given that it has no TLS and no audit log.
Every item below is something the software supports today. Items that need features Raft DB does not have are in the last section, so you know what you cannot do.
Network#
-
raftdb-serverandraftdb-mysqllisten on loopback unless a remote client needs them. - If a port serves the network, a firewall limits it to the machines that need it, and the path is a private network or a tunnel.
- The SQL front-end runs in the same process as the server (
embed), so the server's port stays on loopback. - The watcher's
status_portis left on loopback (it cannot be anything else). -
udpis off unless you measured a need for it. -
corsis empty, or lists exact origins; never*on a server that is not open and never on an open one. -
allow-remote-serversis off. - The Studio is not reachable from the Internet.
Accounts#
- No
open. No account whose password is in a document or a script you shared. -
admin.passwordis read-only for its owner; nobody else can read the data directory. - Applications use
readwrite(orreadonly) accounts, limited with@DATABASE, neveradminand never the sharedtoken. - The watcher uses its own account;
probe_write = falseandreadonlyif you want it unable to write. - The SQL front-end's
raftdb_userhas a long random password used nowhere else. - MySQL accounts for applications are made with
CREATE USERand limited withGRANTto their own database; bootstrap administrators are few, and their passwords are long. - Passwords in
mysql.confcontain no#; the file is readable only by the service user. - Settings files with passwords are not world-readable; passwords are not on command lines (they show in the process list).
- Every node of a cluster has the same
userlines (accounts are not replicated), and thecontrolaccount has a password no application knows.
Processes and files#
- Each process runs as its own unprivileged user.
install-servicemakes the userraftdband a sandboxed unit. - The data directory is owned by that user and has no access for others.
- Only one server runs per data directory.
- The watcher may run exactly one privileged command (
systemctl restart raftdbthroughsudoers), and itscleanup_commandnever touches the data directory. - Error reports stay local (
RAFTDB_ERROR_REPORT_URLand_COMMANDunset), or are sent to an endpoint you control through a script that uses HTTPS. -
RAFTDB_MYSQL_TRACEis off (it logs statements with their passwords).
Data#
- Disks are encrypted, if the data requires it.
- Backups are made, copied elsewhere and restore-tested; they are protected like the data (Backup and recovery).
- The watcher is running and its notifications reach a person.
Application side#
- Parameters are sent as prepared-statement parameters: a value cannot change a statement's structure.
- The application does not rely on
SELECT ... FOR UPDATE,LOCK TABLESor an isolation level: only the per-table claim of writing transactions is enforced. - Connection strings turn TLS off explicitly (so a driver does not fail or fall back unexpectedly) and go through a tunnel when the network is not private.
What you cannot do yet#
| Wish | Why not |
|---|---|
| Encrypt client or node traffic | No TLS (TLS and encryption). |
| Lock an account after failed logins; slow down MySQL password guessing | No lockout, no delay on the MySQL side. Limit who can reach the port. |
| Audit who ran what | No audit log. |
| Expire passwords, require strong passwords, rotate without a restart (server accounts) | Not built. |
| Use roles, row-level security, routine privileges | Refused (roles, routine privileges) or not present. |
| Restrict by client certificate | REQUIRE X509 is refused. |
| Replicate accounts | Not built; every node needs the same settings. |
| Encrypt data at rest in the database | Use the operating system. |