-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
DiagnosticSettingsExistsAudit_Audit.json
163 lines (163 loc) · 6.33 KB
/
DiagnosticSettingsExistsAudit_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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
{
"properties": {
"displayName": "Resource logs should be enabled for Audit on supported resources",
"description": "Resource logs should be enabled to track activities and events that take place on your resources and give you visibility and insights into any changes that occur. The existence of a diagnostic setting for category group Audit on the selected resource types ensures that these logs are enabled and captured. Applicable resource types are those that support the \"Audit\" category group.",
"policyType": "BuiltIn",
"mode": "Indexed",
"metadata": {
"version": "1.0.0",
"category": "Monitoring"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "AuditIfNotExists"
},
"requiredLogLevel": {
"type": "String",
"metadata": {
"displayName": "Required Log Level",
"description": "Granularity of logging required to be enabled on a resource to meet compliance. Audit will check that the resource has a diagnostic setting enabled for categoryGroup audit or allLogs. Any will only check that a diagnostic setting exists for the resource."
},
"allowedValues": [
"Audit",
"Any"
],
"defaultValue": "Audit"
},
"resourceTypeList": {
"type": "array",
"metadata": {
"displayName": "Resource Types",
"description": "List of Resource Types to be evaluated for diagnostic setting existence."
},
"allowedValues": [
"microsoft.agfoodplatform/farmbeats",
"microsoft.apimanagement/service",
"microsoft.appconfiguration/configurationstores",
"microsoft.attestation/attestationproviders",
"microsoft.automation/automationaccounts",
"microsoft.avs/privateclouds",
"microsoft.cache/redis",
"microsoft.cdn/profiles",
"microsoft.cognitiveservices/accounts",
"microsoft.containerregistry/registries",
"microsoft.devices/iothubs",
"microsoft.eventgrid/topics",
"microsoft.eventgrid/domains",
"microsoft.eventgrid/partnernamespaces",
"microsoft.eventhub/namespaces",
"microsoft.keyvault/vaults",
"microsoft.keyvault/managedhsms",
"microsoft.machinelearningservices/workspaces",
"microsoft.media/mediaservices",
"microsoft.media/videoanalyzers",
"microsoft.netapp/netappaccounts/capacitypools/volumes",
"microsoft.network/publicipaddresses",
"microsoft.network/virtualnetworkgateways",
"microsoft.network/p2svpngateways",
"microsoft.network/frontdoors",
"microsoft.network/bastionhosts",
"microsoft.operationalinsights/workspaces",
"microsoft.purview/accounts",
"microsoft.servicebus/namespaces",
"microsoft.signalrservice/signalr",
"microsoft.signalrservice/webpubsub",
"microsoft.sql/servers/databases",
"microsoft.sql/managedinstances"
],
"defaultValue": [
"microsoft.agfoodplatform/farmbeats",
"microsoft.apimanagement/service",
"microsoft.appconfiguration/configurationstores",
"microsoft.attestation/attestationproviders",
"microsoft.automation/automationaccounts",
"microsoft.avs/privateclouds",
"microsoft.cache/redis",
"microsoft.cdn/profiles",
"microsoft.cognitiveservices/accounts",
"microsoft.containerregistry/registries",
"microsoft.devices/iothubs",
"microsoft.eventgrid/topics",
"microsoft.eventgrid/domains",
"microsoft.eventgrid/partnernamespaces",
"microsoft.eventhub/namespaces",
"microsoft.keyvault/vaults",
"microsoft.keyvault/managedhsms",
"microsoft.machinelearningservices/workspaces",
"microsoft.media/mediaservices",
"microsoft.media/videoanalyzers",
"microsoft.netapp/netappaccounts/capacitypools/volumes",
"microsoft.network/publicipaddresses",
"microsoft.network/virtualnetworkgateways",
"microsoft.network/p2svpngateways",
"microsoft.network/frontdoors",
"microsoft.network/bastionhosts",
"microsoft.operationalinsights/workspaces",
"microsoft.purview/accounts",
"microsoft.servicebus/namespaces",
"microsoft.signalrservice/signalr",
"microsoft.signalrservice/webpubsub",
"microsoft.sql/servers/databases",
"microsoft.sql/managedinstances"
]
}
},
"policyRule": {
"if": {
"field": "type",
"in": "[parameters('resourceTypeList')]"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Insights/diagnosticSettings",
"existenceCondition": {
"count": {
"field": "Microsoft.Insights/diagnosticSettings/logs[*]",
"where": {
"allOf": [
{
"field": "Microsoft.Insights/diagnosticSettings/logs[*].enabled",
"equals": "true"
},
{
"anyOf": [
{
"value": "[parameters('requiredLogLevel')]",
"equals": "any"
},
{
"field": "microsoft.insights/diagnosticSettings/logs[*].categoryGroup",
"equals": "audit"
},
{
"field": "microsoft.insights/diagnosticSettings/logs[*].categoryGroup",
"equals": "allLogs"
}
]
}
]
}
},
"greater": 0
}
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/187242f4-89c6-4c43-9a4e-188c0efacc5f",
"name": "187242f4-89c6-4c43-9a4e-188c0efacc5f"
}