-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
RequireNonAdminUser.json
70 lines (70 loc) · 1.93 KB
/
RequireNonAdminUser.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
{
"properties": {
"displayName": "Lab Services should require non-admin user for labs",
"description": "This policy requires non-admin user accounts to be created for the labs managed through lab-services.",
"mode": "Indexed",
"policyType": "BuiltIn",
"metadata": {
"version": "1.1.0",
"category": "Lab Services"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "String",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
},
"excludeLabPlanId": {
"type": "String",
"metadata": {
"displayName": "Lab Plan Id to exclude",
"description": "Optionally enter the lab Plan Id to exclude for this policy assignment."
},
"defaultValue": ""
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.LabServices/labs"
},
{
"field": "Microsoft.LabServices/labs/labPlanId",
"notEquals": "[parameters('excludeLabPlanId')]"
},
{
"anyOf": [
{
"field": "Microsoft.LabServices/labs/virtualMachineProfile.nonAdminUser.username",
"exists": "false"
},
{
"field": "Microsoft.LabServices/labs/virtualMachineProfile.nonAdminUser.username",
"equals": ""
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/0fd9915e-cab3-4f24-b200-6e20e1aa276a",
"name": "0fd9915e-cab3-4f24-b200-6e20e1aa276a"
}