Ok, another question for #Linux users. I have all my storage on #luks 2 encrypted volumes with #cryptsetup . I like to be able to shut off one harddrive (which is in a bay with a switch.) I had a nice little script to unmount, close the volume, and then put the drive to sleep so I could safely shut it off. But recently cryptsetup has been failing to actually close volumes. I suspect it's because I enabled the KVM module after I ran across this: https://alext.mail.at/post/cryptsetup-close-crypt-fails-with-device-crypt-is-still-in-use So probably a namespace.

The problem is I have no clue how to use that... I can't find whatever is holding it and can't unlock it.

What I really need is something I can put in that script...

I don't really want to disable the KVM module just for that.

EDIT: I have lsof all up the wazoo. It finds nothing.

cryptsetup close CRYPT Fails With "Device CRYPT is still in use." - Alex Debugs!

Alex Debugs!

I documented how I replaced the Debian crypttab `keyscript` with systemd socket activation:

https://anisse.astier.eu/keyscript-to-socket-activation.html

#systemd #Debian #Ubuntu #LUKS #cryptsetup #perl

Replacing Debian keyscript with systemd socket activation for encrypted volumes - Linux Engineer's random thoughts

In Debian (and Ubuntu), when using a LUKS encrypted volume with cryptsetup, there is a documented option in the manpage for /etc/crypttab called keyscript: it should allow the init system to launch a program and have its standard output used as a key to unlock a volume. But there …

Bonus: I can wake up the desktop through Home Assistant.

And with VPN through Wireguard I then have access to my desktop system, its files and services that I need in rare cases.

I used this article
https://www.cyberciti.biz/security/how-to-unlock-luks-using-dropbear-ssh-keys-remotely-in-linux/ from [email protected] . Thank you.

2/n

#homeassistant #cryptsetup #dropbear #ubuntu

How to unlock LUKS using Dropbear SSH keys remotely in Linux - nixCraft

Explains how to unlock LUKS encrypted disk using Dropbear SSH keys remotely in Linux when you don't have access to the KVM console.

nixCraft

Today's desktop computer challenge: For the case I need access to my home desktop from remote, I trigger boot through wake on LAN and then remotely unlock the encrypted hard disks through SSH.

The challenge: Two encrypted hard disks. Solution: For the second hard drive add a key file located on the first hard disk as additional slot through cryptsetup, update the configuration in `/etc/crypttab`. Done.

1/n

#ubuntu #dropbear #cryptsetup #wol

Cryptsetup 2.8.5 stable version released
https://gitlab.com/cryptsetup/cryptsetup#download

It includes fixes for FileVault metadata parsing, fixes to alternative Meson configuration and many other bugfixes and code hardening.

Full release notes https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.8/v2.8.5-ReleaseNotes

#cryptsetup
cryptsetup / cryptsetup · GitLab

Cryptsetup and LUKS - open-source disk encryption

GitLab
Cryptsetup 2.8.4 stable version released
https://gitlab.com/cryptsetup/cryptsetup#download

The 2.8.4 includes fixes for displaying size in status, resizing integrity device and activation of BitLocker devices.

Release notes https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.8/v2.8.4-ReleaseNotes

#cryptsetup
cryptsetup / cryptsetup · GitLab

Cryptsetup and LUKS - open-source disk encryption

GitLab
cryptsetup 2.8.3 stable version released
https://gitlab.com/cryptsetup/cryptsetup#download
It includes fix-for-fix in 2.8.2 :-)
The 2.8.2 includes minor fixes and improvements to BitLocker-compatible support.

Release notes https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.8/v2.8.3-ReleaseNotes

#cryptsetup
cryptsetup / cryptsetup · GitLab

Cryptsetup and LUKS - open-source disk encryption

GitLab
Cryptsetup 2.8.2 stable version released
https://gitlab.com/cryptsetup/cryptsetup#download
It includes minor fixes and improvements to BitLocker-compatible support.

Release notes https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.8/v2.8.2-ReleaseNotes

#cryptsetup
cryptsetup / cryptsetup · GitLab

Cryptsetup and LUKS - open-source disk encryption

GitLab

#linux #cryptsetup #luks are there any practices surrounding rotating the volume key using `cryptsetup reencrypt <cryptvolume>`?

IIUC, when the header is stolen it is possible to determine exactly which key/passphrase is the correct one. So by exfiltrating the header alone, one could theoretically start cracking. So reencrypting would prevent a stolen header from being useful for too long a long time afterwards.

Granted, it is a bit hypothetical. #security #encryption #confidentiality

Компьютер с полностью шифрованным SSD/NVMe?
Вполне полноценно через
#LUKS — рабочее решение, без дырок от вендоров для криминалистов (#forensics).
Т.е. получается комп на
#Linux с файловой системой #btrfs на «жёстком диске» с LUKSv2 для шифрования. Годно и для игр и для нескольких лет работы.

Именно вторая версия LUKS ради другой
#PBKDF — обработке вводимого пароля через #argon2id в рамках #PBKDF2 для извлечения ключа шифрования из заголовка раздела на «диске».

Суеверные люди предпочитают молчать о том, как работают их сложные и навороченные системы. Однако, когда прошло несколько лет эксплуатации, то можно просто констатировать как свершившийся факт качество работы системы.

Ноутбуки иногда теряются или крадутся, а из десктопов не всегда удаётся извлечь носитель («диск»). Оперативно-следственные службы не всегда добросовестно опечатывают технику при изъятии и абы кто может докинуть на ваши носители данных непонятно какие материалы, перед тем как устройства поступят в «ЭКЦ МВД России».

И помните, что если следователь показывает распоряжение о проведении экспертизы содержимого ваших носителей данных. Требуя при этом предоставить пароль, то знать о наличии пароля он как бы и не должен. А может оказаться в курсе лишь в том случае, если на этом постановлении имеется отметка от ЭКЦ о приёме на экспертизу ваших устройств.
А если же такой отметки нету, то значит следак в курсе неудачной попытки что-то эдакое подкинуть на ваши носители данных. Т.е. устройства ваши находятся всё ещё у него в закромах, а не были переданы в ЭКЦ. И если выдать пароль, то неизвестно что нового появится на них перед отправкой в ЭКЦ.

#cryptsetup #Argon2 #FDE #crypto #криптография #security #ИБ #infosec