Skip to content

Commit f73602d

Browse files
authored
Microsoft.Authorization 2020-09-01 policy entity APIs (#11712)
* Copy old specs to new path * Add 2020-09-01 policy entities * Add description * Fix prettier * Fix schema and python * Remove preview API from stable tag * Fix go path * Small amount of swagger validation cleanup * Fix prettier violation * Remove obsolete sku property * Fix GO readme ordering * Partially revert GO ordering
1 parent 8d4a5e2 commit f73602d

File tree

47 files changed

+5077
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5077
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2",
4+
"policyDefinitionName": "ResourceNaming",
5+
"api-version": "2020-09-01",
6+
"parameters": {
7+
"properties": {
8+
"mode": "All",
9+
"displayName": "Enforce resource naming convention",
10+
"description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'",
11+
"metadata": {
12+
"category": "Naming"
13+
},
14+
"policyRule": {
15+
"if": {
16+
"not": {
17+
"field": "name",
18+
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]"
19+
}
20+
},
21+
"then": {
22+
"effect": "deny"
23+
}
24+
},
25+
"parameters": {
26+
"prefix": {
27+
"type": "String",
28+
"metadata": {
29+
"displayName": "Prefix",
30+
"description": "Resource name prefix"
31+
}
32+
},
33+
"suffix": {
34+
"type": "String",
35+
"metadata": {
36+
"displayName": "Suffix",
37+
"description": "Resource name suffix"
38+
}
39+
}
40+
}
41+
}
42+
}
43+
},
44+
"responses": {
45+
"201": {
46+
"headers": {},
47+
"body": {
48+
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming",
49+
"type": "Microsoft.Authorization/policyDefinitions",
50+
"name": "ResourceNaming",
51+
"properties": {
52+
"mode": "All",
53+
"displayName": "Naming Convention",
54+
"description": "Force resource names to begin with 'prefix' and end with 'suffix'",
55+
"metadata": {
56+
"category": "Naming"
57+
},
58+
"policyRule": {
59+
"if": {
60+
"not": {
61+
"field": "name",
62+
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]"
63+
}
64+
},
65+
"then": {
66+
"effect": "deny"
67+
}
68+
},
69+
"parameters": {
70+
"prefix": {
71+
"type": "String",
72+
"metadata": {
73+
"displayName": "Prefix",
74+
"description": "Resource name prefix"
75+
}
76+
},
77+
"suffix": {
78+
"type": "String",
79+
"metadata": {
80+
"displayName": "Suffix",
81+
"description": "Resource name suffix"
82+
}
83+
}
84+
},
85+
"policyType": "Custom"
86+
}
87+
}
88+
}
89+
}
90+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2",
4+
"policyDefinitionName": "EventHubDiagnosticLogs",
5+
"api-version": "2020-09-01",
6+
"parameters": {
7+
"properties": {
8+
"mode": "Indexed",
9+
"displayName": "Event Hubs should have diagnostic logging enabled",
10+
"description": "Audit enabling of logs and retain them up to a year. This enables recreation of activity trails for investigation purposes when a security incident occurs or your network is compromised",
11+
"metadata": {
12+
"category": "Event Hub"
13+
},
14+
"policyRule": {
15+
"if": {
16+
"field": "type",
17+
"equals": "Microsoft.EventHub/namespaces"
18+
},
19+
"then": {
20+
"effect": "AuditIfNotExists",
21+
"details": {
22+
"type": "Microsoft.Insights/diagnosticSettings",
23+
"existenceCondition": {
24+
"allOf": [
25+
{
26+
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled",
27+
"equals": "true"
28+
},
29+
{
30+
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days",
31+
"equals": "[parameters('requiredRetentionDays')]"
32+
}
33+
]
34+
}
35+
}
36+
}
37+
},
38+
"parameters": {
39+
"requiredRetentionDays": {
40+
"type": "Integer",
41+
"defaultValue": 365,
42+
"allowedValues": [
43+
0,
44+
30,
45+
90,
46+
180,
47+
365
48+
],
49+
"metadata": {
50+
"displayName": "Required retention (days)",
51+
"description": "The required diagnostic logs retention in days"
52+
}
53+
}
54+
}
55+
}
56+
}
57+
},
58+
"responses": {
59+
"201": {
60+
"headers": {},
61+
"body": {
62+
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming",
63+
"type": "Microsoft.Authorization/policyDefinitions",
64+
"name": "ResourceNaming",
65+
"properties": {
66+
"mode": "Indexed",
67+
"displayName": "Event Hubs should have diagnostic logging enabled",
68+
"description": "Audit enabling of logs and retain them up to a year. This enables recreation of activity trails for investigation purposes when a security incident occurs or your network is compromised",
69+
"metadata": {
70+
"category": "Event Hub"
71+
},
72+
"policyRule": {
73+
"if": {
74+
"field": "type",
75+
"equals": "Microsoft.EventHub/namespaces"
76+
},
77+
"then": {
78+
"effect": "AuditIfNotExists",
79+
"details": {
80+
"type": "Microsoft.Insights/diagnosticSettings",
81+
"existenceCondition": {
82+
"allOf": [
83+
{
84+
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled",
85+
"equals": "true"
86+
},
87+
{
88+
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days",
89+
"equals": "[parameters('requiredRetentionDays')]"
90+
}
91+
]
92+
}
93+
}
94+
}
95+
},
96+
"parameters": {
97+
"requiredRetentionDays": {
98+
"type": "Integer",
99+
"defaultValue": 365,
100+
"allowedValues": [
101+
0,
102+
30,
103+
90,
104+
180,
105+
365
106+
],
107+
"metadata": {
108+
"displayName": "Required retention (days)",
109+
"description": "The required diagnostic logs retention in days"
110+
}
111+
}
112+
}
113+
}
114+
}
115+
}
116+
}
117+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"parameters": {
3+
"managementGroupId": "MyManagementGroup",
4+
"policyDefinitionName": "ResourceNaming",
5+
"api-version": "2020-09-01",
6+
"parameters": {
7+
"properties": {
8+
"mode": "All",
9+
"displayName": "Enforce resource naming convention",
10+
"description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'",
11+
"metadata": {
12+
"category": "Naming"
13+
},
14+
"policyRule": {
15+
"if": {
16+
"not": {
17+
"field": "name",
18+
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]"
19+
}
20+
},
21+
"then": {
22+
"effect": "deny"
23+
}
24+
},
25+
"parameters": {
26+
"prefix": {
27+
"type": "String",
28+
"metadata": {
29+
"displayName": "Prefix",
30+
"description": "Resource name prefix"
31+
}
32+
},
33+
"suffix": {
34+
"type": "String",
35+
"metadata": {
36+
"displayName": "Suffix",
37+
"description": "Resource name suffix"
38+
}
39+
}
40+
}
41+
}
42+
}
43+
},
44+
"responses": {
45+
"201": {
46+
"headers": {},
47+
"body": {
48+
"id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming",
49+
"type": "Microsoft.Authorization/policyDefinitions",
50+
"name": "ResourceNaming",
51+
"properties": {
52+
"mode": "All",
53+
"displayName": "Naming Convention",
54+
"description": "Force resource names to begin with 'prefix' and end with 'suffix'",
55+
"metadata": {
56+
"category": "Naming"
57+
},
58+
"policyRule": {
59+
"if": {
60+
"not": {
61+
"field": "name",
62+
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]"
63+
}
64+
},
65+
"then": {
66+
"effect": "deny"
67+
}
68+
},
69+
"parameters": {
70+
"prefix": {
71+
"type": "String",
72+
"metadata": {
73+
"displayName": "Prefix",
74+
"description": "Resource name prefix"
75+
}
76+
},
77+
"suffix": {
78+
"type": "String",
79+
"metadata": {
80+
"displayName": "Suffix",
81+
"description": "Resource name suffix"
82+
}
83+
}
84+
},
85+
"policyType": "Custom"
86+
}
87+
}
88+
}
89+
}
90+
}

0 commit comments

Comments
 (0)