Skip to content

Commit 4d9b87b

Browse files
aditdalvikayousef
authored andcommitted
[Microsoft.Security] Migrate APIs from Microsoft.ApiSecurity RP (currently in private preview) to Microsoft.Security RP (Azure#21519)
* Adds base for updating Microsoft.Security from version stable/2021-06-01 to version 2022-11-20-preview * Updates readme * Updates API version in new specs and examples * Add apiCollections.json and relevant examples * Update readme.md * Fix validation errors * Fix validation errors * One more fix * Switch to full paths * More validation fixes * Try and fix the SDK errors * Fix avocado error * Remove operations.json from tag = package-preview-2022-11 based on PR comments
1 parent d5afbb9 commit 4d9b87b

File tree

6 files changed

+387
-0
lines changed

6 files changed

+387
-0
lines changed

custom-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,7 @@ ODBC
14071407
oeverify
14081408
offboard
14091409
offboards
1410+
offboarding
14101411
officedocument
14111412
OLTP
14121413
OIDC
Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Microsoft Defender for Cloud",
5+
"description": "API spec for Microsoft.Security (Microsoft Defender for Cloud) resource provider",
6+
"version": "2022-11-20-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections": {
38+
"get": {
39+
"x-ms-examples": {
40+
"Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs": {
41+
"$ref": "./examples/ApiCollections/APICollection_List_example.json"
42+
}
43+
},
44+
"tags": [
45+
"D4APICollectionList",
46+
"APIMConfig"
47+
],
48+
"description": "Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected.",
49+
"summary": "Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs",
50+
"operationId": "APICollection_List",
51+
"parameters": [
52+
{
53+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter"
54+
},
55+
{
56+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter"
57+
},
58+
{
59+
"$ref": "#/parameters/ApiManagementServiceNameParameter"
60+
},
61+
{
62+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
63+
}
64+
],
65+
"responses": {
66+
"200": {
67+
"description": "OK",
68+
"schema": {
69+
"$ref": "#/definitions/ApiCollectionResponseList"
70+
}
71+
},
72+
"default": {
73+
"description": "Error response describing why the operation failed.",
74+
"schema": {
75+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
76+
}
77+
}
78+
},
79+
"x-ms-pageable": {
80+
"nextLinkName": "nextLink"
81+
}
82+
}
83+
},
84+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}": {
85+
"get": {
86+
"x-ms-examples": {
87+
"Gets an Azure API Management API if it has been onboarded to Defender for APIs": {
88+
"$ref": "./examples/ApiCollections/APICollection_Get_example.json"
89+
}
90+
},
91+
"tags": [
92+
"D4APICollection",
93+
"APIMConfig"
94+
],
95+
"description": "Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected.",
96+
"summary": "Gets an Azure API Management API if it has been onboarded to Defender for APIs",
97+
"operationId": "APICollection_Get",
98+
"parameters": [
99+
{
100+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter"
101+
},
102+
{
103+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter"
104+
},
105+
{
106+
"$ref": "#/parameters/ApiManagementServiceNameParameter"
107+
},
108+
{
109+
"$ref": "#/parameters/ApiCollectionIdParameter"
110+
},
111+
{
112+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
113+
}
114+
],
115+
"responses": {
116+
"200": {
117+
"description": "OK",
118+
"schema": {
119+
"$ref": "#/definitions/ApiCollectionResponse"
120+
}
121+
},
122+
"default": {
123+
"description": "Error response describing why the operation failed.",
124+
"schema": {
125+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
126+
}
127+
}
128+
}
129+
},
130+
"put": {
131+
"x-ms-examples": {
132+
"Onboard an Azure API Management API to Defender for APIs": {
133+
"$ref": "./examples/ApiCollections/APICollectionOnboarding_Create_example.json"
134+
}
135+
},
136+
"tags": [
137+
"OnboardToD4API",
138+
"APIMConfig"
139+
],
140+
"description": "Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected.",
141+
"summary": "Onboard an Azure API Management API to Defender for APIs",
142+
"operationId": "APICollectionOnboarding_Create",
143+
"parameters": [
144+
{
145+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter"
146+
},
147+
{
148+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter"
149+
},
150+
{
151+
"$ref": "#/parameters/ApiManagementServiceNameParameter"
152+
},
153+
{
154+
"$ref": "#/parameters/ApiCollectionIdParameter"
155+
},
156+
{
157+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
158+
}
159+
],
160+
"responses": {
161+
"200": {
162+
"description": "OK",
163+
"schema": {
164+
"$ref": "#/definitions/ApiCollectionResponse"
165+
}
166+
},
167+
"default": {
168+
"description": "Error response describing why the operation failed.",
169+
"schema": {
170+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
171+
}
172+
}
173+
}
174+
},
175+
"delete": {
176+
"x-ms-examples": {
177+
"Delete a security recommendation task on a resource": {
178+
"$ref": "./examples/ApiCollections/APICollectionOffboarding_Delete_example.json"
179+
}
180+
},
181+
"tags": [
182+
"OffboardFromD4API",
183+
"APIMConfig"
184+
],
185+
"description": "Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations within the Azure API Management API for intrusive behaviors.",
186+
"summary": "Offboard an Azure API Management API from Defender for APIs",
187+
"operationId": "APICollectionOffboarding_Delete",
188+
"parameters": [
189+
{
190+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter"
191+
},
192+
{
193+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter"
194+
},
195+
{
196+
"$ref": "#/parameters/ApiManagementServiceNameParameter"
197+
},
198+
{
199+
"$ref": "#/parameters/ApiCollectionIdParameter"
200+
},
201+
{
202+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
203+
}
204+
],
205+
"responses": {
206+
"200": {
207+
"description": "OK"
208+
},
209+
"204": {
210+
"description": "NoContent"
211+
},
212+
"default": {
213+
"description": "Error response describing why the operation failed.",
214+
"schema": {
215+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
216+
}
217+
}
218+
}
219+
}
220+
}
221+
},
222+
"definitions": {
223+
"ApiCollectionResponseList": {
224+
"type": "object",
225+
"description": "Page of a list of API collections as represented by Defender for APIs.",
226+
"properties": {
227+
"value": {
228+
"description": "API collections in this page.",
229+
"readOnly": true,
230+
"type": "array",
231+
"items": {
232+
"$ref": "#/definitions/ApiCollectionResponse"
233+
}
234+
},
235+
"nextLink": {
236+
"readOnly": true,
237+
"type": "string",
238+
"description": "The URI to fetch the next page."
239+
}
240+
}
241+
},
242+
"ApiCollectionResponse": {
243+
"type": "object",
244+
"description": "An API collection as represented by Defender for APIs.",
245+
"properties": {
246+
"properties": {
247+
"x-ms-client-flatten": true,
248+
"$ref": "#/definitions/ApiCollectionProperties"
249+
}
250+
},
251+
"allOf": [
252+
{
253+
"$ref": "../../../common/v1/types.json#/definitions/Resource"
254+
}
255+
]
256+
},
257+
"ApiCollectionProperties": {
258+
"type": "object",
259+
"description": "Describes the properties of an API collection.",
260+
"properties": {
261+
"displayName": {
262+
"type": "string",
263+
"description": "The display name of the Azure API Management API."
264+
},
265+
"additionalData": {
266+
"type": "object",
267+
"description": "Additional data regarding the API collection.",
268+
"additionalProperties": {
269+
"type": "string"
270+
}
271+
}
272+
}
273+
}
274+
},
275+
"parameters": {
276+
"ApiManagementServiceNameParameter": {
277+
"name": "serviceName",
278+
"in": "path",
279+
"required": true,
280+
"type": "string",
281+
"description": "The name of the API Management service.",
282+
"minLength": 1,
283+
"maxLength": 50,
284+
"pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$",
285+
"x-ms-parameter-location": "method"
286+
},
287+
"ApiCollectionIdParameter": {
288+
"name": "apiCollectionId",
289+
"in": "path",
290+
"required": true,
291+
"type": "string",
292+
"description": "A string representing the apiCollections resource within the Microsoft.Security provider namespace. This string matches the Azure API Management API name.",
293+
"minLength": 1,
294+
"maxLength": 256,
295+
"x-ms-parameter-location": "method"
296+
}
297+
}
298+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
4+
"resourceGroupName": "rg1",
5+
"serviceName": "apimService1",
6+
"apiCollectionId": "echo-api",
7+
"api-version": "2022-11-20-preview"
8+
},
9+
"responses": {
10+
"200": {},
11+
"204": {}
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
4+
"resourceGroupName": "rg1",
5+
"serviceName": "apimService1",
6+
"apiCollectionId": "echo-api",
7+
"api-version": "2022-11-20-preview"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"id": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api",
13+
"name": "echo-api",
14+
"type": "Microsoft.Security/apiCollections",
15+
"properties": {
16+
"displayName": "echo-api",
17+
"additionalData": {
18+
"apiManagementApiId": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"
19+
}
20+
}
21+
}
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
4+
"resourceGroupName": "rg1",
5+
"serviceName": "apimService1",
6+
"apiCollectionId": "echo-api",
7+
"api-version": "2022-11-20-preview"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"id": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api",
13+
"name": "echo-api",
14+
"type": "Microsoft.Security/apiCollections",
15+
"properties": {
16+
"displayName": "echo-api",
17+
"additionalData": {
18+
"apiManagementApiId": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"
19+
}
20+
}
21+
}
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
4+
"resourceGroupName": "rg1",
5+
"serviceName": "apimService1",
6+
"api-version": "2022-11-20-preview"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api",
14+
"name": "echo-api",
15+
"type": "Microsoft.Security/apiCollections",
16+
"properties": {
17+
"displayName": "echo-api",
18+
"additionalData": {
19+
"apiManagementApiId": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"
20+
}
21+
}
22+
}
23+
]
24+
}
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)