Expanding on the matter pertaining to 1984 Hosting's security issue, I want to bring a separate issue to the attention of darknet sysadmins, which is disk encryption. FDE is often discussed in the community and recommended as a default by some Linux distributions, however it is only ever mentioned in relation to personal devices and not servers. Your server is accessible at all times to your web hosting provider and the data center housing the server racks, which includes employees, contractors, and other staff belonging to or conducting business with either company. Encrypting your server's disk is fairly simple and yet each time there is breaking news of servers being seized by one government or another, the disks never appear to be encrypted. This is very likely true for most darknet sites you visit — including the ones you have open right now in your browser. While the administrators may not use your data maliciously and won't share it government actors, a physical seizure of the servers will automatically put your data into the hands of the government for an indefinite period. Each time you are using a centralized and hosted service, you are in effect trusting the administrator to secure the server and your data. However, you have absolutely no insights into what data is being collected, how often logs are rotated, how the logs are deleted, and whether the hosting provider is performing backups in the background without informing the administrator, which in turn can be detrimental if your database passwords and API keys are contained within those backups in plain text.
One major issue on the darknet is the lack of guides and discussions around actually hosting darknet sites. There are plenty of guides incessantly regurgitating the same information for darknet users and how they can browse the darknet anonymously and safely, but look for any content on actually hosting a darknet service and all you'll find is information on how to set up a new hidden service by uncommenting a few lines in /etc/tor/torrc. There are companies and organizations releasing content and (e–)books for securing servers in the corporate sector designed specifically for enterprise companies using standard enterprise tools. While they can provide some level of insight and knowledge to someone who is relatively new to the security side of administrating servers, the recommendations don't always apply to the darknet. For example, in the enterprise world it is better to retain more extensive logs while on the darknet you want that data to ideally be entirely ephemeral. The enterprise world requires a maximalist approach, the darknet a minimalist one.
There is much to learn about administrating a darknet service and it requires knowledge, experience, and expertise that doesn't come cheap. When I first hosted a darknet site, I knew relatively little about what it would actually entail in practice. I came to discover how there are really more questions than concrete answers with most answers beginning their sentence with the words "it depends". For example, whether you are even capable of encrypting your server's disk depends on whether your host even allows you to install a custom image. Many so–called cloud or compute providers display a selection of Linux distributions and their corresponding versions, which you can install with a simple click. Unfortunately, this entirely skips the actual installation process during which you get the option to encrypt and partition the available disks. The host must either allow you to boot into a recovery distribution or provide the option to install a custom image, such as the Debian net installation image. Once you have loaded the image and rebooted the server, you will need to use the console provided by the host. Some hosts provide you with IPMI access while others hand you VNC credentials or provide a VNC web interface. You will need to make use of that access to go through the installation process until you have completed the setup and installed an SSH server.
However, if your host does not permit the automatic mounting of a new ISO or simply does not provide the necessary functionality, there is the other option of using a recovery distribution. You can boot from that distribution and verify the available disk space of the recovery disk — not your main disk. Compare it with the net installation image of the Linux distribution you would like to install. If there is enough space, you can use curl or wget to fetch the image. Afterwards, you can write the .iso image to the main disk with dd. If there are existing partitions, you can use parted to delete them before writing to the main disk. In the event the recovery disk is too small, you can check how much memory the server has with top or htop. If there is sufficient memory, you can mount a temporary volume, which stores any data in memory. For example: mount -t tmpfs -o size=1G tmpfs /mnt/installer. Should neither option be available to you, you can ask the host to mount the image for you instead.
While this seems relatively rudimentary and basic, there is far more to this than you may think. First, you must keep in mind that the host is able to view any commands you enter via VNC. They may not actually log your commands, but it is crucial to remember that the host does possess the capability to do so. From the standpoint of operational security, it is wise to assume they are logging everything you type or paste into the console. As you go through the installation process, you are setting up two users accounts and disk encryption. The passwords for both the accounts and the disk(s) are entered directly through the console and can therefor be regarded as compromised. You will need to change the passwords via SSH once you have finished the installation. Additionally, you will need to add a new key slot to the LUKS encrypted disk or volume, then remove the old key, and finally you must proceed to reencrypt it. The issue here is that the header remains the same and the host can technically retain a copy of the header with the first key slot, which allows the disk to be unlocked using the password you entered into the console provided by the host. Despite removing the key slot, they can add it back and decrypt the disk even after you made changes to the disk. You therefor have to reencrypt the disk with cryptsetup reencrypt . If your disk is particularly large, it may take some time, but just let it finish.
Next up you will need to install dropbear-initramfs and set up an SSH key to unlock the main disk. Given that the main disk is encrypted, SSH is completely inaccessible as it too remains encrypted and thereby unloaded. Dropbear — specifically the dropbear-initramfs package — allows you to set up a small SSH server on the GRUB partition. As the GRUB partition is not encrypted, it loads a separate SSH server requiring a separate SSH key. You are now able to decrypt the main disk directly over SSH bypassing the need for any console.
While this is relatively simple, there are many other things worthwhile taking into consideration. This may include the specific processor model and what security features it has — such as Total Memory Encryption (TME) by Intel or Secure Encrypted Virtualization (SEV) by AMD — whether you are renting a VPS, dedicated server, or bare–metal hardware, and what motherboard the server has and what BMC it uses.
Lastly, it is important to remember that the latest and greatest security features cost money. The more features you want and the newer the hardware, the higher the price. You can very rapidly go from a 10€ per month VPS to several hundred just by modifying your requirements and selection criteria.
