Skip to content

Commit b6a3dd7

Browse files
dochollidayxxAdam Holliday
authored andcommitted
[Hub Generated] Review request for Microsoft.Security to add version preview/2021-08-01-preview (Azure#16096)
* Adds base for updating Microsoft.Security from version stable/2021-07-01 to version 2021-08-01-preview * Updates readme * Updates API version in new specs and examples * First pass at Microsoft.Security/standards for review/preview * Addressing Round-1 feedback, adding missing descriptions and changing scoping to match ProxyResource type * First pass for Microsoft.Security\standardComponents * Changes to fix a typo in an example spec * Added Microsoft.Security/standardAssignments * Fix naming convention issue * Removed types based on Hila's feedback * Changes to data model for both API calls * Fix example errors and typos * Add systemData to Microsoft.Security/standards * Changes to fix systemData linting * un-nest systemData fields in examples * More systemData placement * Naming convention name to assignments from standardAssignment * Additional example added * Changes to address descriptive comments on field types * Add systemData readOnly * prettier-fix against examples * Cleaned types to ref standard v2 common-types entry similar to securityForIoT * Re-added v2 folder? * Missed a change here? * Cleanup of v2 type completely, updated readme.md * Adds suppression to readme * Adds suppression to readme * Change modification to suppress operations linting Co-authored-by: Adam Holliday <adamho@microsoft.com>
1 parent ccfa213 commit b6a3dd7

14 files changed

+1430
-1
lines changed
Lines changed: 382 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,382 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Security Center",
5+
"description": "API spec for Microsoft.Security (Azure Security Center) resource provider",
6+
"version": "2021-08-01-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/subscriptions/{subscriptionId}/providers/Microsoft.Security/assignments": {
38+
"get": {
39+
"x-ms-examples": {
40+
"List security standardAssignments by subscription level scope": {
41+
"$ref": "./examples/Assignments/ListBySubscriptionAssignments_example.json"
42+
}
43+
},
44+
"tags": [
45+
"Assignments"
46+
],
47+
"description": "Get a list of all relevant standardAssignments over a subscription level scope",
48+
"operationId": "Assignments_ListBySubscription",
49+
"parameters": [
50+
{
51+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
52+
},
53+
{
54+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionId"
55+
}
56+
],
57+
"responses": {
58+
"200": {
59+
"description": "OK",
60+
"schema": {
61+
"$ref": "#/definitions/AssignmentList"
62+
}
63+
},
64+
"default": {
65+
"description": "Error response describing why the operation failed",
66+
"schema": {
67+
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
68+
}
69+
}
70+
},
71+
"x-ms-pageable": {
72+
"nextLinkName": "nextLink"
73+
}
74+
}
75+
},
76+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments": {
77+
"get": {
78+
"x-ms-examples": {
79+
"List security standardAssignments by subscriptionId and resourceGroup scope": {
80+
"$ref": "./examples/Assignments/ListAssignments_example.json"
81+
}
82+
},
83+
"tags": [
84+
"Assignments"
85+
],
86+
"description": "Get a list of all relevant standardAssignments available for scope",
87+
"operationId": "Assignments_List",
88+
"parameters": [
89+
{
90+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
91+
},
92+
{
93+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionId"
94+
},
95+
{
96+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupName"
97+
}
98+
],
99+
"responses": {
100+
"200": {
101+
"description": "OK",
102+
"schema": {
103+
"$ref": "#/definitions/AssignmentList"
104+
}
105+
},
106+
"default": {
107+
"description": "Error response describing why the operation failed",
108+
"schema": {
109+
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
110+
}
111+
}
112+
},
113+
"x-ms-pageable": {
114+
"nextLinkName": "nextLink"
115+
}
116+
}
117+
},
118+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId}": {
119+
"get": {
120+
"x-ms-examples": {
121+
"Get security standardAssignments by by specific standardAssignmentId": {
122+
"$ref": "./examples/Assignments/GetAssignment_example.json"
123+
}
124+
},
125+
"tags": [
126+
"Assignments"
127+
],
128+
"description": "Get a specific standard assignment for the requested scope by resourceId",
129+
"operationId": "Assignments_Get",
130+
"parameters": [
131+
{
132+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
133+
},
134+
{
135+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionId"
136+
},
137+
{
138+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupName"
139+
},
140+
{
141+
"$ref": "#/parameters/AssignmentId"
142+
}
143+
],
144+
"responses": {
145+
"200": {
146+
"description": "OK",
147+
"schema": {
148+
"$ref": "#/definitions/Assignment"
149+
}
150+
},
151+
"default": {
152+
"description": "Error response describing why the operation failed",
153+
"schema": {
154+
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
155+
}
156+
}
157+
}
158+
},
159+
"put": {
160+
"x-ms-examples": {
161+
"Exempt Recommendation From standard and resource": {
162+
"$ref": "./examples/Assignments/PutAssignment_example.json"
163+
},
164+
"Define a default standard assignment": {
165+
"$ref": "./examples/Assignments/PutDefaultAssignment_example.json"
166+
}
167+
},
168+
"tags": [
169+
"Assignments"
170+
],
171+
"description": "Create a security assignment on the given scope. Will create/update the required standard assignment. ",
172+
"operationId": "Assignments_CreateOrUpdate",
173+
"parameters": [
174+
{
175+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
176+
},
177+
{
178+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionId"
179+
},
180+
{
181+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupName"
182+
},
183+
{
184+
"$ref": "#/parameters/AssignmentId"
185+
},
186+
{
187+
"$ref": "#/parameters/AssignmentBody"
188+
}
189+
],
190+
"responses": {
191+
"201": {
192+
"description": "Created",
193+
"schema": {
194+
"$ref": "#/definitions/Assignment"
195+
}
196+
},
197+
"200": {
198+
"description": "OK - Updated",
199+
"schema": {
200+
"$ref": "#/definitions/Assignment"
201+
}
202+
},
203+
"default": {
204+
"description": "Error response describing why the operation failed",
205+
"schema": {
206+
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
207+
}
208+
}
209+
}
210+
},
211+
"delete": {
212+
"x-ms-examples": {
213+
"Delete security assignment": {
214+
"$ref": "./examples/Assignments/DeleteAssignment_example.json"
215+
}
216+
},
217+
"tags": [
218+
"Assignments"
219+
],
220+
"description": "Delete a standard assignment over a given scope",
221+
"operationId": "Assignments_Delete",
222+
"parameters": [
223+
{
224+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
225+
},
226+
{
227+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionId"
228+
},
229+
{
230+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupName"
231+
},
232+
{
233+
"$ref": "#/parameters/AssignmentId"
234+
}
235+
],
236+
"responses": {
237+
"200": {
238+
"description": "OK - Standard was deleted"
239+
},
240+
"204": {
241+
"description": "No Content - Standard does not exist"
242+
},
243+
"default": {
244+
"description": "Error response describing why the operation failed"
245+
}
246+
}
247+
}
248+
}
249+
},
250+
"definitions": {
251+
"AssignmentList": {
252+
"type": "object",
253+
"description": "Page of a standard assignment list",
254+
"properties": {
255+
"value": {
256+
"description": "Collection of standardAssignments in this page",
257+
"readOnly": true,
258+
"type": "array",
259+
"items": {
260+
"$ref": "#/definitions/Assignment"
261+
}
262+
},
263+
"nextLink": {
264+
"readOnly": true,
265+
"type": "string",
266+
"description": "The URI to fetch the next page"
267+
}
268+
}
269+
},
270+
"Assignment": {
271+
"type": "object",
272+
"description": "Security Assignment on a resource group over a given scope",
273+
"properties": {
274+
"properties": {
275+
"description": "Properties of a security assignment",
276+
"x-ms-client-flatten": true,
277+
"$ref": "#/definitions/AssignmentProperties"
278+
},
279+
"systemData": {
280+
"readOnly": true,
281+
"type": "object",
282+
"description": "Azure Resource Manager metadata containing createdBy and modifiedBy information.",
283+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData"
284+
}
285+
},
286+
"allOf": [
287+
{
288+
"$ref": "../../../common/v1/types.json#/definitions/TrackedResource"
289+
}
290+
]
291+
},
292+
"AssignmentProperties": {
293+
"type": "object",
294+
"description": "Describes the properties of a standardAssignment",
295+
"properties": {
296+
"displayName": {
297+
"description": "display name of the standardAssignment",
298+
"type": "string"
299+
},
300+
"description": {
301+
"description": "description of the standardAssignment",
302+
"type": "string"
303+
},
304+
"assignedStandard": {
305+
"description": "Standard item with key as applied to this standard assignment over the given scope",
306+
"$ref": "#/definitions/AssignedStandardItem"
307+
},
308+
"assignedComponent": {
309+
"description": "Component item with key as applied to this standard assignment over the given scope",
310+
"$ref": "#/definitions/AssignedComponentItem"
311+
},
312+
"scope": {
313+
"description": "Scope to which the standardAssignment applies - can be a subscription path or a resource group under that subscription",
314+
"type": "string"
315+
},
316+
"effect": {
317+
"description": "expected effect of this assignment (Disable/Exempt/etc)",
318+
"type": "string"
319+
},
320+
"expiresOn": {
321+
"description": "Expiration date of this assignment as a full ISO date",
322+
"type": "string",
323+
"format": "date-time"
324+
},
325+
"additionalData": {
326+
"description": "Additional data about the assignment",
327+
"type": "object",
328+
"properties": {
329+
"exemptionCategory": {
330+
"description": "Exemption category of this assignment",
331+
"type": "string"
332+
}
333+
}
334+
},
335+
"metadata": {
336+
"description": "The assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.",
337+
"type": "object"
338+
}
339+
}
340+
},
341+
"AssignedStandardItem": {
342+
"type": "object",
343+
"description": "describe the properties of a of a security standard object reference",
344+
"properties": {
345+
"id": {
346+
"description": "full resourceId of the Microsoft.Security/standard object",
347+
"type": "string"
348+
}
349+
}
350+
},
351+
"AssignedComponentItem": {
352+
"type": "object",
353+
"description": "describe the properties of a security assessment object reference (by key)",
354+
"properties": {
355+
"key": {
356+
"description": "unique key to a security assessment object",
357+
"type": "string"
358+
}
359+
}
360+
}
361+
},
362+
"parameters": {
363+
"AssignmentId": {
364+
"name": "assignmentId",
365+
"in": "path",
366+
"required": true,
367+
"type": "string",
368+
"description": "The security assignment key - unique key for the standard assignment",
369+
"x-ms-parameter-location": "method"
370+
},
371+
"AssignmentBody": {
372+
"name": "assignment",
373+
"in": "body",
374+
"required": true,
375+
"schema": {
376+
"$ref": "#/definitions/Assignment"
377+
},
378+
"description": "Custom standard assignment over a pre-defined scope",
379+
"x-ms-parameter-location": "method"
380+
}
381+
}
382+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"parameters": {
3+
"api-version": "2021-08-01-preview",
4+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
5+
"resourceGroupName": "myResourceGroup",
6+
"assignmentId": "8bb8be0a-6010-4789-812f-e4d661c4ed0e"
7+
},
8+
"responses": {
9+
"200": {},
10+
"204": {}
11+
}
12+
}

0 commit comments

Comments
 (0)