Gallery › Automation › Azure built-in policies
Automation account variables should be encrypted
Converted Policy Audit Deny Disabled Mode All Version 1.1.0
It is important to enable encryption of Automation account variable assets when storing sensitive data
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAuditUnencryptedVars_Audit.json · 50 lines
{
"properties": {
"displayName": "Automation account variables should be encrypted",
"policyType": "BuiltIn",
"mode": "All",
"description": "It is important to enable encryption of Automation account variable assets when storing sensitive data",
"metadata": {
"version": "1.1.0",
"category": "Automation"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Automation/automationAccounts/variables"
},
{
"field": "Microsoft.Automation/automationAccounts/variables/isEncrypted",
"notEquals": "true"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/3657f5a0-770e-44a3-b44e-9431ba1e9735",
"name": "3657f5a0-770e-44a3-b44e-9431ba1e9735"
}Bylaw3657f5a0-770e-44a3-b44e-9431ba1e9735.bylaw.ps1 · 29 lines
# Converted from AuditUnencryptedVars_Audit.json by ConvertTo-Bylaw.
Policy '3657f5a0-770e-44a3-b44e-9431ba1e9735' {
Properties @{
DisplayName = 'Automation account variables should be encrypted'
Description = 'It is important to enable encryption of Automation account variable assets when storing sensitive data'
Version = '1.1.0'
Category = 'Automation'
PolicyVersion = '1.1.0'
Mode = 'All'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'The effect determines what happens when the policy rule is evaluated to match'
}
Resource 'Microsoft.Automation/automationAccounts/variables' {
Require 'isEncrypted is true' {
Field isEncrypted | Must -Be 'true'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Automation/AuditUnencryptedVars_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw