Skip to content

Commit

Permalink
S360: Add server security alerts list by server (#12302)
Browse files Browse the repository at this point in the history
* Add serverSecurityAlertPolicies APIs for MySQL servers

* Add ServerSecurityAlertsListByServer

* Add List operation to serverSecurityAlertPolicies of mysql

* fixes after sync with latest

* fixes

* fixes
  • Loading branch information
ayeletshpigelman authored Jan 12, 2021
1 parent 4a2a472 commit 03d81a5
Show file tree
Hide file tree
Showing 13 changed files with 565 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "securityalert-4799",
"serverName": "securityalert-6440",
"api-version": "2018-06-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMariaDB/servers/securityalert-6440/securityAlertPolicies",
"name": "Default",
"type": "Microsoft.DBforMariaDB/servers/securityAlertPolicies",
"properties": {
"state": "Disabled",
"emailAccountAdmins": true,
"emailAddresses": [
"test@microsoft.com;user@microsoft.com"
],
"disabledAlerts": [
"Access_Anomaly"
],
"retentionDays": 0,
"storageEndpoint": "https://mystorage.blob.core.windows.net"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,48 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies": {
"get": {
"tags": [
"ServerSecurityAlertPolicies"
],
"description": "Get the server's threat detection policies.",
"operationId": "ServerSecurityAlertPolicies_ListByServer",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the server threat detection policies.",
"schema": {
"$ref": "#/definitions/ServerSecurityAlertPolicyListResult"
}
},
"default": {
"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"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"List the server's threat detection policies": {
"$ref": "./examples/ServerSecurityAlertsListByServer.json"
}
}
}
},
"/providers/Microsoft.DBForMariaDB/operations": {
"get": {
"tags": [
Expand Down Expand Up @@ -2421,6 +2463,25 @@
},
"description": "An error response from the Batch service."
},
"ServerSecurityAlertPolicyListResult": {
"description": "A list of the server's security alert policies.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/ServerSecurityAlertPolicy"
},
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"type": "string",
"readOnly": true
}
}
},
"CloudErrorBody": {
"x-ms-external": true,
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,48 @@
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies": {
"get": {
"tags": [
"ServerSecurityAlertPolicies"
],
"description": "Get the server's threat detection policies.",
"operationId": "ServerSecurityAlertPolicies_ListByServer",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the server threat detection policies.",
"schema": {
"$ref": "#/definitions/ServerSecurityAlertPolicyListResult"
}
},
"default": {
"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"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"List the server's threat detection policies": {
"$ref": "./examples/ServerSecurityAlertsListByServer.json"
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -205,6 +247,25 @@
"x-ms-client-flatten": true
}
}
},
"ServerSecurityAlertPolicyListResult": {
"description": "A list of the server's security alert policies.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/ServerSecurityAlertPolicy"
},
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"type": "string",
"readOnly": true
}
}
}
},
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "securityalert-4799",
"serverName": "securityalert-6440",
"api-version": "2018-06-01"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMariaDB/servers/securityalert-6440/securityAlertPolicies",
"name": "Default",
"type": "Microsoft.DBforMariaDB/servers/securityAlertPolicies",
"properties": {
"state": "Disabled",
"emailAccountAdmins": true,
"emailAddresses": [
"test@microsoft.com;user@microsoft.com"
],
"disabledAlerts": [
"Access_Anomaly"
],
"retentionDays": 0,
"storageEndpoint": "https://mystorage.blob.core.windows.net"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "securityalert-4799",
"serverName": "securityalert-6440",
"api-version": "2017-12-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies",
"name": "Default",
"type": "Microsoft.DBforMySQL/servers/securityAlertPolicies",
"properties": {
"state": "Disabled",
"emailAccountAdmins": true,
"emailAddresses": [
"test@microsoft.com;user@microsoft.com"
],
"disabledAlerts": [
"Access_Anomaly"
],
"retentionDays": 0,
"storageEndpoint": "https://mystorage.blob.core.windows.net"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,48 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/securityAlertPolicies": {
"get": {
"tags": [
"ServerSecurityAlertPolicies"
],
"description": "Get the server's threat detection policies.",
"operationId": "ServerSecurityAlertPolicies_ListByServer",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the server threat detection policies.",
"schema": {
"$ref": "#/definitions/ServerSecurityAlertPolicyListResult"
}
},
"default": {
"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"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"List the server's threat detection policies": {
"$ref": "./examples/ServerSecurityAlertsListByServer.json"
}
}
}
},
"/providers/Microsoft.DBForMySQL/operations": {
"get": {
"tags": [
Expand Down Expand Up @@ -2886,6 +2928,25 @@
}
}
},
"ServerSecurityAlertPolicyListResult": {
"description": "A list of the server's security alert policies.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/ServerSecurityAlertPolicy"
},
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"type": "string",
"readOnly": true
}
}
},
"CloudError": {
"x-ms-external": true,
"properties": {
Expand Down
Loading

0 comments on commit 03d81a5

Please sign in to comment.