Gallery › Compute › Azure Community Policy
VMAccess virtual machine extension for Linux
Converted Policy Audit Deny Disabled Mode All Version 1.0.0
The VMAccess virtual machine extensions for Linux allows the user to reset the password/ssh of a selected user or the ability to create a new local users with sudo access. https://github.com/Azure/azure-linux-extensions/blob/master/VMAccess/README.md
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 45 lines
{
"name": "980f4300-a120-446c-9a6b-e299a845b931",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "VMAccess virtual machine extension for Linux",
"description": "The VMAccess virtual machine extensions for Linux allows the user to reset the password/ssh of a selected user or the ability to create a new local users with sudo access. https://github.com/Azure/azure-linux-extensions/blob/master/VMAccess/README.md",
"metadata": {
"category": "Compute",
"version": "1.0.0"
},
"mode": "All",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Deny, Audit or Disabled the execution of the Policy"
},
"allowedValues": [
"Deny",
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Compute/virtualMachines/extensions"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/type",
"equals": "VMAccessForLinux"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylaw980f4300-a120-446c-9a6b-e299a845b931.bylaw.ps1 · 27 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '980f4300-a120-446c-9a6b-e299a845b931' {
Properties @{
DisplayName = 'VMAccess virtual machine extension for Linux'
Description = 'The VMAccess virtual machine extensions for Linux allows the user to reset the password/ssh of a selected user or the ability to create a new local users with sudo access. https://github.com/Azure/azure-linux-extensions/blob/master/VMAccess/README.md'
Category = 'Compute'
Version = '1.0.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Deny', 'Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Deny, Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.Compute/virtualMachines/extensions' {
Require 'type is not VMAccessForLinux' {
Field 'Microsoft.Compute/virtualMachines/extensions/type' | Must -Not -Be 'VMAccessForLinux' -IfPresent
}
}
Effect (Param Effect)
}Source: policyDefinitions/Compute/vmaccess-virtual-machine-extension-for-linux/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw