Chuyển tới nội dung chính

How backups are protected

Once a day the server makes a copy of itself, encrypts it on the server and sends only the encrypted data to Qubix storage. The key that encrypts it is made by the server and saved by you outside the server. Qubix never receives this key, so without it nobody can open the backups.

This article explains how that works. The steps on the screen are in Backups, Backup keys and Restoring from a backup; the words of pauses and stops are in Why backups pause, stop or fail.

What a snapshot holds​

The copy of the whole server at one moment is called a snapshot. It holds:

  • the main data of the panel: people, logins, rights, history and the rest, together with the files of comments;
  • the data of the sections that keep their own databases, such as TeleQube;
  • the files of QubDrive, the recordings of calls and the files attached in TeleQube;
  • the latest export of mail;
  • the data of search by meaning and the queue of its work;
  • the other files of the server that no part above names, shown on the restore sheet as Other files and folders.

The backup key and the disk key are not in a snapshot: they lie in a folder that no snapshot takes, so a restored snapshot never brings an old key back over a new one. The journal of backup runs and the hardware measurements and system events of the server are left out as well. The same list gives the parts you can choose from when you restore; the table of the parts is in Backups.

When a backup is made​

  • Every day at the time set in Start time (UTC). With Automatic Qubix derives the time from the licence number within 00:00–06:00 UTC, so that the backups of different installations do not all begin together.
  • Only after the backup key is marked saved. Until then the server makes no backups.
  • At any moment with Back up now on the Backups tab of the Hệ thống window.

After the first backup each next one sends only what is new since the previous one. Every snapshot is complete all the same: any of them restores on its own. After each backup the snapshots beyond the counts Daily snapshots kept, Weekly snapshots kept and Monthly snapshots kept are removed; the defaults are 7, 4 and 6. A smaller count is saved only with your current password, because the next backup removes the extra snapshots.

Encryption before anything is sent​

The encryption happens on your server, in the backup program of Qubix, before the first byte leaves it.

  • The data, the names of files and folders and the other details of a snapshot are encrypted with AES-256. Every stored piece also carries a check value (a keyed BLAKE2b-256 checksum), so a piece that was changed or damaged is noticed instead of being read.
  • The backup key goes only to the backup program on the same server. The connection to the storage does not carry it.
  • The encrypted data goes over an SSH connection, which protects it once more on the way. The server signs in with a key pair of its own that the backup program made; the private half stays on the server. The program checks the identity of the storage against a list of known key fingerprints, and a storage that cannot prove its identity gets no connection.
  • Besides the encrypted data, the storage holds the public half of the server's SSH key and copies of the settings of the backup set; the inner key of the backup set in those settings is encrypted with the backup key too. The Qubix services that tell the server where the backups go and measure how much room they take never get the key. The request of the server for the place of the backups carries the licence data, the public half of the SSH key of the backup program and service fields of the run; the backup key is not in it. The request is recorded in the Verification journal tab with the kind Backups.

The backup key​

  • Who makes it. The server, by itself, once the backup program runs and the storage service names the storage. The key is random, 160 bits long, written as 32 characters: letters A–Z and digits 2–7 in eight groups of four.
  • Where it lies. In a file on the server in a folder outside every snapshot; the file is readable only by the system account that runs Qubix. The server needs it for the daily backups. The disks of a rented server are encrypted, so there the file lies on an encrypted disk (see Disk encryption).
  • How you get it. The Save the keys screen shows the key until you mark it saved. Download as a file saves the file qubix-keys.txt with the key, the licence number and the time of saving; the switch Saved outside this server unlocks after the download. Once the switch is on, the key is not shown again.
  • Who keeps it. You. Save the file outside the server: it is the only copy that survives the loss of the server, because no snapshot holds the key.
  • What Qubix has. No key. Neither the licensing service nor the storage service of Qubix has the backup key, and the AI assistant does not see it either: the key and the password are typed in the panel and go straight to the server.
  • Without the key. Nobody can open the backups. When the saved key of the snapshots already in the storage is lost, the way forward is a new chain, described below.

