This tutorial is aimed at creating an attestation for confidential VMs.
Create a namespace (Optional)
If the plugin was enabled with the namespacing option, you will need to create a namespace for your attestation. You can learn how to create and use namespaces in the .
Register new attestation
After creating the required identities and a policy, you are ready to create an attestation. This will hold the information for a specific workload.
Key Value
--- -----
created 1734563330
description Add your text
events http://localhost:8000
name Example
namespace my-namespace
nonce n/a
policy test
updated 0
uuid ae294417-95ca-4aad-9647-77dbd3249771
At this stage, we will create an Azure VM from the DC2as_v5 family with the Ubuntu 20_04-lts-cvm operating system version, as it supports confidential VMs.
Use the provider azure-sev-snp-vtpm.
At this stage, we will create an AWS EC2 from the M6a family with the Ubuntu 23.04 operating system version, as it supports confidential VMs.
Use the provider aws-sev-snp-raw.
At this stage, we will create an GCP VM from the N2D family with an Ubuntu operating system version, as it supports confidential VMs.
Use the provider gcp-sev-snp-raw.
Download and run the vhsm agent inside the VM with your desired configuration. The binary is available from the attestation server at http://localhost:8200/static/vhsm.
When creating the VM, you can include all of this in cloud-init to automate the process.
Once all the steps have been completed, the result of the attestation will be sent to the webhook you specified when creating the attestation. Below is an example of what is sent to the webhook. Ensure that the webhook accepts the HTTP POST method.
This will indicate errors using the Success field with an optional Message. Instance corresponds to your attestation instance. Quote contains the raw received attestation. If there were some recoverable errors during the verification, these will be included as Warnings. This can include the inability to fetch the most recent certificates from the respective service and a fallback to cached values that are still valid.
Provisioning a secret
Using the vhsm agent you can also provision secrets with the received token, that is optionally restricted to a child namespace. The required configuration can be generated:
This will template a file at /tmp/secret with the contents of a secret in the mount buckypaper at the path :uuid/env/:name. You can modify the contents using the go templating.
The vhsm agent supports env_template and exec configurations as well. This can start a process with provisioned environment variables. We extended this even further with trustlets.
Trustlets allow custom features to be executed based on templates. After all templates are rendered, the trustlets are started. After all trustlets are finished, the exec is allowed to start
Write cloud-init user configuration to yaml, username is based on filename split before .
Arguments: Target-File, variable amount of Secret-Json (at least one)
Secret: value used as password, publicused as key (auto-detected)
cloud-config
Write any cloud-init configuration to a file
Arguments: Target-File, Base64-Config
Full example
This will install a verified root filesystem into an encrypted disk and prepare cloud-init configurations so that root and user are created and access is configured: