Skip to content

Unlock Bitlocker encrypted volumes#450

Open
petrutlucian94 wants to merge 5 commits into
cloudbase:masterfrom
petrutlucian94:bitlocker
Open

Unlock Bitlocker encrypted volumes#450
petrutlucian94 wants to merge 5 commits into
cloudbase:masterfrom
petrutlucian94:bitlocker

Conversation

@petrutlucian94
Copy link
Copy Markdown
Member

@petrutlucian94 petrutlucian94 commented Jun 3, 2026

Just like in case of LUKS (#436), we'll let Coriolis users specify a BitLocker recovery password.

At the very least it should unlock the OS volume, however it may be used for other encrypted volumes as well. If no encrypted volume could be unlocked using the specified key, Coriolis will error out.

In addition to that, we'll temporarily suspend BitLocker on the specified volumes. It won't decrypt the volumes, it merely adds a publicly accessible protector that allows the replica instance to boot.

Once the replica instance boots, BitLocker will be resumed automatically and the TPM protector will be reconfigured.

While at it, we'll use oslo_utils.strutils.mask_password and oslo_utils.strutils.mask_dict_password in various places to avoid logging sensitive information, such as the Bitlocker recovery key.

@petrutlucian94 petrutlucian94 marked this pull request as draft June 3, 2026 12:23
@petrutlucian94 petrutlucian94 marked this pull request as ready for review June 3, 2026 13:19
@petrutlucian94 petrutlucian94 force-pushed the bitlocker branch 2 times, most recently from f50bb18 to aeb63af Compare June 3, 2026 16:43
Just like in case of LUKS (cloudbase#436),
we'll let Coriolis users specify a BitLocker recovery password.

At the very least it should unlock the OS volume, however it may
be used for other encrypted volumes as well. If no encrypted
volume could be unlocked using the specified key, Coriolis will
error out.

In addition to that, we'll temporarily suspend BitLocker on the
specified volumes. It won't decrypt the volumes, it merely adds a
publicly accessible protector that allows the replica instance to
boot.

Once the replica instance boots, BitLocker will be resumed automatically
and the TPM protector will be reconfigured.
@petrutlucian94 petrutlucian94 force-pushed the bitlocker branch 2 times, most recently from bb070d2 to 30d2d48 Compare June 5, 2026 13:58
Unfortunately the "-RebootCount" parameter of "Suspend-BitLocker"
isn't honored, perhaps due to the fact that the disks are attached
to a different VM.

For this reason, we'll inject a first-boot script to resume
BitLocker explicitly.
Comment thread coriolis/osmorphing/osmount/windows.py
Comment thread coriolis/osmorphing/osmount/windows.py
Comment thread coriolis/osmorphing/osmount/windows.py
"Could not unlock volume %s using the specified "
"recovery password.",
encrypted_volume_id)
continue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are talking about encrypted data here. Shouldn't we panic / raise a bit more if this is the case? If this is the case (this exception occured for the additional disks), and we proceed with the OS morphing and replica start, we'll see the VM start and consider that a success, but the other disks are still locked. If the disks are TPM-locked, can they still be recovered / unlocked, if a recovery password was not set up beforehand?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, we mainly care about the OS drive. In most cases, Windows group policies won't even allow re-using the same password for multiple disks.

Comment thread coriolis/osmorphing/osmount/windows.py
Coriolis currently logs sensitive information, the executed PowerShell
commands among other things:
cloudbase#450 (comment)

We'll reuse the sanitization helpers from oslo.utils.
@petrutlucian94 petrutlucian94 force-pushed the bitlocker branch 4 times, most recently from de94241 to d3578f1 Compare June 8, 2026 13:31
We'll use "mask_dict_password" from oslo.utils to sanitize
task info and os morphing info dicts.

This covers a wide variety of keys that are expected to contain
sensitive data, including the ones used for BitLocker and LUKS
keys.
We need to resume BitLocker if the os-morphing process fails,
otherwise the disks will remain publicly open.

"install_encryption_firstboot_setup" is the last method called
during os-morphing, we can suspend Bitlocker there and resume
it in case of failures.

While at it, we'll move "_unlock_encrypted_volumes" next to
"_unlock_encrypted_volume".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants