Renew Attestation Policy After Measurement Mismatch

When a VM's attestation fails with a measurement mismatch error, it means the firmware measurement reported by the VM no longer matches the expected ("golden") measurement stored in Vault. This typica

Identifying the Problem

A failed attestation event looks like this:

json

{
  "Success": false,
  "Message": "verify: gcp-sev-snp-raw: measurement did not match, found: 12068361...6a3a5, expected: 7a5ed176...2434e",
  "Instance": "1f96b38e-331b-49dc-bcf8-342480abcafe",
  "resourceModel": "Virtual-machine"
}

The key fields:

  • Success: false — attestation verification failed.

  • Message — contains both the found (actual) measurement and the expected measurement currently stored in Vault.

  • Provider — the attestation provider (e.g., gcp-sev-snp-raw, azure-sev-snp-vtpm, aws-sev-snp-raw).

Understanding createPolicy.js

The script scripts/common/vault/createPolicy.js is used to create or update the trusted attestation appraisal policy in Vault. It defines the "golden" measurements that Vault uses to verify a VM when it requests attestation.

Running this script with the new measurement effectively renews the attestation baseline that all future VMs of that configuration will be verified against.

What the Script Does

  1. Validates the provided cloud provider (-cp) and measurement (-mt) arguments.

  2. Connects to Vault and the database.

  3. Gathers current policy names from the database and Vault.

  4. Parses the -name argument to derive the firmware identity name.

  5. Prompts for confirmation before making changes.

  6. Updates Vault:

    • Creates (or overwrites) a firmware identity containing the new measurement.

    • Creates (or overwrites) the appraisal policy linking to the firmware identity and the correct hardware trust path based on the cloud provider.

Trust Path Mapping

Cloud Provider
Hardware Trust Path

Azure

AMD_SEV_SNP_MILAN_VCEK

GCP

AMD_SEV_SNP_MILAN_VCEK

AWS

AMD_SEV_SNP_MILAN_VLEK

Usage

Parameters

Flag
Description
Example

-cp

Cloud provider name

AZURE, AWS, GCP

-mt

The new firmware measurement hash

12068361369cf917...

-name

Full policy identifier: [provider]_[size]_[image]

gcp_n2d-standard-2_ubuntu

Example: Renewing a GCP Policy

Given this failed attestation:

Run the following to update Vault with the new measurement:

bash

The script will prompt you to type y to confirm.

Example: Renewing an Azure Policy

bash

Example: Renewing an AWS Policy

bash

After Renewal

Once the policy is updated in Vault, the VM's next attestation cycle will use the new expected measurement. No VM restart is required — the attestation will succeed on the next scheduled check.

Important Notes

  • The -name must match the existing policy name exactly. Use the format [provider]_[size]_[image].

  • This script updates the policy for all VMs of that provider/size/image combination, not just a single VM instance.

  • Always verify the new measurement is legitimate (e.g., from a known firmware update) before accepting it into Vault.

Last updated

Was this helpful?