Skip to content

Encryption of the data

The data of the panel can be kept encrypted on the disk. It is an optional choice: it is made from the terminal of the server, as root, on an empty disk.

What it protects

  • It protects the data while the server is off: a stolen or decommissioned disk, a copy of a virtual machine or a snapshot taken away, the disks the provider replaces. It also protects the whole stolen server, because the key is never on the server alone.
  • It does not protect the running server: whoever gets into the server, or whoever controls the hypervisor, sees the data in clear. For this the encryption of the backups (see Disaster recovery) and TLS on the connections stay separate.
  • On a server already in use the data were in clear on the system disk: after the move they are deleted, but not overwritten. The full protection is for the servers encrypted at installation.

What is encrypted

The data of the panel are encrypted: the databases and the files (the logs of CSP (Central Syslog), the archives, the backups, the files of the panel). They go on a disk of their own, encrypted, and stay visible in their usual places. The system stays in clear: Debian always starts, with the network and SSH.

The datastores of WFP (Web File), which are on disks of their own, are encrypted separately, together with the data: see The datastores of WFP.

How they open at each start

Choose the way when you encrypt; you can change it later, without encrypting again (see Changing the way of opening).

Way Option How they open
Key split with the License Server --license, the default By themselves. The key of the disk is split in two: one part stays on the server, the other is kept by the license server of Esalogica. Neither of the two opens the disk alone. It needs the license
Tang servers of your network --tang=http://tang.example.com By themselves, if the server reaches a Tang server that you manage. You can give more than one, separated by a comma: one is enough
Passphrase --passphrase By hand: after every start you log into the server and run esapanel-unlock. For a server without Internet and without Tang, or if you prefer it this way

The key split with the License Server

At each start the server asks the license server for its part, presenting its license and its addresses.

  • The part comes only from the public addresses of the server: the one it registered from and the public addresses configured on the server, IPv4 and IPv6. A server encrypted with an earlier version opens only from the address it registered from: to add the others run esapanel-data method --license once, which registers a new key and has the old one forgotten; the recovery key stays the same.
  • From another public address, for instance a server stolen and started elsewhere, the part does not come: Esalogica and the holder of the license receive a warning, and Esalogica approves the opening if the move is expected. With a public address that changes, ask Esalogica not to check it.
  • If the configured addresses of the server change, even only in the local network, Esalogica and the holder of the license receive a warning, and the part comes all the same.
  • If the server has been stolen, Esalogica revokes the key: from then on the data open only with the recovery key.
  • The part comes even when the license is no longer active.
  • The license server has a secondary: the server asks it only when the first one does not answer.

A server with LSP (License Server) or with LSPH (License Server Headless) does not use the split key: it uses Tang or the passphrase.

When the key does not come

With Tang and with the split key the server tries again for about a minute and a half after the start; then the data stay closed and the server tries again by itself every two minutes. When the key comes (the Tang server reachable again, the opening approved) the data open and the panel starts again by itself. If the key has been revoked the server does not try again.

Before you start

  • A separate empty disk, or an empty partition: without a file system, not mounted, not of the system. It must hold the data of the panel plus 20% and 1 GB. See Recommended disks.
  • For Tang, every Tang server must answer: otherwise the command stops before touching the disk.
  • For the split key, the license: on a new installation, its code with --license.

Encrypting at installation

Add --encrypt-data with the empty disk to the options of install.sh or of esapanel-setup (see Installation):

bash install.sh --modules=csp --license=ESAP-XXXX-XXXX-XXXX-XXXX --encrypt-data=/dev/sdb

You choose the way with --tang=<address> or --passphrase. If you do not, esapanel-setup run from a terminal asks you at the end how the data open (see below); in a script, without a terminal, it uses the key split with the License Server. esapanel-setup checks the disk at the start and moves the data to the encrypted disk at the end of the configuration.

Encrypting a server already in use

As root:

