Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31

Thread: The Performance Impact Of Linux Disk Encryption On Ubuntu 14.04 LTS

  1. #21
    Join Date
    May 2013
    Posts
    572

    Default /var/tmp et all are written to disk

    Quote Originally Posted by russofris View Post
    Probably, but the spirit of the comment also applies to places like /var/tmp and /var/log. If user FOO writes to tempfs, does anything prevent user BAR from reading it besides -r perms? Can root read it?

    For me, the bigger question is whether to use full-disk-encryption, or simply encrypt the VM using Fusion (or whatever HVisor the customer happens to use).
    On tempfs, content is lost at poweroff, preventing the MSS, FBI or other thieves from reading what was stored there. On the other hand, /var/log and /var/tmp are on disk. If logs were on RAM, you'd lose your logs at every reboot, making some things impossible to diagnose. KDE at least used to store emails in /var/tmp, a serious security issue when /home is encrpyted. A simple workaround for this is to create directories owned by root in /home and bind mount them on /var/tmp, /var/spool (print jobs, etc) and /var/log (records of what you mounted, etc). That's what I did before I switched to encrypting everything but /boot, something I did to reduce the attack surface for an enemy installing malicious software to a powered down machine.

    With only /boot encrypted, there are ways to check post-boot for tampering. You can counter that checking with a smart enough "evil maid" attack, but that requires knowing what you are up against, etc and at that point a BIOS or hardware keylogger gets easier to install. There are of course detection methods and defenses for those as well.

    Do keep in mind I use encryption to foil governmental forensics, if protecting your data from street thieves other than organized crime is your reason for encrypting a computer you may need less security than that required to defeat the FBI and Secret Service and especially less than that needed to defeat the NSA. Speaking of that, if the NSA was ever able to decrypt a randomly picked disk encrypted with AES dropped into their laps, there would soon be stories about US government and military contractors being told not to use AES anymore, for fear of other governments also finding the same crack. As of now they are permitted to use it even for Top Secret stuff.

  2. #22
    Join Date
    Aug 2007
    Location
    Norway
    Posts
    146

    Default

    Quote Originally Posted by raineee View Post
    I don't use Ubuntu & friends, but I would assume that the comment regarding to /tmp is moot; /tmp is ordinarily a tmpfs these days.
    That would be a dangerous assumption. Data in a tmpfs can be swapped out to disk in low memory conditions. If you have an unencrypted swap partition in use, then data from files, which you thought were safely gone from /tmp by the time power was cut, may still be available in raw form somewhere on the swap partition.

  3. #23
    Join Date
    May 2013
    Posts
    572

    Default Unencrypted swap is never safe with encryption

    Quote Originally Posted by oyvind View Post
    That would be a dangerous assumption. Data in a tmpfs can be swapped out to disk in low memory conditions. If you have an unencrypted swap partition in use, then data from files, which you thought were safely gone from /tmp by the time power was cut, may still be available in raw form somewhere on the swap partition.
    This is also true of any encrypted data stored anywhere you may have loaded into RAM and worked on. The key is supposed to be protected from being swapped out, but a bug in memlock combined with using only an encrypted flash drive could theoretically get a key swapped out. On an machine with unencrypted swap, run sudo swapoff -a before mounting any encrypted device
    and power down before using swap again,

  4. #24
    Join Date
    Sep 2012
    Posts
    287

    Default

    Quote Originally Posted by Luke View Post
    This is also true of any encrypted data stored anywhere you may have loaded into RAM and worked on. The key is supposed to be protected from being swapped out, but a bug in memlock combined with using only an encrypted flash drive could theoretically get a key swapped out. On an machine with unencrypted swap, run sudo swapoff -a before mounting any encrypted device
    and power down before using swap again,
    If you use full disk encryption in Ubuntu it will set up an encrypted swap.

  5. #25
    Join Date
    May 2013
    Posts
    572

    Default How does Ubuntu handle swap with ecryptfs encrypted /home?

    Quote Originally Posted by Pajn View Post
    If you use full disk encryption in Ubuntu it will set up an encrypted swap.
    I'm not sure how Ubuntu handles swap when the "encrypted user's home directory" is selected. I generally set up encryption manually onto pre-prepared encrypted partitions.

    The simplest way to fix this is to set up swap to use a non-LUKS partition encrypted with a random key and then mkswap run on it at each boot. For a machine with reasonable
    CPU speed that will ever handle encrypted volumes (/home or otherwise). this is a sound precaution and does not require an additional passphrase entry at boot.

    Another thing: if ecryptfs is so slow, Ubuntu should so encrypted /home directories by a separate /home partition using DM-crypt simply for reasons of performance. The option
    to do so would have to move to the partitioning phase, of course.

  6. #26
    Join Date
    Sep 2012
    Posts
    287

    Default

    Quote Originally Posted by Luke View Post
    I'm not sure how Ubuntu handles swap when the "encrypted user's home directory" is selected. I generally set up encryption manually onto pre-prepared encrypted partitions.

    The simplest way to fix this is to set up swap to use a non-LUKS partition encrypted with a random key and then mkswap run on it at each boot. For a machine with reasonable
    CPU speed that will ever handle encrypted volumes (/home or otherwise). this is a sound precaution and does not require an additional passphrase entry at boot.

    Another thing: if ecryptfs is so slow, Ubuntu should so encrypted /home directories by a separate /home partition using DM-crypt simply for reasons of performance. The option
    to do so would have to move to the partitioning phase, of course.
    If you set up LUKS in the installer (vary simple, check a checkbox that this partition should be encrypted and enter a passphrase) it will do that random key encrypted SWAP automatically. You can create that LUKS on /, /home or whatever you like. So Ubuntu supports both very easily.

  7. #27
    Join Date
    Mar 2013
    Posts
    49

    Default

    Quote Originally Posted by guido12 View Post
    What encryption algorithms do these use? If they're compatible, can they use Intel's AES-NI to accelerate the encryption/decryption or was it already enabled?
    Most likely AES. In the case of dm-crypt/LUKS, it just uses the kernel's crypto API, so it depends on what was enabled with that. I'm not positive, but I think AES-NI would have to be enabled at kernel compile time.

  8. #28
    Join Date
    Aug 2007
    Posts
    6,641

    Default

    Basically the unencrypted /boot partition is itself an attack vector for evil maid attacks, you could use a grub partition or use grub from EFI partition to avoid that. It does not fix the possibilty of EFI rootkits or modfied grub loaders however but changeing the initrd to store the pw after entering it is very easy. As example how to boot that way look at
    http://kanotix.com/files/fix/crypto/
    It is possible to store the pw on the encrypted part but thats optional. If you don't it works as well but you enter the pw twice. If you install with /boot or /boot/efi partition in custom mode while using luks you get the same as Ubuntu with the new installer. I would test it in a VM first...
    http://nightly.kanotix.acritox.com/latest/

  9. #29
    Join Date
    Mar 2013
    Posts
    49

    Default

    Quote Originally Posted by Kano View Post
    Basically the unencrypted /boot partition is itself an attack vector for evil maid attacks, you could use a grub partition or use grub from EFI partition to avoid that. It does not fix the possibilty of EFI rootkits or modfied grub loaders however but changeing the initrd to store the pw after entering it is very easy. As example how to boot that way look at
    http://kanotix.com/files/fix/crypto/
    It is possible to store the pw on the encrypted part but thats optional. If you don't it works as well but you enter the pw twice. If you install with /boot or /boot/efi partition in custom mode while using luks you get the same as Ubuntu with the new installer. I would test it in a VM first...
    http://nightly.kanotix.acritox.com/latest/

    Unencrypted /boot doesn't create an attack vector in the form of Evil Maid. Evil Maid works whether the data is encrypted or not, unless you're using authenticated encryption, which pretty much no FDE implementation does. XTS mode comes close enough for this attack, though (manipulating the ciphertext has unpredictable effects on the plaintext). In any case, if you want data integrerty, the answer is a MAC, not encryption.

  10. #30
    Join Date
    May 2013
    Posts
    572

    Default Password entry from GRUB transfers trust to BIOS/UEFI

    Quote Originally Posted by Kano View Post
    Basically the unencrypted /boot partition is itself an attack vector for evil maid attacks, you could use a grub partition or use grub from EFI partition to avoid that. It does not fix the possibilty of EFI rootkits or modfied grub loaders however but changeing the initrd to store the pw after entering it is very easy. As example how to boot that way look at
    http://kanotix.com/files/fix/crypto/
    It is possible to store the pw on the encrypted part but thats optional. If you don't it works as well but you enter the pw twice. If you install with /boot or /boot/efi partition in custom mode while using luks you get the same as Ubuntu with the new installer. I would test it in a VM first...
    http://nightly.kanotix.acritox.com/latest/
    The value of this depends on the kind of attack you expect. It reduces the danger of an evil maid attack, but increases the danger from a pre-existing malicious BIOS. Assume an attacker who does not already know your computer expects you to be using Windows. With Truecrypt using the BIOS/UEFI keyboard driver during bootloader to unlock the disk, the author of a malicious BIOS might not bother with adding code to keep the keyboard driver running and logging after the kernel takes over keyboard entry. In a UEFI machine he might not bother to prevent ExitBootServices from functioning due to added work and detectability. In DM-crypt/LUKS, if the firmware keyboard driver is not running, a simplest-code bug in it will miss the passphrase entirely because unlike in Truecrypt the full Linux kernel loads first and takes over the keyboard driver function.

    Of course, if someone with no access to the machine before you got it is the only possible attacker, this situation changes. For encryption against state-level attackers the BIOS is not trusted, against a thief in a hotel room after credit card numbers it may well be, barring a thief that can visit once to identify your board, again to reflash your BIOS, and a third time to harvest the machine and all it's data. A hardware keylogger is easier than this, even in a laptop. If you suspect that kind of danger, epoxy the keyboard down on laptops, nobody can cut the glue without leaving obvious marks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •