virt-what-cvm1
Detect if we are running in a confidential virtual machine
Summary
virt-what-cvm [options]
Overview
"virt-what-cvm" is a tool which can be used to detect if the program is running in a confidential virtual machine.
The program prints out a list of "facts" about the confidential virtual machine, derived from heuristics. One fact is printed per line.
If nothing is printed and the script exits with code 0 (no error), then it can mean either that the program is running on bare-metal or the program is running inside a non-confidential virtual machine, or inside a type of confidential virtual machine which we don't know about or cannot detect.
Facts
amd-sev-
This is a confidential guest running with AMD SEV technology
Status: tested on Fedora 37 QEMU+KVM
amd-sev-es-
This is a confidential guest running with AMD SEV-ES technology
Status: tested on Fedora 37 QEMU+KVM
amd-sev-snp-
This is a confidential guest running with AMD SEV-SNP technology
Status: tested on Microsoft Azure SEV-SNP CVM
Status: tested on Fedora 38 QEMU+KVM SEV-SNP (devel snapshot)
intel-tdx-
This is a confidential guest running with Intel TDX technology
Status: tested on Microsoft Azure TDX CVM
hyperv-hcl-
This is a confidential guest running unenlightened under the HyperV (Azure) HCL (Host Compatibility Layer). This will be paired with
amd-sev-snp.Status: tested on Microsoft Azure SEV-SNP & TDX CVM
s390-protvirt-
This is a confidential guest running on s390x with the Protected Virtualization (Secure Execution) technology
Exit status
Programs that use or wrap "virt-what-cvm" should check that the exit status is 0 before they attempt to parse the output of the command.
A non-zero exit status indicates some error, for example, an unrecognized command line argument. If the exit status is non-zero then the output "facts" (if any were printed) cannot be guaranteed and should be ignored.
The exit status does not have anything to do with whether the program is running on baremetal or under confidential virtualization, nor with whether "virt-what-cvm" managed detection "correctly" (which is basically unknowable given the large variety of virtualization systems out there)
Running virt-what-CVM from other programs
"virt-what-cvm" is designed so that you can easily run it from other programs or wrap it up in a library.
Your program should check the exit status (see the section above).
Important note
This program detects whether it is likely to be running within a known confidential VM, but does NOT prove that the environment is trustworthy. To attain trust in the environment requires an attestation report for the virtual machine, which is then verified by an already trusted 3rd party.
The hardware features that this program relies on to establish facts about the confidential virtualization environment, are those features whose behaviour will be proved by verification of an attestation report.
This program MAY have false positives. ie it may report that it is a confidential VM when it is in fact a non-confidential VM faking it.
This program SHOULD NOT have false negatives. ie it should not fail to report existance of a confidential VM. Caveat that this only applies to environments which have been explicitly tested.
If this program does print a fact, this can be used for enabling or disabling use of certain features, according to whether they are appropriate for a confidential environment. None the less, the VM MUST NOT be trusted until an attestation report is verified.
As a protection against false negatives from this tool, environments requiring high assurance should take one or more of these measures:
* The facts reported by this program I<SHOULD> should be measuredinto one of the TPM PCRs* The attestation report I<SHOULD> cover the facts reported bythis program* The attestation report I<SHOULD> should cover the enablementstatus of any features affected by decisions involving factsreported by this tool
Releases
2 releases since Debian 13 (Trixie); the text changed 1 time.