Este conteúdo não está disponível no idioma selecionado.
Chapter 7. Configuring RHEL on Public Cloud Platforms with AMD SEV SNP
AMD Secure Encrypted Virtualization with Secure Nested Paging (SEV-SNP) aims to prevent VM integrity-based attacks and reduce the dangers of memory integrity violations. For the secure boot process, AMD processors offer three hardware-based security mechanisms; Secure Encrypted Virtualization (SEV), SEV Encrypted State (SEV-ES), and SEV Secure Nested Paging (SEV-SNP).
- SEV: The SEV mechanism encrypts virtual machine (VM) memory to prevent the hypervisor from accessing VM data.
- SEV-ES: SEV with Encrypted State (SEV-ES) extends SEV by encrypting CPU register states. This mechanism prevents the hypervisor from accessing or modifying VM CPU registers. Despite providing isolation between hypervisor and VM, it is still vulnerable to memory integrity attacks.
SEV-SNP: SEV-SNP is an enhancement to SEV-ES that adds memory integrity protection along with VM encryption. This mechanism prevents the hypervisor from modifying page tables to redirect VM memory access, protecting against replay attacks and memory tampering.
NoteBefore deploying Red Hat Enterprise Linux (RHEL) on a public cloud platform, always check with the corresponding cloud service provider for the support status and certification of the particular RHEL instance type.
7.1. Properties of SEV-SNP Copiar o linkLink copiado para a área de transferência!
-
Secure Processor: The AMD
EPYCprocessor integrates a Secure Processor (SP) subsystem. AMD SP is a dedicated hardware component to manage keys and encryption operations. - Memory Integrity: For managing virtualization and isolation, memory management unit (MMU) utilizes page tables to translate virtual addresses to guest-physical addresses. SEV-SNP uses nested page tables for translating guest-physical addresses to host-physical addresses. Once nested page tables are defined, the hypervisor or host cannot alter page tables to modify the VM into accessing different pages, resulting in protection of memory integrity. SEV-SNP uses this method to offer protection against replay attacks and malicious modifications to VM memory.
-
Memory Encryption: The AMD
EPYCprocessor hides the memory encryption key, which remains hidden from both host and VM. Attestation report for verification: A CPU-generated report about RHEL instance information in an authorized cryptographic format. This process confirms the authenticity and reliability of the initial CPU and memory state of the RHEL instance and AMD processor.
NoteEven if a hypervisor creates the primary memory and CPU register state of the VM, they remain hidden and inaccessible to the hypervisor after initialization of that VM.
7.2. Understanding AMD SEV SNP secure boot process Copiar o linkLink copiado para a área de transferência!
- Initialization and measurement: A SEV-SNP enabled hypervisor sets the initial state of a VM. This hypervisor loads firmware binary into the VM memory and sets the initial register state. AMD Secure Processor (SP) measures the initial state of the VM and provides details to verify the initial state of the VM.
- Firmware: The VM initiates the UEFI firmware. The firmware might include either stateful or stateless Virtual Trusted Platform Module (vTPM) implementation. Stateful vTPM maintains persistent cryptographic state across VM reboots and migrations, whereas stateless vTPM generates fresh cryptographic state for each VM session without persistence. Virtual Machine Privilege Levels (VMPL) technology isolates vTPM from the guest. VMPL offers hardware-enforced privilege isolation between different VM components and the hypervisor.
vTPM: Depending on your cloud service provider, for stateful vTPM implementation, the UEFI firmware might perform a remote attestation to decrypt the persistent state of vTPM.
- The vTPM also measures facts about the boot process such as Secure Boot state, certificates used for signing boot artifacts, UEFI binary hashes, and so on.
Shim: When the UEFI firmware finishes the initialization process, it searches for the extended firmware interface (EFI) system partition. Then, the UEFI firmware verifies and executes the first stage boot loader from there. For RHEL, this is
shim. Theshimprogram allows non-Microsoft operating systems to load the second stage boot loader from the EFI system partition.-
shimuses a Red Hat certificate to verify the second stage boot loader (grub) or Red Hat Unified Kernel Image (UKI). -
gruborUKIunpacks, verifies, and executes Linux kernel and initial RAM filesystem (initramfs), and the kernel command line. This process ensures that the Linux kernel is loaded in a trusted and secured environment.
-
Initramfs: In
initramfs, vTPM information automatically unlocks the encrypted root partition in case of full disk encryption technology.-
When the root volume becomes available,
initramfstransfers the execution flow to the root volume.
-
When the root volume becomes available,
- Attestation: The VM tenant gets access to the system and can perform a remote attestation to ensure that the accessed VM is an untampered Confidential Virtual Machine (CVM). Attestation is performed based on information from AMD SP and vTPM. This process confirms the authenticity and reliability of the initial CPU and memory state of the RHEL instance and AMD processor.
- TEE: This process creates a Trusted Execution Environment (TEE) to ensure that booting of the VM is in a trusted and secured environment.
7.3. Configuring a RHEL instance on Google Cloud with AMD SEV SNP Copiar o linkLink copiado para a área de transferência!
AMD Secure Encrypted Virtualization with Secure Nested Paging (SEV-SNP) is a security type of the Confidential Virtual Machine (CVM) technology for Red Hat Enterprise Linux (RHEL) on Google Cloud instances and available only for AMD EPYC processor family. SEV-SNP provides a trusted boot environment so that the entire process becomes secured and protected such that hypervisor and cloud service provider cannot access the data.
Prerequisites
-
You have installed the
opensshandopenssh-clientspackages. -
You have installed the
google-cloud-cliutility. For details, see installing gcloud CLI on RHEL. - You have launched the instance from the list of specified instance types. For details, see the specified Google Cloud instance types.
Procedure
Log in to Google Cloud by using the
google-cloud-cliutility:$ gcloud auth loginCreate a new Google Cloud project with specific settings:
$ gcloud projects create <example_sev_snp_project> --name="RHEL SEV SNP Project"Configure the Google Cloud project:
$ gcloud config set project <example_sev_snp_project>Create a RHEL compute instance:
$ gcloud compute instances create <example-rhel-9-sev-snp-instance> \ --confidential-compute-type=SEVSNP \ --machine-type=n2d-standard-2 \ --min-cpu-platform="AMD Milan" \ --maintenance-policy="TERMINATE" \ --image=<rhel-guest-image-9-6-20251016-0-x86-64> \ --image-project="rhel-cloud" \ --subnet=<example_subnet>Connect to the RHEL instance by using public and private RSA key pair:
Connect to the RHEL instance for the first time, generate a public and private RSA key pair:
$ gcloud compute ssh <cloud_user>@<example-rhel-9-sev-snp-instance>Connect to the RHEL instance by using an existing key pair:
$ ssh -i <example_private_key> <cloud_user>@<instance_ip>
Verification
Check metadata of VM configuration on RHEL instance:
$ gcloud compute instances describe <example-rhel-9-sev-snp-instance> --format="get(metadata)"Check kernel logs to verify status of SEV-SNP:
$ sudo dmesg | grep -i sev... [0.309317] Memory Encryption Features active: AMD SEV SEV-ES SEV-SNP [0.310278] SEV: Status: SEV SEV-ES SEV-SNP [0.614282] SEV: APIC: wakeup_secondary_cpu() replaced with wakeup_cpu_via_vmgexit() [0.676363] SEV: Using SNP CPUID table, 56 entries present. [0.956832] SEV: SNP guest platform device initialized. [21.988332] systemd[1]: Detected confidential virtualization sev-snp. [27.757883] sev-guest sev-guest: Initialized SEV guest driver (using vmpck_id 0) ...