/
Azure.ML.Rule.yaml
113 lines (107 loc) · 2.57 KB
/
Azure.ML.Rule.yaml
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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# Validation rules for Azure Machine Learning
#
---
# Synopsis: ML Compute Instances have idle shutdown enabled.
apiVersion: github.com/microsoft/PSRule/v1
kind: Rule
metadata:
name: Azure.ML.ComputeIdleShutdown
ref: AZR-000403
tags:
release: GA
ruleSet: 2023_12
Azure.WAF/pillar: Cost Optimization
spec:
type:
- Microsoft.MachineLearningServices/workspaces/computes
where:
field: properties.computeType
equals: ComputeInstance
condition:
field: properties.properties.idleTimeBeforeShutdown
hasValue: true
---
# Synopsis: ML Compute has local authentication disabled.
apiVersion: github.com/microsoft/PSRule/v1
kind: Rule
metadata:
name: Azure.ML.DisableLocalAuth
ref: AZR-000404
tags:
release: GA
ruleSet: 2023_12
Azure.WAF/pillar: Security
spec:
type:
- Microsoft.MachineLearningServices/workspaces/computes
condition:
field: properties.disableLocalAuth
equals: true
---
# Synopsis: ML Compute should be in a virtual network.
apiVersion: github.com/microsoft/PSRule/v1
kind: Rule
metadata:
name: Azure.ML.ComputeVnet
ref: AZR-000405
tags:
release: GA
ruleSet: 2023_12
Azure.WAF/pillar: Security
labels:
Azure.MCSB.v1/control: [ 'NS-1' ]
spec:
type:
- Microsoft.MachineLearningServices/workspaces/computes
condition:
field: properties.properties.subnet.id
hasValue: true
---
# Synopsis: Disable public network access from a Azure Machine Learning workspace.
apiVersion: github.com/microsoft/PSRule/v1
kind: Rule
metadata:
name: Azure.ML.PublicAccess
ref: AZR-000406
tags:
release: GA
ruleSet: 2023_12
Azure.WAF/pillar: Security
labels:
Azure.MCSB.v1/control: [ 'NS-2' ]
spec:
type:
- Microsoft.MachineLearningServices/workspaces
condition:
allOf:
- field: properties.allowPublicAccessWhenBehindVnet
hasDefault: false
- field: properties.publicNetworkAccess
equals: Disabled
---
# Synopsis: ML Workspaces should use user-assigned managed identity.
apiVersion: github.com/microsoft/PSRule/v1
kind: Rule
metadata:
name: Azure.ML.UserManagedIdentity
ref: AZR-000407
tags:
release: GA
ruleSet: 2023_12
Azure.WAF/pillar: Security
labels:
Azure.MCSB.v1/control: [ 'IM-3' ]
spec:
type:
- Microsoft.MachineLearningServices/workspaces
condition:
allOf:
- field: identity.type
equals: UserAssigned
- field: identity.userAssignedIdentities
exists: true
- field: properties.primaryUserAssignedIdentity
hasValue: true