Skip to content

Commit 03d81a5

Browse files
S360: Add server security alerts list by server (#12302)
* Add serverSecurityAlertPolicies APIs for MySQL servers * Add ServerSecurityAlertsListByServer * Add List operation to serverSecurityAlertPolicies of mysql * fixes after sync with latest * fixes * fixes
1 parent 4a2a472 commit 03d81a5

File tree

13 files changed

+565
-1
lines changed

13 files changed

+565
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"resourceGroupName": "securityalert-4799",
5+
"serverName": "securityalert-6440",
6+
"api-version": "2018-06-01-preview"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMariaDB/servers/securityalert-6440/securityAlertPolicies",
14+
"name": "Default",
15+
"type": "Microsoft.DBforMariaDB/servers/securityAlertPolicies",
16+
"properties": {
17+
"state": "Disabled",
18+
"emailAccountAdmins": true,
19+
"emailAddresses": [
20+
"test@microsoft.com;user@microsoft.com"
21+
],
22+
"disabledAlerts": [
23+
"Access_Anomaly"
24+
],
25+
"retentionDays": 0,
26+
"storageEndpoint": "https://mystorage.blob.core.windows.net"
27+
}
28+
}
29+
]
30+
}
31+
}
32+
}
33+
}

specification/mariadb/resource-manager/Microsoft.DBforMariaDB/preview/2018-06-01-preview/mariadb.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,48 @@
14121412
}
14131413
}
14141414
},
1415+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies": {
1416+
"get": {
1417+
"tags": [
1418+
"ServerSecurityAlertPolicies"
1419+
],
1420+
"description": "Get the server's threat detection policies.",
1421+
"operationId": "ServerSecurityAlertPolicies_ListByServer",
1422+
"parameters": [
1423+
{
1424+
"$ref": "#/parameters/ResourceGroupParameter"
1425+
},
1426+
{
1427+
"$ref": "#/parameters/ServerNameParameter"
1428+
},
1429+
{
1430+
"$ref": "#/parameters/SubscriptionIdParameter"
1431+
},
1432+
{
1433+
"$ref": "#/parameters/ApiVersionParameter"
1434+
}
1435+
],
1436+
"responses": {
1437+
"200": {
1438+
"description": "Successfully retrieved the server threat detection policies.",
1439+
"schema": {
1440+
"$ref": "#/definitions/ServerSecurityAlertPolicyListResult"
1441+
}
1442+
},
1443+
"default": {
1444+
"description": "*** Error Responses: ***\n\n * 400 SecurityAlertPoliciesInvalidStorageAccountName - The provided storage account is not valid or does not exist.\n\n * 400 SecurityAlertPoliciesInvalidStorageAccountCredentials - The provided storage account access key is not valid.\n\n * 400 InvalidServerSecurityAlertPolicyCreateRequest - The create server Threat Detection security alert policy request does not exist or has no properties object.\n\n * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.\n\n * 400 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 400 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 409 ServerSecurityAlertPolicyInProgress - Set server security alert policy is already in progress\n\n * 409 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later.\n\n * 500 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 500 GetServerSecurityAlertPolicyFailed - Failed to get Threat Detection settings"
1445+
}
1446+
},
1447+
"x-ms-pageable": {
1448+
"nextLinkName": "nextLink"
1449+
},
1450+
"x-ms-examples": {
1451+
"List the server's threat detection policies": {
1452+
"$ref": "./examples/ServerSecurityAlertsListByServer.json"
1453+
}
1454+
}
1455+
}
1456+
},
14151457
"/providers/Microsoft.DBForMariaDB/operations": {
14161458
"get": {
14171459
"tags": [
@@ -2421,6 +2463,25 @@
24212463
},
24222464
"description": "An error response from the Batch service."
24232465
},
2466+
"ServerSecurityAlertPolicyListResult": {
2467+
"description": "A list of the server's security alert policies.",
2468+
"type": "object",
2469+
"properties": {
2470+
"value": {
2471+
"description": "Array of results.",
2472+
"type": "array",
2473+
"items": {
2474+
"$ref": "#/definitions/ServerSecurityAlertPolicy"
2475+
},
2476+
"readOnly": true
2477+
},
2478+
"nextLink": {
2479+
"description": "Link to retrieve next page of results.",
2480+
"type": "string",
2481+
"readOnly": true
2482+
}
2483+
}
2484+
},
24242485
"CloudErrorBody": {
24252486
"x-ms-external": true,
24262487
"properties": {

specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/ServerSecurityAlertPolicies.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,48 @@
135135
}
136136
}
137137
}
138+
},
139+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies": {
140+
"get": {
141+
"tags": [
142+
"ServerSecurityAlertPolicies"
143+
],
144+
"description": "Get the server's threat detection policies.",
145+
"operationId": "ServerSecurityAlertPolicies_ListByServer",
146+
"parameters": [
147+
{
148+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
149+
},
150+
{
151+
"$ref": "#/parameters/ServerNameParameter"
152+
},
153+
{
154+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
155+
},
156+
{
157+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
158+
}
159+
],
160+
"responses": {
161+
"200": {
162+
"description": "Successfully retrieved the server threat detection policies.",
163+
"schema": {
164+
"$ref": "#/definitions/ServerSecurityAlertPolicyListResult"
165+
}
166+
},
167+
"default": {
168+
"description": "*** Error Responses: ***\n\n * 400 SecurityAlertPoliciesInvalidStorageAccountName - The provided storage account is not valid or does not exist.\n\n * 400 SecurityAlertPoliciesInvalidStorageAccountCredentials - The provided storage account access key is not valid.\n\n * 400 InvalidServerSecurityAlertPolicyCreateRequest - The create server Threat Detection security alert policy request does not exist or has no properties object.\n\n * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.\n\n * 400 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 400 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 409 ServerSecurityAlertPolicyInProgress - Set server security alert policy is already in progress\n\n * 409 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later.\n\n * 500 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 500 GetServerSecurityAlertPolicyFailed - Failed to get Threat Detection settings"
169+
}
170+
},
171+
"x-ms-pageable": {
172+
"nextLinkName": "nextLink"
173+
},
174+
"x-ms-examples": {
175+
"List the server's threat detection policies": {
176+
"$ref": "./examples/ServerSecurityAlertsListByServer.json"
177+
}
178+
}
179+
}
138180
}
139181
},
140182
"definitions": {
@@ -205,6 +247,25 @@
205247
"x-ms-client-flatten": true
206248
}
207249
}
250+
},
251+
"ServerSecurityAlertPolicyListResult": {
252+
"description": "A list of the server's security alert policies.",
253+
"type": "object",
254+
"properties": {
255+
"value": {
256+
"description": "Array of results.",
257+
"type": "array",
258+
"items": {
259+
"$ref": "#/definitions/ServerSecurityAlertPolicy"
260+
},
261+
"readOnly": true
262+
},
263+
"nextLink": {
264+
"description": "Link to retrieve next page of results.",
265+
"type": "string",
266+
"readOnly": true
267+
}
268+
}
208269
}
209270
},
210271
"parameters": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"resourceGroupName": "securityalert-4799",
5+
"serverName": "securityalert-6440",
6+
"api-version": "2018-06-01"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMariaDB/servers/securityalert-6440/securityAlertPolicies",
14+
"name": "Default",
15+
"type": "Microsoft.DBforMariaDB/servers/securityAlertPolicies",
16+
"properties": {
17+
"state": "Disabled",
18+
"emailAccountAdmins": true,
19+
"emailAddresses": [
20+
"test@microsoft.com;user@microsoft.com"
21+
],
22+
"disabledAlerts": [
23+
"Access_Anomaly"
24+
],
25+
"retentionDays": 0,
26+
"storageEndpoint": "https://mystorage.blob.core.windows.net"
27+
}
28+
}
29+
]
30+
}
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"resourceGroupName": "securityalert-4799",
5+
"serverName": "securityalert-6440",
6+
"api-version": "2017-12-01-preview"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies",
14+
"name": "Default",
15+
"type": "Microsoft.DBforMySQL/servers/securityAlertPolicies",
16+
"properties": {
17+
"state": "Disabled",
18+
"emailAccountAdmins": true,
19+
"emailAddresses": [
20+
"test@microsoft.com;user@microsoft.com"
21+
],
22+
"disabledAlerts": [
23+
"Access_Anomaly"
24+
],
25+
"retentionDays": 0,
26+
"storageEndpoint": "https://mystorage.blob.core.windows.net"
27+
}
28+
}
29+
]
30+
}
31+
}
32+
}
33+
}

specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2017-12-01-preview/mysql.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,6 +1722,48 @@
17221722
}
17231723
}
17241724
},
1725+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/securityAlertPolicies": {
1726+
"get": {
1727+
"tags": [
1728+
"ServerSecurityAlertPolicies"
1729+
],
1730+
"description": "Get the server's threat detection policies.",
1731+
"operationId": "ServerSecurityAlertPolicies_ListByServer",
1732+
"parameters": [
1733+
{
1734+
"$ref": "#/parameters/ResourceGroupParameter"
1735+
},
1736+
{
1737+
"$ref": "#/parameters/ServerNameParameter"
1738+
},
1739+
{
1740+
"$ref": "#/parameters/SubscriptionIdParameter"
1741+
},
1742+
{
1743+
"$ref": "#/parameters/ApiVersionParameter"
1744+
}
1745+
],
1746+
"responses": {
1747+
"200": {
1748+
"description": "Successfully retrieved the server threat detection policies.",
1749+
"schema": {
1750+
"$ref": "#/definitions/ServerSecurityAlertPolicyListResult"
1751+
}
1752+
},
1753+
"default": {
1754+
"description": "*** Error Responses: ***\n\n * 400 SecurityAlertPoliciesInvalidStorageAccountName - The provided storage account is not valid or does not exist.\n\n * 400 SecurityAlertPoliciesInvalidStorageAccountCredentials - The provided storage account access key is not valid.\n\n * 400 InvalidServerSecurityAlertPolicyCreateRequest - The create server Threat Detection security alert policy request does not exist or has no properties object.\n\n * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.\n\n * 400 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 400 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 409 ServerSecurityAlertPolicyInProgress - Set server security alert policy is already in progress\n\n * 409 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later.\n\n * 500 UpsertServerSecurityAlertPolicyFailed - An error has occurred while saving Threat detection settings, please try again later\n\n * 500 GetServerSecurityAlertPolicyFailed - Failed to get Threat Detection settings"
1755+
}
1756+
},
1757+
"x-ms-pageable": {
1758+
"nextLinkName": "nextLink"
1759+
},
1760+
"x-ms-examples": {
1761+
"List the server's threat detection policies": {
1762+
"$ref": "./examples/ServerSecurityAlertsListByServer.json"
1763+
}
1764+
}
1765+
}
1766+
},
17251767
"/providers/Microsoft.DBForMySQL/operations": {
17261768
"get": {
17271769
"tags": [
@@ -2886,6 +2928,25 @@
28862928
}
28872929
}
28882930
},
2931+
"ServerSecurityAlertPolicyListResult": {
2932+
"description": "A list of the server's security alert policies.",
2933+
"type": "object",
2934+
"properties": {
2935+
"value": {
2936+
"description": "Array of results.",
2937+
"type": "array",
2938+
"items": {
2939+
"$ref": "#/definitions/ServerSecurityAlertPolicy"
2940+
},
2941+
"readOnly": true
2942+
},
2943+
"nextLink": {
2944+
"description": "Link to retrieve next page of results.",
2945+
"type": "string",
2946+
"readOnly": true
2947+
}
2948+
}
2949+
},
28892950
"CloudError": {
28902951
"x-ms-external": true,
28912952
"properties": {

0 commit comments

Comments
 (0)