lacework-global-305
Launch Compute Instances With Shielded VM Enabled (Automated)
Profile Applicability
• Level 2
Description
To defend against advanced threats and ensure signed and untampered boot loader and firmware on your VMs, launch Compute instances with Shielded VM enabled.
Rationale
Shielded VMs are virtual machines (VMs) on Google Cloud Platform hardened by a set of security controls that help defend against rootkits and bootkits.
Shielded VM offers verifiable integrity of your Compute Engine VM instances, so you can be confident your instances haven't been compromised by boot- or kernel-level malware or rootkits. Shielded VM's verifiable integrity is achieved through the use of Secure Boot, virtual trusted platform module (vTPM)-enabled Measured Boot, and integrity monitoring.
Shielded VM instances run firmware which is signed and verified using Google's Certificate Authority, ensuring that the instance's firmware is unmodified and establishing the root of trust for Secure Boot.
Integrity monitoring helps you understand and make decisions about the state of your VM instances and the Shielded VM vTPM enables Measured Boot by performing the measurements needed to create a known good boot baseline, called the integrity policy baseline. The integrity policy baseline is used for comparison with measurements from subsequent VM boots to determine if anything has changed.
Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails.
Audit
From Console:
- Go to the
VM instances
page by visiting: https://console.cloud.google.com/compute/instances. - Click on the instance name to see its
VM instance details
page. - Under the section
Shielded VM
, ensure thatvTPM
andIntegrity Monitoring
areon
.
From Command Line:
- For each instance in your project, get its metadata:
gcloud compute instances list --format=json | jq -r '. | "vTPM: \(.[].shieldedInstanceConfig.enableVtpm) IntegrityMonitoring: \(.[].shieldedInstanceConfig.enableIntegrityMonitoring) Name: \(.[].name)"'
- Ensure that there is a
shieldedInstanceConfig
configuration and that configuration has theenableIntegrityMonitoring
andenableVtpm
set totrue
. If the VM is not a Shield VM image, you will not see a shieldedInstanceConfig` in the output.
Remediation
To be able to turn on Shielded VM
on an instance, your instance must use an image with Shielded VM support.
From Console:
- Go to the
VM instances
page by visiting: https://console.cloud.google.com/compute/instances. - Click the instance name to see its
VM instance details
page. - Click
Stop
to stop the instance. - When the instance has stopped, click
Edit
. - In the Shielded VM section, select
Turn on vTPM
andTurn on Integrity Monitoring
. - Optionally, if you do not use any custom or unsigned drivers on the instance, also select
Turn on Secure Boot
. - Click the
Save
button to modify the instance and then clickStart
to restart it.
From Command Line:
You can only enable Shielded VM options on instances that have Shielded VM support. For a list of Shielded VM public images, run the gcloud compute images list command with the following flags:
gcloud compute images list --project gce-uefi-images --no-standard-images
- Stop the instance:
gcloud compute instances stop <instance_name>
- Update the instance:
gcloud compute instances update <instance_name> --shielded-vtpm --shielded-vm-integrity-monitoring
- Optionally, if you do not use any custom or unsigned drivers on the instance, also turn on secure boot.
gcloud compute instances update <instance_name> --shielded-vm-secure-boot
- Restart the instance:
gcloud compute instances start <instance_name>
Prevention:
You can ensure creation of new VMs with Shielded VM enabled by setting up an Organization Policy to for Shielded VM
at https://console.cloud.google.com/iam-admin/orgpolicies/compute-requireShieldedVm. Learn more at:
https://cloud.google.com/security/shielded-cloud/shielded-vm#organization-policy-constraint.
References
https://cloud.google.com/compute/docs/instances/modifying-shielded-vm
https://cloud.google.com/shielded-vm
https://cloud.google.com/security/shielded-cloud/shielded-vm#organization-policy-constraint
Additional Information
If you do use custom or unsigned drivers on the instance, enabling Secure Boot causes the machine to no longer boot. Turn on Secure Boot only on instances verified to not have any custom drivers installed.