Skip to content

Commit 192d803

Browse files
ruhanw087Ruhan Waghmare
andauthored
new search policy to enable while switching from api keys to rbac auth (#521)
Co-authored-by: Ruhan Waghmare <rug@macbook-pro.lan>
1 parent 63f0eb3 commit 192d803

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"type": "Microsoft.Authorization/policyDefinitions",
3+
"name": "e62541ee-b22d-4942-afa0-e15ecb4472da",
4+
"properties": {
5+
"displayName": "Auth failure should return 403 when in transition from api keys to RBAC authentication",
6+
"mode": "All",
7+
"description": "Set auth failure mode to https403 for search services in the transition state between using api keys for authentication to RBAC",
8+
"metadata": {
9+
"category": "Search",
10+
"version": "1.0.0"
11+
},
12+
"parameters": {
13+
"effect": {
14+
"type": "String",
15+
"metadata": {
16+
"displayName": "Effect",
17+
"description": "Enable or disable the execution of the policy"
18+
},
19+
"allowedValues": [
20+
"Audit",
21+
"Disabled"
22+
],
23+
"defaultValue": "Audit"
24+
}
25+
},
26+
"policyRule": {
27+
"if": {
28+
"allOf": [
29+
{
30+
"field": "type",
31+
"equals": "Microsoft.Search/searchServices"
32+
},
33+
{
34+
"field": "Microsoft.Search/searchServices/disableLocalAuth",
35+
"notEquals": "true"
36+
},
37+
{
38+
"field": "Microsoft.Search/searchServices/authOptions.aadOrApiKey.aadAuthFailureMode",
39+
"notEquals": "http403"
40+
}
41+
]
42+
},
43+
"then": {
44+
"effect": "[parameters('effect')]"
45+
}
46+
}
47+
}
48+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"effect": {
3+
"type": "String",
4+
"metadata": {
5+
"displayName": "Effect",
6+
"description": "Enable or disable the execution of the policy"
7+
},
8+
"allowedValues": [
9+
"Audit",
10+
"Disabled"
11+
],
12+
"defaultValue": "Audit"
13+
}
14+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"if": {
3+
"allOf": [
4+
{
5+
"field": "type",
6+
"equals": "Microsoft.Search/searchServices"
7+
},
8+
{
9+
"field": "Microsoft.Search/searchServices/disableLocalAuth",
10+
"notEquals": "true"
11+
},
12+
{
13+
"field": "Microsoft.Search/searchServices/authOptions.aadOrApiKey.aadAuthFailureMode",
14+
"notEquals": "http403"
15+
}
16+
]
17+
},
18+
"then": {
19+
"effect": "[parameters('effect')]"
20+
}
21+
}

0 commit comments

Comments
 (0)