esapanel-data encrypt /dev/sdb

You can give the way with --license, --tang=<address> or --passphrase. Without, the command asks you:

  1. by themselves, with the key split with the License Server;
  2. Tang, and then it asks the addresses of the Tang servers;
  3. passphrase.

In a script, without a terminal, the command does not ask and uses the split key. Then the command:

  1. prepares what opens the disk (the passphrase, the Tang servers that answer, the key split with the License Server);
  2. encrypts the disk;
  3. stops the panel and the services, copies the data to the encrypted disk and checks that the copy is the same. If something stops halfway, the data stay where they were and the services start again;
  4. starts the services again and shows the recovery key.

The panel stays stopped for the time of the copy: choose a quiet moment.

The recovery key

The recovery key opens the data in every case: when the key does not come, when the passphrase is lost. The command shows it only once, when it makes it, and waits for you to confirm that you have copied it. The server does not keep it: keep it outside the server, for instance in a password manager.

To make a new one in place of the old one:

esapanel-data recovery-key

With Tang and with the passphrase it asks for the passphrase or the current recovery key.

When the data are closed

With the passphrase after every start, or when the key does not come:

  • the panel shows a page saying that the data are closed and must be opened on the server;
  • the services that use the data stay stopped: the database, the reception of the logs of CSP, the accounts of WFP. The server, SSH and fail2ban work;
  • when you log into the server, a message says that the data are closed;
  • the automatic updates do not start. An update made by hand stops with a message: open the data, then run dpkg --configure -a.

To open them, as root, from the console or with the normal SSH:

esapanel-unlock

It first tries to open them by themselves (Tang or the split key), then asks for the passphrase or the recovery key. It opens the data and starts the services.

The status

esapanel-data status

says where the data are, how they open, since when and whether they are open, with the encrypted datastores of WFP.

In the panel, on the home page of the administrator, the Encryption of the data tile shows Not encrypted or how they open (Encrypted, opened by the Tang servers of the network, Encrypted, opened with the key kept by the License Server, Encrypted, opened with a passphrase), since when, the date of the recovery key and how many datastores of WFP are encrypted. With the passphrase it reminds After every start: esapanel-unlock on the server. The panel only shows: keys and passphrase are changed from the terminal.

Changing the way of opening

esapanel-data method --tang=http://tang.example.com

or --passphrase or --license. Without options the command asks the way, like esapanel-data encrypt; without a terminal it refuses. The data open in the new way at once, without encrypting again, even while they are open. If needed, the command asks for the passphrase or the recovery key. The recovery key stays the same.

When leaving the split key, the command asks the license server to forget its part; if it does not answer the command says so, and Esalogica revokes it.

The datastores of WFP

Encrypting a datastore is a choice: a plain datastore does not need esapanel-data (see Datastores and relocation). A datastore of WFP on a disk of its own can be encrypted when the data of the panel are already encrypted and open. On an empty disk, before giving it to WFP:

esapanel-data encrypt-datastore /dev/sdc /srv/wfp/ds1
esapanel-setup --modules=csp,wfp --wfp-datastore=/srv/wfp/ds1

with --wfp-add-datastore in place of --wfp-datastore for one more datastore (see Datastores and relocation).

  • The key of the datastore is on the encrypted disk of the data: the datastore opens and closes with them, without any extra opening. The way of opening of the data applies to it too.
  • Each datastore has its own recovery key, shown once; esapanel-data recovery-key /srv/wfp/ds1 makes a new one.
  • While the datastore is closed its folder cannot be written: nothing ends up on the system disk.
  • A datastore already in use is not encrypted in place: add an encrypted one, relocate the subscriptions there and remove the old one.

Disaster recovery

The encryption does not travel with the backup of the server. On the new server, encrypt the data before or together with the restore: with --encrypt-data together with --restore the restored data go straight to the encrypted disk (see Disaster recovery). With the split key the new server has a new key.