-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
AuditDiagnosticLog_Audit.json
106 lines (106 loc) · 3.65 KB
/
AuditDiagnosticLog_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
{
"properties": {
"displayName": "Resource logs in Azure Machine Learning Workspaces should be enabled",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Resource logs enable recreating activity trails to use for investigation purposes when a security incident occurs or when your network is compromised.",
"metadata": {
"version": "1.0.1",
"category": "Machine Learning"
},
"version": "1.0.1",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "AuditIfNotExists",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
},
"requiredRetentionDays": {
"type": "String",
"defaultValue": "365",
"metadata": {
"displayName": "Required retention (days)",
"description": "The required resource logs retention in days if exporting to an Azure Storage account"
}
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.MachineLearningServices/workspaces"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Insights/diagnosticSettings",
"existenceCondition": {
"count": {
"field": "Microsoft.Insights/diagnosticSettings/logs[*]",
"where": {
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled",
"equals": "true"
},
{
"anyOf": [
{
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days",
"equals": "0"
},
{
"value": "[padLeft(current('Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days'), 3, '0')]",
"greaterOrEquals": "[padLeft(parameters('requiredRetentionDays'), 3, '0')]"
}
]
},
{
"field": "Microsoft.Insights/diagnosticSettings/logs.enabled",
"equals": "true"
}
]
},
{
"allOf": [
{
"field": "Microsoft.Insights/diagnosticSettings/logs.enabled",
"equals": "true"
},
{
"anyOf": [
{
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled",
"notEquals": "true"
},
{
"field": "Microsoft.Insights/diagnosticSettings/storageAccountId",
"exists": false
}
]
}
]
}
]
}
},
"greaterOrEquals": 1
}
}
}
},
"versions": [
"1.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/afe0c3be-ba3b-4544-ba52-0c99672a8ad6",
"name": "afe0c3be-ba3b-4544-ba52-0c99672a8ad6"
}