-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
ActivityLog_PolicyOperations_Audit.json
113 lines (113 loc) · 3.58 KB
/
ActivityLog_PolicyOperations_Audit.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
"properties": {
"displayName": "An activity log alert should exist for specific Policy operations",
"description": "This policy audits specific Policy operations with no activity log alerts configured.",
"policyType": "BuiltIn",
"mode": "All",
"metadata": {
"version": "3.0.0",
"category": "Monitoring"
},
"version": "3.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "AuditIfNotExists"
},
"operationName": {
"type": "String",
"metadata": {
"displayName": "Operation Name",
"description": "Policy Operation name for which activity log alert should exist"
},
"allowedValues": [
"Microsoft.Authorization/policyAssignments/write",
"Microsoft.Authorization/policyAssignments/delete"
]
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Resources/subscriptions"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Insights/ActivityLogAlerts",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.Insights/ActivityLogAlerts/enabled",
"equals": "true"
},
{
"count": {
"field": "Microsoft.Insights/ActivityLogAlerts/condition.allOf[*]",
"where": {
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.Insights/ActivityLogAlerts/condition.allOf[*].field",
"equals": "category"
},
{
"field": "Microsoft.Insights/ActivityLogAlerts/condition.allOf[*].equals",
"equals": "Administrative"
}
]
},
{
"allOf": [
{
"field": "Microsoft.Insights/ActivityLogAlerts/condition.allOf[*].field",
"equals": "operationName"
},
{
"field": "Microsoft.Insights/ActivityLogAlerts/condition.allOf[*].equals",
"equals": "[parameters('operationName')]"
}
]
}
]
}
},
"equals": 2
},
{
"not": {
"field": "Microsoft.Insights/ActivityLogAlerts/condition.allOf[*].field",
"equals": "category"
}
},
{
"not": {
"field": "Microsoft.Insights/ActivityLogAlerts/condition.allOf[*].field",
"equals": "operationName"
}
}
]
}
}
}
},
"versions": [
"3.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c5447c04-a4d7-4ba8-a263-c9ee321a6858",
"name": "c5447c04-a4d7-4ba8-a263-c9ee321a6858"
}