Gallery › Security Center › Azure built-in policies
Configure supported Linux virtual machine scale sets to automatically install the Guest Attestation extension
Converted Policy DeployIfNotExists Disabled Mode Indexed Version 6.2.0
Configure supported Linux virtual machines scale sets to automatically install the Guest Attestation extension to allow Azure Security Center to proactively attest and monitor the boot integrity. Boot integrity is attested via Remote Attestation.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_InstallLinuxGAExtOnVmss_DINE.json · 170 lines
{
"properties": {
"displayName": "Configure supported Linux virtual machine scale sets to automatically install the Guest Attestation extension",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Configure supported Linux virtual machines scale sets to automatically install the Guest Attestation extension to allow Azure Security Center to proactively attest and monitor the boot integrity. Boot integrity is attested via Remote Attestation.",
"metadata": {
"category": "Security Center",
"version": "6.2.0"
},
"version": "6.2.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "DeployIfNotExists",
"allowedValues": [
"DeployIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
},
"attestationEndpoint": {
"defaultValue": "",
"type": "string",
"metadata": {
"displayName": "Guest attestation tenant URL",
"description": "The Microsoft Azure Attestation (MAA) custom tenant URL."
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Compute/virtualMachineScaleSets"
},
{
"anyOf": [
{
"field": "Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile.osProfile.linuxConfiguration",
"exists": "true"
},
{
"field": "Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile.storageProfile.osDisk.osType",
"like": "Linux*"
}
]
},
{
"field": "Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile.securityProfile.securityType",
"in": [
"TrustedLaunch",
"ConfidentialVM"
]
},
{
"field": "Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile.securityProfile.uefiSettings",
"exists": "true"
},
{
"field": "Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile.securityProfile.uefiSettings.vTpmEnabled",
"equals": "true"
},
{
"field": "Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile.securityProfile.uefiSettings.secureBootEnabled",
"equals": "true"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Compute/virtualMachineScaleSets/extensions",
"evaluationDelay": "AfterProvisioningSuccess",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.Compute/virtualMachineScaleSets/extensions/publisher",
"equals": "Microsoft.Azure.Security.LinuxAttestation"
},
{
"field": "Microsoft.Compute/virtualMachineScaleSets/extensions/type",
"equals": "GuestAttestation"
}
]
},
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/9980e02c-c2be-4d73-94e8-173b1dc7cf3c"
],
"deployment": {
"properties": {
"mode": "incremental",
"parameters": {
"vmssName": {
"value": "[field('name')]"
},
"location": {
"value": "[field('location')]"
},
"attestationEndpoint": {
"value": "[parameters('attestationEndpoint')]"
}
},
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmssName": {
"type": "string"
},
"location": {
"type": "string"
},
"attestationEndpoint": {
"type": "string"
}
},
"variables": {
"extensionName": "GuestAttestation",
"extensionPublisher": "Microsoft.Azure.Security.LinuxAttestation",
"extensionVersion": "1.0",
"maaTenantName": "GuestAttestation",
"ascReportingEndpoint": ""
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachineScaleSets/extensions",
"apiVersion": "2019-12-01",
"name": "[concat(parameters('vmssName'), '/', variables('extensionName'))]",
"location": "[parameters('location')]",
"properties": {
"publisher": "[variables('extensionPublisher')]",
"type": "[variables('extensionName')]",
"typeHandlerVersion": "[variables('extensionVersion')]",
"autoUpgradeMinorVersion": true,
"settings": {
"AttestationConfig": {
"MaaSettings": {
"maaEndpoint": "[parameters('attestationEndpoint')]",
"maaTenantName": "[variables('maaTenantName')]"
},
"AscSettings": {
"ascReportingEndpoint": "[variables('ascReportingEndpoint')]",
"ascReportingFrequency": ""
},
"useCustomToken": "false",
"disableAlerts": "false"
}
}
}
}
]
}
}
}
}
}
},
"versions": [
"6.2.0",
"6.1.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/57c2e3f0-98cf-4c3b-aa6b-e8f70726e74e",
"name": "57c2e3f0-98cf-4c3b-aa6b-e8f70726e74e"
}Bylaw57c2e3f0-98cf-4c3b-aa6b-e8f70726e74e.bylaw.ps1 · 55 lines
# Converted from ASC_InstallLinuxGAExtOnVmss_DINE.json by ConvertTo-Bylaw.
Policy '57c2e3f0-98cf-4c3b-aa6b-e8f70726e74e' {
Properties @{
DisplayName = 'Configure supported Linux virtual machine scale sets to automatically install the Guest Attestation extension'
Description = 'Configure supported Linux virtual machines scale sets to automatically install the Guest Attestation extension to allow Azure Security Center to proactively attest and monitor the boot integrity. Boot integrity is attested via Remote Attestation.'
Category = 'Security Center'
Version = '6.2.0'
PolicyVersion = '6.2.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('DeployIfNotExists', 'Disabled')
Default = 'DeployIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Parameter AttestationEndpoint @{
Type = 'string'
Default = ''
DisplayName = 'Guest attestation tenant URL'
Description = 'The Microsoft Azure Attestation (MAA) custom tenant URL.'
}
Resource 'Microsoft.Compute/virtualMachineScaleSets' {
When {
AnyOf {
Field virtualMachineProfile.osProfile.linuxConfiguration | Must -Exist
Field virtualMachineProfile.storageProfile.osDisk.osType | Must -BeLike 'Linux*'
}
Field virtualMachineProfile.securityProfile.securityType | Must -BeIn @('TrustedLaunch', 'ConfidentialVM')
Field virtualMachineProfile.securityProfile.uefiSettings | Must -Exist
Field virtualMachineProfile.securityProfile.uefiSettings.vTpmEnabled | Must -Be 'true'
}
Require 'virtualMachineProfile.securityProfile.uefiSettings.secureBootEnabled is not true' {
Field virtualMachineProfile.securityProfile.uefiSettings.secureBootEnabled | Must -Not -Be 'true' -IfPresent
}
}
DeployIfNotExists 'Microsoft.Compute/virtualMachineScaleSets/extensions' -Role 'Virtual Machine Contributor' -EvaluationDelay AfterProvisioningSuccess -Effect (Param Effect) {
Require 'publisher is Microsoft.Azure.Security.LinuxAttestation and type is GuestAttestation' {
Field publisher | Must -Be 'Microsoft.Azure.Security.LinuxAttestation'
Field 'Microsoft.Compute/virtualMachineScaleSets/extensions/type' | Must -Be 'GuestAttestation'
}
Deployment -TemplateFile './templates/57c2e3f0-98cf-4c3b-aa6b-e8f70726e74e.json' -Parameters ([ordered]@{
vmssName = (Arm '[field(''name'')]')
location = (Arm '[field(''location'')]')
attestationEndpoint = (Param AttestationEndpoint)
})
}
}Its deployment templates are written beside it:
templates/57c2e3f0-98cf-4c3b-aa6b-e8f70726e74e.json
Source: built-in-policies/policyDefinitions/Security Center/ASC_InstallLinuxGAExtOnVmss_DINE.json in Azure/azure-policy, under the MIT licence.
Bylaw