summary refs log tree commit diff
path: root/nixos/modules/system/boot/luksroot.nix
Commit message (Collapse)AuthorAge
* nixos: initrd/luks: fix detection of devices by UUIDBen Wolsieffer2018-10-11
|
* nixos: initrd/luks: make script indentation consistentBen Wolsieffer2018-10-11
|
* nixos: initrd/luks: make uuid specified devices discoverableEdward Tjörnhammar2018-09-24
|
* reewide: Purge all uses `stdenv.system` and top-level `system`John Ericson2018-08-30
| | | | It is deprecated and will be removed after 18.09.
* nixos: initrd/luks: disable input echo for the whole stageJan Malakhovski2018-08-08
|
* nixos: initrd/luks: simplify Yubikey handling codeJan Malakhovski2018-08-08
| | | | | | | | | | | | From reading the source I'm pretty sure it doesn't support multiple Yubikeys, hence those options are useless. Also, I'm pretty sure nobody actually uses this feature, because enabling it causes extra utils' checks to fail (even before applying any patches of this branch). As I don't have the hardware to test this, I'm too lazy to fix the utils, but I did test that with extra utils checks commented out and Yubikey enabled the resulting script still passes the syntax check.
* nixos: initrd/luks: change passphrases handlingJan Malakhovski2018-08-08
| | | | | | | | | | | Also reuse common cryptsetup invocation subexpressions. - Passphrase reading is done via the shell now, not by cryptsetup. This way the same passphrase can be reused between cryptsetup invocations, which this module now tries to do by default (can be disabled). - Number of retries is now infinity, it makes no sense to make users reboot when they fail to type in their passphrase.
* nixos: initrd/luks: cleanup and generalize common shell expressionsJan Malakhovski2018-08-08
| | | | Also fix Yubikey timeout handling mess.
* luksroot: Add missing quote (#44639)Edmund Wu2018-08-07
|
* nixos/luksroot: Support keyfile offsetsJanne Heß2018-08-07
|
* modules/system/boot/luksroot: remove comment about input_leds for caps lockFlorian Klink2018-05-07
| | | | | Since f2a9f9aeab5016d28ab4bcf6da81924ceecdd676, we already load "input_leds", so this comment isn't useful anymore.
* Merge pull request #30416 from symphorien/luksnokeyFranz Pletz2018-03-05
|\ | | | | nixos/luksroot.nix: fallback to interactive password entry when no keyfile found
| * luksroot.nix: rename fallback to fallbackToPasswordSymphorien Gibol2017-12-14
| |
| * nixos/luksroot.nix: add option boot.initrd.luks.devices.<name?>.fallbackSymphorien Gibol2017-10-23
| | | | | | | | | | | | | | | | This option, if set to true, enables fallbacking to an interactive passphrase prompt when the specified keyFile is not found. The default is false, which is compatible with previous behavior and doesn't prevent unattended boot.
| * nixos/luksroot.nix: fallback to interactive password entry when no keyfile foundSymphorien Gibol2017-10-14
| |
* | attempt to fix #30940 more robustlyAristid Breitkreuz2018-02-26
| |
* | luksRoot: add the missing ECB dependency to fix XTS support, resolves #30940Evgeny Egorochkin2017-12-22
| |
* | boot.initrd.luks: add input_leds moduleFlorian Klink2017-12-19
|/ | | | | | | To get working caps lock lights already at stage 1, the input_leds module needs to be loaded. Closes #12456.
* nixos/fileystems: Fix boot fails with encrypted fsAndré-Patrick Bubel2017-09-14
| | | | | | | | | | | Boot fails when a keyfile is configured for all encrypted filesystems and no other luks devices are configured. This is because luks support is only enabled in the initrd, when boot.initrd.luks.devices has entries. When a fileystem has a keyfile configured though, it is setup by a custom command, not by boot.initrd.luks. This commit adds an internal config flag to enable luks support in the initrd file, even if there are no luks devices configured.
* luksroot: fix typoSilvan Mosberger2017-07-02
|
* nixos/luks: Silence killall complain about non-existing cryptsetup processesRickard Nilsson2017-05-16
|
* luksroot: Wait for the header (device) to appearMichael Weiss2017-04-05
| | | | | | | | | The LUKS header can be on another device (e.g. a USB stick). In my case it can take up to two seconds until the partition on my USB stick is available (i.e. the decryption fails without this patch). This will also remove some redundancy by providing the shell function `wait_target` and slightly improve the output (one "." per second and a success/failure indication after 10 seconds instead of always printing "ok").
* ykpers: consolidate into yubikey-personalizationBenjamin Staffin2017-03-11
| | | | Looks like this accidentally got packaged twice.
* luksroot module: optionSet -> submoduleEric Sagnes2016-09-13
|
* nixos/luksroot: Reference correct output of opensslTuomas Tynkkynen2016-08-04
|
* Revert "nixos stage-1: try to quit plymouth if started on failure"Nikolay Amiantov2016-07-17
| | | | | | | | This reverts commit c69c76ca7efecba24aba555c2a03f933997d1fd5. This patch was messed up during a rebase -- the commit title doesn't match what it really does at all (it is actually a broken attempt to get LUKS passphrase prompts in Plymouth).
* nixos stage-1: try to quit plymouth if started on failureNikolay Amiantov2016-07-12
|
* Merge branch 'master' into stagingVladimír Čunát2016-05-26
|\ | | | | | | ... to get the systemd update (rebuilding ~7k jobs).
| * boot.initrd.luks.devices: Change into an attribute setEelco Dolstra2016-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows setting options for the same LUKS device in different modules. For example, the auto-generated hardware-configuration.nix can contain boot.initrd.luks.devices.crypted.device = "/dev/disk/..."; while configuration.nix can add boot.initrd.luks.devices.crypted.allowDiscards = true; Also updated the examples/docs to use /disk/disk/by-uuid instead of /dev/sda, since we shouldn't promote the use of the latter.
* | treewide: Make explicit that 'dev' output of openssl is usedTuomas Tynkkynen2016-05-19
|/
* treewide: Mass replace 'openssl}/bin' to refer the 'bin' outputTuomas Tynkkynen2016-02-01
|
* treewide: Mass replace 'openssl}/lib' to refer the 'out' outputTuomas Tynkkynen2016-01-24
|
* Add missing 'type', 'defaultText' and 'literalExample' in module definitionsThomas Strobel2016-01-17
| | | | | | - add missing types in module definitions - add missing 'defaultText' in module definitions - wrap example with 'literalExample' where necessary in module definitions
* nixos/luksroot: allow to enter passphrase from another consoleNikolay Amiantov2015-10-18
|
* nixos/luksroot: use 'nuke-refs -e' option to simplify thingsNikolay Amiantov2015-10-18
|
* nixos: fix some typesJan Malakhovski2015-09-18
|
* nixos/modules/system/boot/luksroot.nix: allow for LUKS devices with detached ↵Marcin Falkiewicz2015-06-29
| | | | header
* Some more type cleanupEelco Dolstra2015-06-15
|
* Style fixEelco Dolstra2015-05-04
|
* TypoEelco Dolstra2015-05-04
|
* nixos/initrd: Generic library copyingWilliam A. Kennington III2015-03-28
|
* fix initrd now that cryptsetup switched to libgcrypt 1.6Aristid Breitkreuz2015-03-28
|
* nixos/modules/system/boot/luksroot.nix: hyperlinkify an URL in the documentationPeter Simons2014-12-15
|
* Remove useless use of optionSet.Nicolas Pierron2014-08-29
|
* /dev/sda1 -> "/dev/sda1"Eelco Dolstra2014-08-26
| | | | | Otherwise Nix might try to copy /dev/sda1 under certain circumstances :-)
* Rewrite ‘with pkgs.lib’ -> ‘with lib’Eelco Dolstra2014-04-14
| | | | | | | | Using pkgs.lib on the spine of module evaluation is problematic because the pkgs argument depends on the result of module evaluation. To prevent an infinite recursion, pkgs and some of the modules are evaluated twice, which is inefficient. Using ‘with lib’ prevents this problem.
* Update to the Yubikey PBAMoritz Maxeiner2014-02-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Security-relevant changes: * No (salted) passphrase hash send to the yubikey, only hash of the salt (as it was in the original implementation). * Derive $k_luks with PBKDF2 from the yubikey $response (as the PBKDF2 salt) and the passphrase $k_user (as the PBKDF2 password), so that if two-factor authentication is enabled (a) a USB-MITM attack on the yubikey itself is not enough to break the system (b) the potentially low-entropy $k_user is better protected against brute-force attacks * Instead of using uuidgen, gather the salt (previously random uuid / uuid_r) directly from /dev/random. * Length of the new salt in byte added as the parameter "saltLength", defaults to 16 byte. Note: Length of the challenge is 64 byte, so saltLength > 64 may have no benefit over saltLengh = 64. * Length of $k_luks derived with PBKDF2 in byte added as the parameter "keyLength", defaults to 64 byte. Example: For a luks device with a 512-bit key, keyLength should be 64. * Increase of the PBKDF2 iteration count per successful authentication added as the parameter "iterationStep", defaults to 0. Other changes: * Add optional grace period before trying to find the yubikey, defaults to 2 seconds. Full overview of the yubikey authentication process: (1) Read $salt and $iterations from unencrypted device (UD). (2) Calculate the $challenge from the $salt with a hash function. Chosen instantiation: SHA-512($salt). (3) Challenge the yubikey with the $challenge and receive the $response. (4) Repeat three times: (a) Prompt for the passphrase $k_user. (b) Derive the key $k_luks for the luks device with a key derivation function from $k_user and $response. Chosen instantiation: PBKDF2(HMAC-SHA-512, $k_user, $response, $iterations, keyLength). (c) Try to open the luks device with $k_luks and escape loop (4) only on success. (5) Proceed only if luks device was opened successfully, fail otherwise. (6) Gather $new_salt from a cryptographically secure pseudorandom number generator Chosen instantiation: /dev/random (7) Calculate the $new_challenge from the $new_salt with the same hash function as (2). (8) Challenge the yubikey with the $new_challenge and receive the $new_response. (9) Derive the new key $new_k_luks for the luks device in the same manner as in (4) (b), but with more iterations as given by iterationStep. (10) Try to change the luks device's key $k_luks to $new_k_luks. (11) If (10) was successful, write the $new_salt and the $new_iterations to the UD. Note: $new_iterations = $iterations + iterationStep Known (software) attack vectors: * A MITM attack on the keyboard can recover $k_user. This, combined with a USB-MITM attack on the yubikey for the $response (1) or the $new_response (2) will result in (1) $k_luks being recovered, (2) $new_k_luks being recovered. * Any attacker with access to the RAM state of stage-1 at mid- or post-authentication can recover $k_user, $k_luks, and $new_k_luks * If an attacker has recovered $response or $new_response, he can perform a brute-force attack on $k_user with it without the Yubikey needing to be present (using cryptsetup's "luksOpen --verify-passphrase" oracle. He could even make a copy of the luks device's luks header and run the brute-force attack without further access to the system. * A USB-MITM attack on the yubikey will allow an attacker to attempt to brute-force the yubikey's internal key ("shared secret") without it needing to be present anymore. Credits: * Florian Klien, for the original concept and the reference implementation over at https://github.com/flowolf/initramfs_ykfde * Anthony Thysse, for the reference implementation of accessing OpenSSL's PBKDF2 over at http://www.ict.griffith.edu.au/anthony/software/pbkdf2.c
* Replace the current Yubikey PBA implementation with the previous one.Moritz Maxeiner2014-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationale: * The main reason for choosing to implement the PBA in accordance with the Yubico documentation was to prevent a MITM-USB-attack successfully recovering the new LUKS key. * However, a MITM-USB-attacker can read user id and password when they were entered for PBA, which allows him to recover the new challenge after the PBA is complete, with which he can challenge the Yubikey, decrypt the new AES blob and recover the LUKS key. * Additionally, since the Yubikey shared secret is stored in the same AES blob, after such an attack not only is the LUKS device compromised, the Yubikey is as well, since the shared secret has also been recovered by the attacker. * Furthermore, with this method an attacker could also bruteforce the AES blob, if he has access to the unencrypted device, which would again compromise the Yubikey, should he be successful. * Finally, with this method, once the LUKS key has been recovered once, the encryption is permanently broken, while with the previous system, the LUKS key itself it changed at every successful boot, so recovering it once will not necessarily result in a permanent breakage and will also not compromise the Yubikey itself (since its secret is never stored anywhere but on the Yubikey itself). Summary: The current implementation opens up up vulnerability to brute-forcing the AES blob, while retaining the current MITM-USB attack, additionally making the consequences of this attack permanent and extending it to the Yubikey itself.
* Add library dependencies explicitlyMoritz Maxeiner2014-01-29
|
* Implement muli-user authentication for yubikey pba, i.e. multiple users can ↵Moritz Maxeiner2014-01-29
| | | | | | | | now share a single luks keyslot. This is achieved by having multiple lines per storage file, one for each user (if the feature is enabled); each of these lines has the same format as would be the case for the userless authentication, except that they are prepended with a SHA-512 of the user's id.