-
Notifications
You must be signed in to change notification settings - Fork 105
feat(fleet): add Azure.Fleet.SecureBoot rule (AZR-000545) #3863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Alex Chen (alexchen-sys)
wants to merge
4
commits into
Azure:main
Choose a base branch
from
alexchen-sys:feat/fleet-secure-boot
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3567b2e
feat(fleet): add Azure.Fleet.SecureBoot rule (AZR-000545)
alexchen-sys ef829bd
test(fleet): cover SecureBoot securityType and uefi cases separately
alexchen-sys 324ca39
test(fleet): assert SecureBoot partial fail/pass matrix
alexchen-sys 28db766
chore: drop generated resource-type-mapping churn from rule PR
alexchen-sys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| --- | ||
| reviewed: 2026-07-14 | ||
| severity: Important | ||
| pillar: Security | ||
| category: SE:08 Hardening resources | ||
| resource: Azure Fleet | ||
| resourceType: Microsoft.AzureFleet/fleets | ||
| online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.Fleet.SecureBoot/ | ||
| --- | ||
|
|
||
| # Azure Fleet Secure Boot is not enabled | ||
|
|
||
| ## SYNOPSIS | ||
|
|
||
| Operating systems or drivers may be maliciously modified or injected if an actor gains access to VM/ OS storage or build media. | ||
|
|
||
| ## DESCRIPTION | ||
|
|
||
| Azure Fleet virtual machine profiles are able to run a wide range of operating systems including many distributions of Windows and Linux. | ||
| A malicious actor may attempt to tamper or inject operating system and driver components to gain access to resources and persist between reboots. | ||
|
|
||
| When a fleet VM instance is started, Azure is able to verify if: | ||
|
|
||
| 1. The operating system and drivers originate from a trusted source. | ||
| 2. These components are in their original unaltered state. | ||
|
|
||
| Azure is able to perform this verification by Secure Boot and Trusted Launch features. | ||
| These features verify the cryptographic signatures of early boot components before they start. | ||
|
|
||
| Secure Boot and Trusted Launch are on by default for many configurations. | ||
| However, if you are running an older configuration these features may need to be enabled. | ||
|
|
||
| Setting the security type to `ConfidentialVM` is also acceptable. | ||
|
|
||
| ## RECOMMENDATION | ||
|
|
||
| Consider enabling Trusted Launch or Confidential VM with Secure Boot for Azure Fleet VM profiles to protect against boot-level attacks. | ||
|
|
||
| ## EXAMPLES | ||
|
|
||
| ### Configure with Bicep | ||
|
|
||
| To deploy an Azure Fleet that passes this rule: | ||
|
|
||
| - Set the `properties.computeProfile.baseVirtualMachineProfile.securityProfile.securityType` property to `TrustedLaunch` or `ConfidentialVM`. | ||
| - Set the `properties.computeProfile.baseVirtualMachineProfile.securityProfile.uefiSettings.secureBootEnabled` property to `true`. | ||
|
|
||
| For example: | ||
|
|
||
| ```bicep | ||
| resource windows_fleet 'Microsoft.AzureFleet/fleets@2024-11-01' = { | ||
| name: name | ||
| location: location | ||
| properties: { | ||
| computeProfile: { | ||
| baseVirtualMachineProfile: { | ||
| securityProfile: { | ||
| securityType: 'TrustedLaunch' | ||
| encryptionAtHost: true | ||
| uefiSettings: { | ||
| secureBootEnabled: true | ||
| vTpmEnabled: true | ||
| } | ||
| } | ||
| osProfile: { | ||
| computerNamePrefix: 'fleet' | ||
| adminUsername: adminUsername | ||
| adminPassword: secret | ||
| } | ||
| networkProfile: { | ||
| networkInterfaceConfigurations: [ | ||
| { | ||
| name: 'netconfig' | ||
| properties: { | ||
| ipConfigurations: [ | ||
| { | ||
| name: 'ipconfig' | ||
| properties: { | ||
| primary: true | ||
| subnet: { | ||
| id: subnetId | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| vmSizesProfile: [ | ||
| { | ||
| name: 'Standard_D8ds_v6' | ||
| rank: 0 | ||
| } | ||
| ] | ||
| regularPriorityProfile: { | ||
| minCapacity: 1 | ||
| capacity: 5 | ||
| allocationStrategy: 'Prioritized' | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Configure with Azure template | ||
|
|
||
| To deploy an Azure Fleet that passes this rule: | ||
|
|
||
| - Set the `properties.computeProfile.baseVirtualMachineProfile.securityProfile.securityType` property to `TrustedLaunch` or `ConfidentialVM`. | ||
| - Set the `properties.computeProfile.baseVirtualMachineProfile.securityProfile.uefiSettings.secureBootEnabled` property to `true`. | ||
|
|
||
| For example: | ||
|
|
||
| ```json | ||
| { | ||
| "type": "Microsoft.AzureFleet/fleets", | ||
| "apiVersion": "2024-11-01", | ||
| "name": "[parameters('name')]", | ||
| "location": "[parameters('location')]", | ||
| "properties": { | ||
| "computeProfile": { | ||
| "baseVirtualMachineProfile": { | ||
| "securityProfile": { | ||
| "securityType": "TrustedLaunch", | ||
| "encryptionAtHost": true, | ||
| "uefiSettings": { | ||
| "secureBootEnabled": true, | ||
| "vTpmEnabled": true | ||
| } | ||
| }, | ||
| "osProfile": { | ||
| "computerNamePrefix": "fleet", | ||
| "adminUsername": "[parameters('adminUsername')]", | ||
| "adminPassword": "[parameters('secret')]" | ||
| }, | ||
| "networkProfile": { | ||
| "networkInterfaceConfigurations": [ | ||
| { | ||
| "name": "netconfig", | ||
| "properties": { | ||
| "ipConfigurations": [ | ||
| { | ||
| "name": "ipconfig", | ||
| "properties": { | ||
| "primary": true, | ||
| "subnet": { | ||
| "id": "[parameters('subnetId')]" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| "vmSizesProfile": [ | ||
| { | ||
| "name": "Standard_D8ds_v6", | ||
| "rank": 0 | ||
| } | ||
| ], | ||
| "regularPriorityProfile": { | ||
| "minCapacity": 1, | ||
| "capacity": 5, | ||
| "allocationStrategy": "Prioritized" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## NOTES | ||
|
|
||
| Currently there are a few limitations (see documentation for up to date details), including: | ||
|
|
||
| - A supported VM SKU and operating system is required. | ||
| - Secure Boot and Trusted Launch is only supported on Generation 2 VM images. | ||
|
|
||
| ## LINKS | ||
|
|
||
| - [SE:08 Hardening resources](https://learn.microsoft.com/azure/well-architected/security/harden-resources) | ||
| - [Security: Level 2](https://learn.microsoft.com/azure/well-architected/security/maturity-model?tabs=level2) | ||
| - [Trusted Launch for Azure virtual machines](https://learn.microsoft.com/azure/virtual-machines/trusted-launch) | ||
| - [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.azurefleet/fleets#securityprofile) |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add separate test cases for the two checks? The three failing fleets are missing the whole security profile, so they fail both checks at the same time. The test still passes if the
secureBootEnabledassertion is removed.Please add these cases:
TrustedLaunchwithsecureBootEnabled: falseshould fail.securityTypewithsecureBootEnabled: trueshould fail.ConfidentialVMwithsecureBootEnabled: trueshould pass.This will confirm that both properties are checked and that
ConfidentialVMis supported.