Fix / Remediate Security Configuration of Azure Resources with Powerful Azure Modify Policies

preview_player
Показать описание
Fix / Remediate Security Configuration of Azure Resources with Powerful Azure Modify Policies

Trigger manual policy scan on a subscription:
az policy state trigger-scan

Custom modify policy to fix blob public access:
{
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"field": "Microsoft.Storage/storageAccounts/allowBlobPublicAccess",
"notEquals": false
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"conflictEffect": "audit",
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/17d1049b-9a84-46fb-8f53-869881c3d3ab"
],
"operations": [
{
"operation": "addOrReplace",
"field": "Microsoft.Storage/storageAccounts/allowBlobPublicAccess",
"value": false
}
]
}
}
},
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify"
}
}
}

Assign policy and create a remediation task.
Рекомендации по теме
Комментарии
Автор

perfect explanations🙂. Can show some more examples in effect and logic in azure policy

srinivasanrajagopalan