Support Azure Trusted Launch security profiles - #752
Conversation
Add explicit TrustedLaunch and Standard VM security profiles, require vTPM for Trusted Launch.
WalkthroughAdds a validated Azure security profile model supporting Trusted Launch and Standard configurations. VM properties now parse optional security profiles, VM creation propagates them through VM parameters, and Azure requests serialize security type, Secure Boot, and vTPM settings. The compute API version is updated to 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/bosh_azure_cpi/lib/cloud/azure/vms/vm_manager.rb`:
- Around line 142-147: Validate Trusted Launch in the VM creation flow after
stemcell_info and vm_props.instance_type are resolved, before security_profile
is added to vm_params. Reject TrustedLaunch when the source stemcell is not Gen2
or the resolved instance_type does not support Trusted Launch, returning the CPI
validation error rather than proceeding to ARM provisioning; add coverage for
both unsupported source and SKU cases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bf579769-171d-4871-9245-6c0128ccc498
📒 Files selected for processing (11)
src/bosh_azure_cpi/lib/cloud/azure.rbsrc/bosh_azure_cpi/lib/cloud/azure/models/security_profile.rbsrc/bosh_azure_cpi/lib/cloud/azure/models/vm_cloud_props.rbsrc/bosh_azure_cpi/lib/cloud/azure/restapi/azure_client.rbsrc/bosh_azure_cpi/lib/cloud/azure/utils/helpers.rbsrc/bosh_azure_cpi/lib/cloud/azure/vms/vm_manager.rbsrc/bosh_azure_cpi/spec/spec_helper.rbsrc/bosh_azure_cpi/spec/unit/azure_client/create_virtual_machine_spec.rbsrc/bosh_azure_cpi/spec/unit/models/security_profile_spec.rbsrc/bosh_azure_cpi/spec/unit/models/vm_cloud_props_spec.rbsrc/bosh_azure_cpi/spec/unit/vm_manager/create/security_profile_spec.rb
Checklist:
Please check each of the boxes below for which you have completed the corresponding task:
Changelog
security_profileVM cloud property supporting AzureTrustedLaunchandStandard.Azure Trusted Launch protects the VM boot chain and supports measured-boot attestation. This change allows compatible Gen2 stemcells (must include the signed binaries: cloudfoundry/bosh-linux-stemcell-builder#697) to use those protections by including the required
securityProfilein Azure VM creation requests. Preserves existing behavior whensecurity_profileis omitted in thecloud_properties.Example cloud config