Changing the key and starting a new chain​

Inside the backup set lies a key that really encrypts the data. The backup key encrypts this inner key in its turn. That is why the two actions differ.

Change the keyNew chain
What it doesMakes a new key for the same snapshots.Removes every previous snapshot of the licence and starts the series again with a new key.
ConfirmationA confirmation window.Your current password.
The snapshotsStay.Are removed.
When the new key appliesWhen it is marked saved; until then the backups use the current key.The same.
Choose itTo replace the key when nothing is in doubt.When the key has leaked, or when the saved key of the snapshots in the storage is lost.

A change does not encrypt the data anew: it replaces only the key that opens the snapshots. If the old key has leaked, a change therefore does not close the snapshots already made, and the way to close them is a new chain, which removes them and begins from empty storage with a new key.

A new chain removes all previous snapshots

When the new key is marked saved, every earlier snapshot of the licence is deleted from Qubix storage.

The steps are in Backup keys.

Where the backups lie​

The backups lie in Qubix storage. Every licence has its own place there, and the server signs in to it with its own key.

  • How much. 400 GB are included in every licence. The Used row of the Backups tab shows how much is taken.
  • What Qubix measures. How much room the encrypted data takes: the limit is applied by that number.
  • When the limit comes near. Before each backup the server counts the snapshots plus the expected size of the next backup. While they would pass the limit, the oldest snapshots are removed one by one. The newest snapshot always stays: when it alone leaves no room for the next backup, the run stops with Storage limit too small.

Checks​

The snapshots are checked by themselves.

  • Check verifies that the snapshots in the storage are consistent. It runs every 7 days by default (Check every).
  • Full check reads every snapshot through. It takes longer and runs every 30 days by default (Full check every).

Both open the snapshots, so they use the backup key as well. The value 0 switches a check off. Each button on the Backups tab starts the same check at once, and the result goes into the Run journal.

Restoring​

On the same server​

The restore sheet (Restore…) takes a snapshot, then The whole box or the parts you choose; everything else stays as it is today. The decision is confirmed with your current password. No copy of the present state is made first: the chosen parts are replaced by the snapshot, so make Back up now before you restore when today's state matters.

Qubix first checks that the snapshot reads and that the server has room for the chosen parts; if a check refuses, nothing is touched. The data that is being replaced is set aside, not deleted, until the whole restore has gone through. If a part fails, its data is put back. When the main data, the search data or the data of sections comes back, Qubix starts again on the restored data.

A restore works when the storage has stopped new backups: the snapshots already there stay readable.

On a new server​

The backups belong to the licence, not to a server. A new server with the same licence finds them by the licence number and needs the key.

The installation wizard never asks for the key: it works over plain HTTP, where a key would travel in the open. The panel asks for it after the installation, over HTTPS. The key you enter replaces any key the new server made for itself, and the later backups of the new server go into the same chain. On the first screen of the wizard you can choose to start from scratch instead, and the key screen has Start from scratch for the same. The steps are in Create an administrator and Restoring from a backup; the way to enter a key is in Backup keys.

When the licence or the storage is not paid​

What is not paidWhat happens to the backups
The licence (Licence not paid)New backups stop. The snapshots stay readable and can be restored; they are kept for 30 days after the licence went unpaid and then deleted. When the licence is paid within that time, backups go on.

Backups and disk encryption​

These are two protections for two different cases. Disk encryption protects the data on the disks of a rented server if the disks end up outside the server; backup encryption protects the copies that lie outside the server. Each has its own key. When the server holds a disk key, the Save the keys screen shows it as a second row, Disk key, and the file qubix-keys.txt keeps both keys. How the disk opens after a reboot is described in Disk encryption: the block Disk encryption stands on the Máy chủ tab of the Cài đặt Qubix window.

What's next​