Skip to content

feat(UP-2441): enable recommended ShieldedVM settings on instance templates - #48

Merged
snaebjor merged 4 commits into
mainfrom
UP-2441
Jun 19, 2026
Merged

feat(UP-2441): enable recommended ShieldedVM settings on instance templates#48
snaebjor merged 4 commits into
mainfrom
UP-2441

Conversation

@snaebjor

@snaebjor snaebjor commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Problem

HarborFreight had no scanners spinning up: the MIG could not create instances because both instance templates (UP-2441) lacked a shielded_instance_config block, failing an org policy requiring Shielded VM with Secure Boot (constraints/compute.requireShieldedVm).

Change

Added shielded_instance_config to both the cloudscanner and DSPM instance templates, with all three Shielded VM settings enabled explicitly:

shielded_instance_config {
  enable_secure_boot          = var.enable_secure_boot   # default true
  enable_vtpm                 = true
  enable_integrity_monitoring = true
}
  • vTPM and integrity monitoring are set explicitly (on) rather than relying on provider defaults, to fully satisfy policies that require a complete Shielded VM configuration.
  • Secure Boot is gated behind a new enable_secure_boot variable (default true) so a customer on a non-UEFI custom boot_image can opt out.

Validation

  • Constraint: Secure Boot requires a UEFI_COMPATIBLE, signed boot image.
  • Current source image is fine: default ubuntu-os-cloud/ubuntu-2404-lts-amd64 (live: ubuntu-2404-noble-amd64-v20260615) carries the UEFI_COMPATIBLE guest OS feature and Ubuntu LTS images are signed for Secure Boot. No image change needed.
  • Secure Boot blocks unsigned kernel modules; the scanner startup loads none, so no impact.
  • terraform fmt -check and terraform validate pass.

Also: CI fix (trivy)

The pinned TRIVY_VERSION v0.63.0 was removed upstream (404 from the trivy releases), so the Security Scan job failed on every run. Bumped to v0.71.2 (current latest).

Rollout note

Applying replaces the instance templates and recreates the MIGs (create_before_destroy / replace_triggered_by), so scanner VMs will cycle on rollout — expected.

🤖 Generated with Claude Code

snaebjor and others added 3 commits June 19, 2026 16:05
…plates

Both the cloudscanner and DSPM instance templates lacked a
shielded_instance_config block, so instances failed to create under
org policies requiring Shielded VM with Secure Boot (e.g. HarborFreight),
leaving the MIG with no running scanners.

Add shielded_instance_config to both templates with vTPM and integrity
monitoring always on, and Secure Boot gated behind a new enable_secure_boot
variable (default true). The default Ubuntu LTS boot image is
UEFI_COMPATIBLE and signed, so Secure Boot works out of the box.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vTPM and integrity monitoring default to on in the provider and were
already enabled for the UEFI_COMPATIBLE Ubuntu image, so drop the
redundant explicit lines and configure only Secure Boot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The pinned TRIVY_VERSION v0.63.0 release was removed upstream (404 from
the trivy releases), so the Security Scan job could no longer download
the binary and failed on every run. Bump to the current latest release.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread modules/main/main.tf Outdated
# they already were for the UEFI_COMPATIBLE default Ubuntu LTS image.
# Secure Boot requires that UEFI_COMPATIBLE, signed image.
shielded_instance_config {
enable_secure_boot = var.enable_secure_boot

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Google's docs, requireShieldedVm needs the other two, so I would maybe be explicit here to be safe?

shielded_instance_config {
  enable_secure_boot          = true
  enable_vtpm                 = true
  enable_integrity_monitoring = true
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what our friend Claude suggested to begin with - that's sorted now

Configure all three Shielded VM settings explicitly (Secure Boot, vTPM,
integrity monitoring) rather than relying on provider defaults, to fully
satisfy org policies requiring a complete Shielded VM configuration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@snaebjor
snaebjor merged commit 3aa0778 into main Jun 19, 2026
13 checks passed
@snaebjor
snaebjor deleted the UP-2441 branch June 19, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants