Gallery › Security Center › Azure built-in policies
Configure supported Linux virtual machines to automatically install the Guest Attestation extension
Converted Policy DeployIfNotExists Disabled Mode Indexed Version 7.2.0
Configure supported Linux virtual machines 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_InstallLinuxGAExtOnVM_DINE.json · 177 lines
{
"properties": {
"displayName": "Configure supported Linux virtual machines to automatically install the Guest Attestation extension",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Configure supported Linux virtual machines 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": "7.2.0"
},
"version": "7.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/virtualMachines"
},
{
"anyOf": [
{
"field": "Microsoft.Compute/virtualMachines/storageProfile.osDisk.osType",
"like": "Linux*"
},
{
"field": "Microsoft.Compute/virtualMachines/osProfile.linuxConfiguration",
"exists": "true"
}
]
},
{
"field": "Microsoft.Compute/virtualMachines/securityProfile.securityType",
"in": [
"TrustedLaunch",
"ConfidentialVM"
]
},
{
"field": "Microsoft.Compute/virtualMachines/securityProfile.uefiSettings",
"exists": "true"
},
{
"field": "Microsoft.Compute/virtualMachines/securityProfile.uefiSettings.vTpmEnabled",
"equals": "true"
},
{
"field": "Microsoft.Compute/virtualMachines/securityProfile.uefiSettings.secureBootEnabled",
"equals": "true"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Compute/virtualMachines/extensions",
"evaluationDelay": "AfterProvisioningSuccess",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.Compute/virtualMachines/extensions/publisher",
"equals": "Microsoft.Azure.Security.LinuxAttestation"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/type",
"equals": "GuestAttestation"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/provisioningState",
"in": [
"Succeeded",
"Provisioning succeeded"
]
}
]
},
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/9980e02c-c2be-4d73-94e8-173b1dc7cf3c"
],
"deployment": {
"properties": {
"mode": "incremental",
"parameters": {
"vmName": {
"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": {
"vmName": {
"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/virtualMachines/extensions",
"apiVersion": "2019-12-01",
"name": "[concat(parameters('vmName'), '/', 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": [
"7.2.0",
"7.1.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/6074e9a3-c711-4856-976d-24d51f9e065b",
"name": "6074e9a3-c711-4856-976d-24d51f9e065b"
}Bylaw6074e9a3-c711-4856-976d-24d51f9e065b.bylaw.ps1 · 56 lines
# Converted from ASC_InstallLinuxGAExtOnVM_DINE.json by ConvertTo-Bylaw.
Policy '6074e9a3-c711-4856-976d-24d51f9e065b' {
Properties @{
DisplayName = 'Configure supported Linux virtual machines to automatically install the Guest Attestation extension'
Description = 'Configure supported Linux virtual machines 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 = '7.2.0'
PolicyVersion = '7.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/virtualMachines' {
When {
AnyOf {
Field storageProfile.osDisk.osType | Must -BeLike 'Linux*'
Field osProfile.linuxConfiguration | Must -Exist
}
Field securityProfile.securityType | Must -BeIn @('TrustedLaunch', 'ConfidentialVM')
Field securityProfile.uefiSettings | Must -Exist
Field securityProfile.uefiSettings.vTpmEnabled | Must -Be 'true'
}
Require 'securityProfile.uefiSettings.secureBootEnabled is not true' {
Field securityProfile.uefiSettings.secureBootEnabled | Must -Not -Be 'true' -IfPresent
}
}
DeployIfNotExists 'Microsoft.Compute/virtualMachines/extensions' -Role 'Virtual Machine Contributor' -EvaluationDelay AfterProvisioningSuccess -Effect (Param Effect) {
Require 'publisher, type and provisioningState are as required' {
Field publisher | Must -Be 'Microsoft.Azure.Security.LinuxAttestation'
Field 'Microsoft.Compute/virtualMachines/extensions/type' | Must -Be 'GuestAttestation'
Field provisioningState | Must -BeIn @('Succeeded', 'Provisioning succeeded')
}
Deployment -TemplateFile './templates/6074e9a3-c711-4856-976d-24d51f9e065b.json' -Parameters ([ordered]@{
vmName = (Arm '[field(''name'')]')
location = (Arm '[field(''location'')]')
attestationEndpoint = (Param AttestationEndpoint)
})
}
}Its deployment templates are written beside it:
templates/6074e9a3-c711-4856-976d-24d51f9e065b.json
Source: built-in-policies/policyDefinitions/Security Center/ASC_InstallLinuxGAExtOnVM_DINE.json in Azure/azure-policy, under the MIT licence.
Bylaw