Seite wählen

NETWAYS Blog

Verschlüsselten File-Container mittels cryptsetup und LUKS erstellen


Datenschutz wird im Jahr 2018 so groß geschrieben wie nie zuvor. Verschiedene Anforderungen an die Absicherung der Daten zwingen Admins, sich elegante und sichere Setups einfallen zu lassen. Ich nehme das zum Anlass, eine neue Serie zur Dateiverschlüsselung zu eröffnen, bei der es um die verschiedensten Möglichkeiten geht, die gespeicherten Daten gegen den Zugriff Unbefugter abzusichern.
Oftmals ist eine Verschlüsselung der Daten aufgrund bestehender Infrastrukturen oder mangels Rechten (z. B. bei extern angemieteten Storages) nicht so einfach möglich. Früher war hier ECryptFS im Linux-Umfeld und TrueCrypt bei Windows State of the Art. Heute haben sich die Anforderungen geändert und ECryptFS ist wegen einer zu restriktiven Beschränkungen der Dateinamen nicht mehr alltagstauglich. Daher stelle ich hier eine moderne Alternative mit cryptsetup in Ergänzung mit LUKS vor.

Vorbereitung

Installation von cryptsetup (Beispiel Debian-Derivate)

sudo apt-get install cryptsetup

Laden des Kernel-Moduls (nur bei initialer Einrichtung)

sudo modprobe dm-crypt

File-Container erstellen

Zunächst wird mittels dd ein File-Container mit 1GB Größe erstellt, der Wert kann natürlich je nach Anforderung angepasst werden

dd if=/dev/zero of=/storage/my_container bs=1M count=1024

File-Container mittels cryptsetup initialisieren

 cryptsetup -y luksFormat /storage/my_container

Nun die gewünschte Passphrase eingeben. Aber Achtung, ohne ein gut gewähltes Passwort nutzt die stärkste Verschlüsselung nichts!
Verschlüsselten Container öffnen und Dateisystem erstellen

cryptsetup luksOpen /storage/my_container my_mount

hier wird das Kennwort abgefragt, dies sollte man sich natürlich zuvor gut merken. Der Container ist nun unter /dev/mapper/my_mount eingebunden.  Anschließend wird ein ext4-Dateisystem in dem Container erzeugt.

mkfs.ext4 -j /dev/mapper/my_mount

File-Container am Wunschort mounten

Ordner zum mounten erstellen

mkdir /my_data
mount /dev/mapper/my_mount /my_data

Fertig – alle Daten die nun in /my_data erzeugt werden, landen am Ende verschlüsselt im Container, wie in meinem Beispiel unter /storage/my_container

Mount aushängen und File-Container schließen

Damit die Daten während der Nichtnutzung auch wirklich sicher sind, empfehle ich, den Container wieder abzuschließen.

umount /my_data
cryptsetup luksClose my_mount

Protip

Ich habe auf diese Art der Verschlüsselung bei meiner Nextcloud zurückgegriffen, da mir die Bordmittel von Nextcloud nicht gefallen, oder zu langsam sind. Im nächsten Artikel werde ich auch erklären, wie man den Container entsprechend vergrößern kann. Alle mit my_ verwendeten Variablen, können natürlich auf die jeweiligen Bedürfnisse angepasst werden.

Haben wollen?

Wir bieten natürlich bei uns im Managed-Hosting individuelle Lösungen an. Falls unsere (potentiellen) Kunden ein solches Setup wünschen, so sind wir natürlich für jeden Spaß zu haben.

Disclaimer

LUKS verwaltet die Verschlüsselungsdaten im Header. Ohne den Header (oder im Falle einer Beschädigung), ist ein Zugriff auf die Daten nicht mehr möglich. Es gibt verschiedene Tools, wie beispielsweise zuluCrypt, mit denen die Schlüssel und Header verwaltet und gesichert werden können, doch dazu in einem späteren Artikel mehr. Die Anleitung wurde nach bestem Wissen und Gewissen erstellt, testet bitte jedoch selbst ausreichend, bevor diese Lösung in die Produktion geht, damit das ihr die Funktionsweise versteht und Datenverlust vermeidet.

April Snap 2018 > OSDC, OSCamp- Speakers, NETWAYS Web Services, Slack- Notification, WordPress


