Skip to content

Commit 5379c70

Browse files
committed
include custom policy samples
1 parent 49102ce commit 5379c70

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed

samples/microsoft/infrastructure-setup/05-custom-policy-definitions/deny-disallowed-connections.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"displayName": "Allowed connection categories"
1414
},
1515
"defaultValue": [
16-
"CognitiveSearch"
16+
"BingLLMSearch"
1717
]
1818
}
1919
},
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"properties": {
3+
"displayName": "Only allow Foundry MCP connections from select sources",
4+
"policyType": "Custom",
5+
"mode": "All",
6+
"description": "Only selected Foundry MCP connection sources are allowed",
7+
"version": "1.0.0",
8+
"parameters": {
9+
"allowedSources": {
10+
"type": "Array",
11+
"metadata": {
12+
"description": "Only select target addresses are allowed for MCP connections.",
13+
"displayName": "Allowed connection targets"
14+
},
15+
"defaultValue": [
16+
"https://api.githubcopilot.com/mcp"
17+
]
18+
}
19+
},
20+
"policyRule": {
21+
"if": {
22+
"anyOf": [
23+
{
24+
"allOf": [
25+
{
26+
"field": "type",
27+
"equals": "Microsoft.CognitiveServices/accounts/connections"
28+
},
29+
{
30+
"field": "Microsoft.CognitiveServices/accounts/connections/category",
31+
"equals": "RemoteTool"
32+
},
33+
{
34+
"field": "Microsoft.CognitiveServices/accounts/connections/target",
35+
"notIn": "[parameters('allowedSources')]"
36+
}
37+
]
38+
},
39+
{
40+
"allOf": [
41+
{
42+
"field": "type",
43+
"equals": "Microsoft.CognitiveServices/accounts/projects/connections"
44+
},
45+
{
46+
"field": "Microsoft.CognitiveServices/accounts/connections/category",
47+
"equals": "RemoteTool"
48+
},
49+
{
50+
"field": "Microsoft.CognitiveServices/accounts/projects/connections/target",
51+
"notIn": "[parameters('allowedSources')]"
52+
}
53+
]
54+
}
55+
]
56+
},
57+
"then": {
58+
"effect": "deny"
59+
}
60+
},
61+
"versions": [
62+
"1.0.0"
63+
]
64+
}
65+
}

0 commit comments

Comments
 (0)