Add securityProfile support for TrustedLaunch VMs#2020
Draft
buraksekili wants to merge 5 commits into
Draft
Conversation
Azure enforces TrustedLaunch on Gen2 VMs using gallery images, causing VM creation to fail with a 400 BadRequest. Add a `securityProfile` field to the Azure provider spec so users can set `securityType` to TrustedLaunch (with optional secure boot and vTPM) or Standard (to opt out). Fixes #2013 Signed-off-by: Burak Sekili <32663655+buraksekili@users.noreply.github.com>
Contributor
|
Skipping CI for Draft Pull Request. |
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/hold still working and need to test |
…ween provider and tests. Signed-off-by: Burak Sekili <32663655+buraksekili@users.noreply.github.com>
replace repeated "Standard_D2s_v3" and "Standard_A2" strings with `testVMSizeGen2` and `testVMSizeGen1` constants. Signed-off-by: Burak Sekili <32663655+buraksekili@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Azure enforces TrustedLaunch on Gen2 VMs using Compute Gallery images, causing VM creation to fail with a 400 BadRequest. This PR adds a
securityProfilefield to the Azure cloud provider spec so users can setsecurityTypetoTrustedLaunch(with optionalsecureBootEnabledandvTpmEnabled) orStandard(to opt out of auto-enforced TrustedLaunch on subscriptions where Azure enables it by default).Which issue(s) this PR fixes:
Fixes #2013
What type of PR is this?
/kind feature
Special notes for your reviewer:
validateSecurityProfilerejects TrustedLaunch on non-Gen2 SKUs to fail fast before reaching Azure: https://learn.microsoft.com/en-us/azure/virtual-machines/generation-2 and https://learn.microsoft.com/en-us/azure/virtual-machines/trusted-launch-existing-vm-gen-1secureBootEnabledandvTpmEnabledare optional. Azure defaults: vTPM enabled, Secure Boot disabled. Source: https://learn.microsoft.com/en-us/azure/virtual-machines/trusted-launch-existing-vm-gen-1#upgrade-gen1-vm-to-trusted-launchsecurityType: Standardrequires theUseStandardSecurityTypesubscription feature flag, which Azure enforces. We do not pre-check feature-flag registration (consistent with how image SecurityType is handled): https://learn.microsoft.com/en-us/azure/virtual-machines/trusted-launch-faq#can-i-disable-trusted-launch-for-a-new-vm-deploymentTrustedLaunchByDefaultPreview) means new Gen2 VMs on preview-registered subscriptions auto-enable TrustedLaunch unlessStandardis explicitly set: https://learn.microsoft.com/en-us/azure/virtual-machines/trusted-launch#preview-trusted-launch-as-defaultDoes this PR introduce a user-facing change? Then add your Release Note here:
Documentation: