-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
DiagnosticSettingsForTypes_Audit.json
107 lines (107 loc) · 3.57 KB
/
DiagnosticSettingsForTypes_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
{
"properties": {
"displayName": "Audit diagnostic setting for selected resource types",
"policyType": "BuiltIn",
"mode": "All",
"description": "Audit diagnostic setting for selected resource types. Be sure to select only resource types which support diagnostics settings.",
"metadata": {
"version": "2.0.1",
"category": "Monitoring"
},
"version": "2.0.1",
"parameters": {
"listOfResourceTypes": {
"type": "Array",
"metadata": {
"displayName": "Resource Types",
"strongType": "resourceTypes"
}
},
"logsEnabled": {
"type": "Boolean",
"metadata": {
"displayName": "Logs Enabled"
},
"allowedValues": [
true,
false
],
"defaultValue": true
},
"metricsEnabled": {
"type": "Boolean",
"metadata": {
"displayName": "Metrics Enabled"
},
"allowedValues": [
true,
false
],
"defaultValue": true
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"notIn": [
"microsoft.security/assessmentmetadata",
"microsoft.network/networksecuritygroups/securityrules",
"microsoft.storage/storageaccounts/queueservices/queues",
"microsoft.operationalinsights/workspaces/tables",
"microsoft.machinelearningservices/workspaces/jobs",
"microsoft.authorization/rolemanagementpolicies",
"microsoft.apimanagement/service/apis/operations",
"microsoft.apimanagement/service/apis/operations/tags",
"microsoft.compute/disks",
"microsoft.compute/virtualmachines/extensions",
"microsoft.authorization/roleassignments",
"microsoft.storage/storageaccounts/tableservices/tables",
"microsoft.insights/components/proactivedetectionconfigs",
"microsoft.network/routetables/routes",
"microsoft.machinelearningservices/workspaces/environments/versions",
"microsoft.sql/servers/databases/advisors",
"microsoft.security/policies",
"microsoft.resources/subscriptions/resourcegroups",
"microsoft.authorization/roledefinitions",
"microsoft.apimanagement/service/apis/operations/policies",
"microsoft.compute/snapshots",
"microsoft.datafactory/factories/pipelines",
"microsoft.datafactory/factories/datasets",
"microsoft.network/virtualnetworks/subnets",
"microsoft.security/pricings"
]
},
{
"field": "type",
"in": "[parameters('listOfResourceTypes')]"
}
]
},
"then": {
"effect": "AuditIfNotExists",
"details": {
"type": "Microsoft.Insights/diagnosticSettings",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.Insights/diagnosticSettings/logs.enabled",
"equals": "[parameters('logsEnabled')]"
},
{
"field": "Microsoft.Insights/diagnosticSettings/metrics.enabled",
"equals": "[parameters('metricsEnabled')]"
}
]
}
}
}
},
"versions": [
"2.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/7f89b1eb-583c-429a-8828-af049802c1d9",
"name": "7f89b1eb-583c-429a-8828-af049802c1d9"
}