-
Notifications
You must be signed in to change notification settings - Fork 3
End-to-end demo on Azure (no attestation yet) #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Added a command to list files in the /tmp directory. Signed-off-by: Pavel Iakovenko <[email protected]>
Added commands to create a Shared Image Gallery and image definition in Azure. Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
Signed-off-by: Pavel Iakovenko <[email protected]>
marcelamelara
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @paveliak ! I haven't tested it yet, but overall I think this looks good! I have a few outstanding questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between top-verity and bottom-verity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
top-verity script opens Verity device, which effectively creates /dev/mapper/<DEVICE_NAME>. Given that it is placed in the local-top directory it is executed before root fs is mounted.
bottom-verity script creates OverlayFS using the previously created Verity device (in top-verity) for the bottom part of the OverlayFS and local temp disk of the Azure VM (ephemeral drive that is cleaned on every reboot) for the top part of the Overlay. Then it re-mounts Overlay FS as a rw root file system.
Naming is not great because top/bottom wording is used both in initramfs and OverlayFS and the funniest part is that bottom part of the OverlayFS is created in the top-verity script 😁
I am not sure why we have this split. Technically we should be able to do everything in the bottom-verity
|
|
||
| Image has 3 notable partitions - `boot`, `root file system` and `verity tree`. Verity tree contains hashes for the root file system. Verity configuration data (e.g., root hash) is passed in a well-known configuration file within the boot partition. This file is processed by `initrd` to properly initialize (i.e. open) Verity device. Root hash is measured into TPM and hence is present in the remote attestation quote. | ||
|
|
||
| Initrd sets up OverlayFS for the root file system using local ephemeral disk as a storage device. Build environments are ephemeral at `Build L3` and intermediate data is not expected to be preserved upon the termination of the environment. To achieve `BuildEnv L3` temporary storage must be encrypted, which could be done with an ephemeral key generated in Initrd upon booting the environment. `BuildEnv L2` does not require encryption. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to enforce in the demo that the storage must be encrypted at L3? I thought we took that out of the specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has to be encrypted at L3. Because otherwise host-based malware may tamper with the temporary data (and all build artifacts will be there). I do not think it's a big deal to encrypt temporary drive because it's ephemeral and so there is no need in managing keys. And confidential VM will make sure that keys in memory are protected from the malicious host.
|
|
||
| This Demo uses 2 VMs - `ImageVM` and `HasherVM`. | ||
| - `ImageVM` is used to build the target image, it could be populated with all the tools and data needed | ||
| - `HasherVM` is a "worker" VM whose sole purpose is to compute Verity tree over the ImageVM root FS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me think that the HasherVM is "more trusted" than the ImageVM. We may want to note a basic trust model for these VMs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are about the same from the trust perspective. HasherVM does not validate the data it hashes. But it has abilities to modify the data produced by the ImageVM. A de-risking approach here could be to put verity hashes on a separate disk and then we could attach data disk as a read-only divice to the HasherVM.
But that seems to unnecessarily complicate things from the distribution perspective because now image provider would have to distribute two images.
I will mention trust relationships in the doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added text about trusting VMs.
@marcelamelara the challenging part is L3. If BuildProvider has BuildEnv L3 level then it should be running ImageVM and HasherVM as confidential VMs encrypting the disk. However, the image itself should not be encrypted. And then the question is how do we generate Verity hashes for the encrypted disk like if it was not encrypted?
One solution that comes into my mind is that HasherVM:
- creates a non-encrypted block file on the encrypted disk
- does block copy of all the
ImageVMdata into the block file - computes verity hashes for the block file
- creates azure disk (or whatever cloud object) from the image
In other words we need to operate with a logical disk on the encrypted physical disk.
Co-authored-by: Marcela Melara <[email protected]> Signed-off-by: Pavel Iakovenko <[email protected]>
Removed unnecessary command to list files in /tmp. Signed-off-by: Pavel Iakovenko <[email protected]>
Two major changes in this PR:
TODO (for the future PRs):
GRUBtosystemd-bootfor the measured boot may be neededfindmnt
lsblk