Hello May!! In April we expressed our gratitude to our OSDC sponsors for their support! Nicole reviewed GitLab security update. Jean offered solutions for a personal Linux backup. Markus promised more content for NETWAYS’ Graphing training. Marius announced NETWAYS Web Services: WordPress now up and running!
Keya asked if you are going to the OSDC Berlin!! And then she urged you to Join the OSCamp on June 14! Florian talked about Was kann eigentlich CSS-Grid? Max taught us how to Synchronize configuration with lsyncd. Then we reported on NETWAYS` Support to film project of TH Nuremberg. Marius brought us up to speed on Running Icinga in NWS with Slack notifications.
Philipp talked about Hard disk benchmark with bonnie ++Pamela told you to get ready for the OSDC 2018 Berlin! Marius shared his thoughts on Anpassungen der Nextcloud Login Seite werden nicht geladen. Keya announced the OSCamp 2018 – Speakers Line-up.

Keya Kher
Keya Kher
Marketing Specialist

Keya ist seit Oktober 2017 in unserem Marketing Team. Nach ihrer Elternzeit ist sie seit Februar 2024 wieder zurück, um sich speziell um Icinga-Themen zu kümmern. Wenn sie sich nicht kreativ auslebt, entdeckt sie andere Städte oder schmökert in einem Buch. Ihr Favorit ist “The Shiva Trilogy”.  

February Snap 2018 > Icinga camp, Open Source Datacenter Conference 2018, Ceph, Braintower , NETWAYS Monitor


Freezing February !! And we froze our selection for Open Source Datacenter Conference 2018’s speaker listAlexander said Apple Pi is simple and secure, have you tried it yet? Philipp was happy to celebrate his six -month anniversary at NETWAYS with his fellow trainees Afeef and KillianJulia announced a 25% discount for Ceph training in March.
Marius showed us how to upgrade MariaDB from 10.0.x to 10.2.x. in 10 easy steps. Jean-Marcel talked about the quest for su on Windows. Lennart educated us all with Icinga 2 “Eat or Die”, the variable scope. Nicole announced detailes on the Nextcloud 13 update. Dirk recapped the Configuration Management Camp Ghent 2018.
Isabel invited you to NETWAYS – Monitor your server rooms with us! And told us about MultiTech MTD- H5-2.0 USB powered- easy SMS sending, and, also about the Braintower SMS Gateway with 2 variants. Blerim had the honor of presenting the program for the Icinga Camp Berlin 2018. And, last, but not least,Christoph wanted to Samba Samba all night!!

Keya Kher
Keya Kher
Marketing Specialist

Keya ist seit Oktober 2017 in unserem Marketing Team. Nach ihrer Elternzeit ist sie seit Februar 2024 wieder zurück, um sich speziell um Icinga-Themen zu kümmern. Wenn sie sich nicht kreativ auslebt, entdeckt sie andere Städte oder schmökert in einem Buch. Ihr Favorit ist “The Shiva Trilogy”.  

NETWAYS Web Services: Nextcloud 13 now up and running!


A lot of Nextcloud users have waited for the new Nextcloud 13 version to be available. Now our NWS team has implemented it for all Nextcloud apps on our platform.
Nextcloud 13 will bring you the following enhanced functions to your cloud:

  • Video and Text chat
  • End-to-end Encryption
  • Refined User Interface
  • Improved Performance
  • Improved File Sync and Share

Nextcloud users will now profit from a new app called Nextcloud Talk which provides an Open Source platform for audio, video and text communication in real-time as well as in asynchronous mode. Push notifications will help you to never miss a message! Absolute privacy is guaranteed by implementation of end-to-end encrypted calls that are 100% secure peer-to-peer.
Another big innovation is the End-to-End Encryption of content which can now be controlled by the users themselves. In the current Tech Preview release in version 13 it is now possible to encrypt single folders chosen by the users via their Nextcloud client. This prohibits the server side from accessing and seeing the folder or file content. The preview is available in mobile clients for Android and iOS as well as in desktop clients for Windows, Mac and Linux. Nextcloud will continue to enhance its encryption functionality over the next months.

Performance is also an important subject when it comes to the daily use of a certain software. The Nextcloud team has done a lot to make your work and collaboration faster and more comfortable by decreasing for example page load times as well as improving Server-Side-Encryption and external storage performance. For more information on performance enhancements please have a look at Nextcloud’s own blog article

For more detailed information on the new Nextcloud release you should visit the Nextcloud website or start your own Nextcloud instance on our NWS platform. Please remember that we offer a 30 day free trial period for every app!

NETWAYS Web Services: Connect to your own Domain!

Our team has continued to improve the NETWAYS Web Services products for providing more comfort to our customers. Now any app can be run under its own Domain Name in combination with its own SSL certificate. This option is available for the following products:

The implementation within the product is quite simple. After your app has been created successfully, you will find a new webform in your app’s Access tab. Here is an example of a Request Tracker app:

As the webform shows, customers simply have to enter a registered Domain Name and their SSL Certificate as well as their SSL Key. The implementation in the app will be done by our NWS platform fully automated. Customers only need to take care about the quality and correctness of the certificate and to make sure they enter the DNS record correctly on their Domain Name Server. The IP address needed will be indicated underneath the webform in the information section. Furthermore, it is still possible to set an additional CName for your app. This means that your customized Domain Name and the CName can be used in parallel. Furthermore, the platform generated standard URL will stay valid and customers can always go back to the initial settings by removing their entries from the webform.
After clicking the save button, the app will be restarted and all changes will be taken into production immediately.
The bonus of this option is clear: Anybody working with your apps will be glad to use easy to read and memorize URLs. Furthermore, company identity and culture is even more important today than ever. So why not also provide your SuiteCRM, Rocket.Chat or Nextcloud with a well branded URL?
More information can be found on our NWS homepage, in any of our product sections or by contacting us via the NWS livechat.
Important note: All NWS products are up for a 30 day free trial!