The backup server is built on the idea that a hosting server may be broken into, and the CWP module on the idea that the backup server may be broken into. Neither side trusts the other more than it must.
What a hacked hosting server can do
- It can change or empty its own upload area, so the next snapshot is bad.
- It cannot change or delete existing snapshots, it cannot see other servers, and its API token can only read.
- Its login can start rsync and nothing else: no shell, no terminal, no port forwarding. Each session is locked into the upload area of that server.
Note: Old snapshots are still removed by retention. Keep enough daily and weekly snapshots, turn on notifications, and lock a good snapshot when you see an alert.
What a hacked backup server can do
The backup server holds no credentials of the hosting servers and cannot log in to them. A restore is always started from the hosting server. The module checks what comes back:
- Files are written as the user of the account, never as root.
- A database dump is checked against its signed checksum, then imported by a temporary MySQL user that has rights on that one database only.
- Views, triggers and routines cannot be created in the name of root or of another account.
- Restored files are scanned with ClamAV when it runs on the server. Infected files are moved to
restored/quarantine/in the home folder and listed in the task. - The API connection is pinned to the certificate of the backup server, and rsync to its SSH host key.
Harden the backup server
- Give it its own machine or VM with nothing else on it.
- Allow the panel only from your own IP addresses or a VPN: Settings → Security → Only allow these IP addresses.
- Turn on two-factor sign-in for every panel user.
- Limit each server to its own IP: Servers → (server) → Only accept this server from.
- Keep the delayed deletion above zero days and set up notifications.
- Keep the system SSH of the backup server on keys only.
- Keep a copy of the integrity key of each hosting server outside both machines.
Important: The backups are stored unencrypted on the backup server: home folders, databases, mail and, with “Server configuration”, also /etc. Treat the backup server like your most sensitive machine and use disk encryption if your provider or policy asks for it.
Panel protection
- Actions that could destroy backups ask for your password again, and for the two-factor code when it is on: deleting or unlocking a snapshot, removing a server, changing retention, lowering the waiting time for deleted snapshots, changing the notification settings, and adding or removing panel users. The confirmation holds for five minutes.
- Each of these actions sends an alert. When the notification settings are changed, the alert goes to the old addresses too.
- A lowered waiting time for deleted snapshots counts only after the old waiting time has passed, so someone who got into the panel cannot shorten it and delete at once.
- HTTPS only. Set your own certificate in Settings → Security.
- After repeated failed sign-ins the address is locked out for a while.
- Every sign-in and every change is written to the audit log.