-
Notifications
You must be signed in to change notification settings - Fork 982
/
DENYACTION-DeleteUAMIAMAPolicyAssignment.json
75 lines (75 loc) · 2.98 KB
/
DENYACTION-DeleteUAMIAMAPolicyAssignment.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/managementGroupDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"topLevelManagementGroupPrefix": {
"type": "string",
"metadata": {
"description": "Provide the ESLZ company prefix to the intermediate root management group containing the policy definitions."
}
},
"enforcementMode": {
"type": "string",
"allowedValues": [
"Default",
"DoNotEnforce"
],
"defaultValue": "Default"
},
"effect": {
"type": "string",
"allowedValues": [
"DenyAction",
"Disabled"
],
"defaultValue": "DenyAction"
},
"resourceName": {
"type": "string",
"metadata": {
"description": "Provide the name of the resource that you want to protect from accidental deletion."
}
},
"resourceType": {
"type": "string",
"metadata": {
"description": "Provide the resource type that you want to protect from accidental deletion."
}
}
},
"variables": {
"policyDefinitions": {
"denyActionResourceDeletion": "[concat('/providers/Microsoft.Management/managementGroups/', parameters('topLevelManagementGroupPrefix'), '/providers/Microsoft.Authorization/policyDefinitions/DenyAction-DeleteResources')]"
},
"policyAssignmentNames": {
"denyActionResourceDeletion": "DenyAction-DeleteUAMIAMA",
"description": "This policy provides a safeguard against accidental removal of the User Assigned Managed Identity used by AMA by blocking delete calls using deny action effect.",
"displayName": "Do not allow deletion of the User Assigned Managed Identity used by AMA"
}
},
"resources": [
{
"type": "Microsoft.Authorization/policyAssignments",
"apiVersion": "2022-06-01",
"name": "[variables('policyAssignmentNames').denyActionResourceDeletion]",
"properties": {
"description": "[variables('policyAssignmentNames').description]",
"displayName": "[variables('policyAssignmentNames').displayName]",
"policyDefinitionId": "[variables('policyDefinitions').denyActionResourceDeletion]",
"enforcementMode": "[parameters('enforcementMode')]",
"parameters": {
"effect": {
"value": "[parameters('effect')]"
},
"resourceName": {
"value": "[parameters('resourceName')]"
},
"resourceType": {
"value": "[parameters('resourceType')]"
}
}
}
}
],
"outputs": {}
}