Attesting a buckypaper VM
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 documentation.
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.
Method and URL
POST
http://localhost:8200/v1/auth/{mount}/attestations
Headers
X-Vault-Token
Body
name
string
Test-VM
description
string
Example VM on CSP
namespace
string
your-namespace
policy
string
test
events
string
http://localhost:3000/webhook
Request
Response
Create a VM
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
.
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.
Configuration
You can generate this config with this command:
Attesting
Webhook data
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.
Last updated
Was this helpful?