Skip to content

Conversation

@AntonioND
Copy link
Member

@AntonioND AntonioND commented Aug 2, 2021

This protects the files generated by the guest from the host OS, as they
are encrypted by a key that the host doesn't know.

This commit adds a new argument to the scsi.Mount() function, encrypted,
that makes the SCSI drive be mounted using dm-crypt. It also uses
dm-integrity for integrity checking. This makes the boot process a couple
of seconds slower.

Also, it adds scsi.Unmount(), which also has the encrypted argument,
and it does the necessary cleanup for a drive that has been mounted as
an encrypted drive.

All the pre-existing SCSI tests have been fixed to work with the new
scsi.Mount() function prototype. New tests have been added for the new
code.

This is all disabled for now, it has to be enabled in a future patch.

Important note: This depends on cryptsetup and mkfs.ext4. Also, the
kernel must be compiled with dm-crypt and dm-integrity support.

@AntonioND AntonioND requested a review from a team as a code owner August 2, 2021 13:35
This protects the files generated by the guest from the host OS, as they
are encrypted by a key that the host doesn't know.

This commit adds a new argument to the scsi.Mount() function, `encrypted`,
that makes the SCSI drive be mounted using dm-crypt. It also uses
dm-integrity for integrity checking. This makes the boot process a couple
of seconds slower.

Also, it adds scsi.Unmount(), which also has the `encrypted` argument,
and it does the necessary cleanup for a drive that has been mounted as
an encrypted drive.

All the pre-existing SCSI tests have been fixed to work with the new
scsi.Mount() function prototype. New tests have been added for the new
code.

This is all disabled for now, it has to be enabled in a future patch.

Important note: This depends on cryptsetup and mkfs.ext4. Also, the
kernel must be compiled with dm-crypt and dm-integrity support.
Copy link
Contributor

@anmaxvl anmaxvl left a comment

Choose a reason for hiding this comment

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

LGTM

@anmaxvl anmaxvl merged commit c65d826 into microsoft:master Aug 4, 2021
anmaxvl added a commit to anmaxvl/hcsshim that referenced this pull request Aug 8, 2021
This enables scratch space encryption functionality added in
microsoft#1090.

Add new bool annotation:
 - "io.microsoft.virtualmachine.storage.scratch.encrypted"
Update guest request protocols to support passing encrypt option.

Move dm-verity and dm-linear code to devicemapper package

Revendor hcsshim into tests.

Signed-off-by: Maksim An <[email protected]>
princepereira pushed a commit to princepereira/hcsshim that referenced this pull request Aug 29, 2024
Add support to encrypt SCSI scratch disks with dm-crypt
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.

3 participants