From 347f268c8c95f491385e19ac6fd85afe1c718ac0 Mon Sep 17 00:00:00 2001 From: Yifat Birnbaum Date: Wed, 12 May 2021 12:50:04 +0300 Subject: [PATCH] Create new version of Setting API, adding support in AlertSyncSetting --- .../examples/Settings/GetSetting_example.json | 20 ++ .../Settings/GetSettings_example.json | 41 +++ .../Settings/UpdateSetting_example.json | 26 ++ .../stable/2021-06-01/settings.json | 300 ++++++++++++++++++ .../security/resource-manager/readme.md | 2 +- 5 files changed, 388 insertions(+), 1 deletion(-) create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/GetSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/GetSettings_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/UpdateSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/settings.json diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/GetSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/GetSetting_example.json new file mode 100644 index 000000000000..7fbbed710058 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/GetSetting_example.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2021-06-01", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "settingName": "MCAS" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", + "name": "MCAS", + "kind": "DataExportSettings", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": true + } + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/GetSettings_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/GetSettings_example.json new file mode 100644 index 000000000000..f38c7c97cf2d --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/GetSettings_example.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "api-version": "2021-06-01", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", + "name": "MCAS", + "kind": "DataExportSettings", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": true + } + }, + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP", + "name": "WDATP", + "kind": "DataExportSettings", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": false + } + }, + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/Sentinel", + "name": "Sentinel", + "kind": "AlertSyncSettings", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": false + } + } + ] + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/UpdateSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/UpdateSetting_example.json new file mode 100644 index 000000000000..ece31475d6eb --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Settings/UpdateSetting_example.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2021-06-01", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "settingName": "MCAS", + "setting": { + "kind": "DataExportSettings", + "properties": { + "enabled": true + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", + "name": "MCAS", + "kind": "DataExportSettings", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": true + } + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/settings.json new file mode 100644 index 000000000000..156684886bc3 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/settings.json @@ -0,0 +1,300 @@ +{ + "swagger": "2.0", + "info": { + "title": "Security Center", + "description": "API spec for Microsoft.Security (Azure Security Center) resource provider", + "version": "2021-06-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings": { + "get": { + "x-ms-examples": { + "Get settings of subscription": { + "$ref": "./examples/Settings/GetSettings_example.json" + } + }, + "tags": [ + "Settings" + ], + "description": "Settings about different configurations in security center", + "operationId": "Settings_List", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SettingsList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}": { + "get": { + "x-ms-examples": { + "Get a setting on subscription": { + "$ref": "./examples/Settings/GetSetting_example.json" + } + }, + "tags": [ + "Settings" + ], + "description": "Settings of different configurations in security center", + "operationId": "Settings_Get", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/SettingName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Setting" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + }, + "put": { + "x-ms-examples": { + "Update a setting for subscription": { + "$ref": "./examples/Settings/UpdateSetting_example.json" + } + }, + "tags": [ + "Settings" + ], + "description": "updating settings about different configurations in security center", + "operationId": "Settings_Update", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/SettingName" + }, + { + "$ref": "#/parameters/Setting" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Setting" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } + } + }, + "definitions": { + "SettingsList": { + "type": "object", + "description": "Subscription settings list.", + "properties": { + "value": { + "type": "array", + "description": "The settings list.", + "items": { + "$ref": "#/definitions/Setting" + } + }, + "nextLink": { + "readOnly": true, + "type": "string", + "description": "The URI to fetch the next page." + } + } + }, + "DataExportSettings": { + "type": "object", + "description": "Represents a data export setting", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Data export setting data", + "$ref": "#/definitions/DataExportSettingProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Setting" + } + ], + "x-ms-discriminator-value": "DataExportSettings" + }, + "AlertSyncSettings": { + "type": "object", + "description": "Represents an alert sync setting", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Alert sync setting data", + "$ref": "#/definitions/AlertSyncSettingProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Setting" + } + ], + "x-ms-discriminator-value": "AlertSyncSettings" + }, + "Setting": { + "type": "object", + "description": "The kind of the security setting", + "properties": { + "kind": { + "type": "string", + "description": "the kind of the settings string", + "enum": [ + "DataExportSettings", + "AlertSuppressionSetting", + "AlertSyncSettings" + ], + "x-ms-enum": { + "name": "SettingKind", + "modelAsString": true, + "values": [ + { + "value": "DataExportSettings" + }, + { + "value": "AlertSuppressionSetting" + }, + { + "value": "AlertSyncSettings" + } + ] + } + } + }, + "discriminator": "kind", + "required": [ + "kind" + ], + "allOf": [ + { + "$ref": "../../../common/v1/types.json#/definitions/Resource" + } + ] + }, + "DataExportSettingProperties": { + "type": "object", + "description": "The data export setting properties", + "properties": { + "enabled": { + "type": "boolean", + "description": "Is the data export setting enabled" + } + }, + "required": [ + "enabled" + ] + }, + "AlertSyncSettingProperties": { + "type": "object", + "description": "The alert sync setting properties", + "properties": { + "enabled": { + "type": "boolean", + "description": "Is the alert sync setting enabled" + } + }, + "required": [ + "enabled" + ] + } + }, + "parameters": { + "SettingName": { + "name": "settingName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the setting", + "enum": [ + "MCAS", + "WDATP", + "Sentinel" + ], + "x-ms-parameter-location": "method" + }, + "Setting": { + "name": "setting", + "in": "body", + "required": true, + "description": "Setting object", + "schema": { + "$ref": "#/definitions/Setting" + }, + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/security/resource-manager/readme.md b/specification/security/resource-manager/readme.md index 0f5776819074..dfb12172a9fb 100644 --- a/specification/security/resource-manager/readme.md +++ b/specification/security/resource-manager/readme.md @@ -170,7 +170,6 @@ These settings apply only when `--tag=package-composite-v3` is specified on the input-file: - Microsoft.Security/stable/2017-08-01/complianceResults.json - Microsoft.Security/stable/2018-06-01/pricings.json -- Microsoft.Security/stable/2019-01-01/settings.json - Microsoft.Security/stable/2019-01-01/advancedThreatProtectionSettings.json - Microsoft.Security/stable/2019-08-01/deviceSecurityGroups.json - Microsoft.Security/stable/2019-08-01/iotSecuritySolutions.json @@ -218,6 +217,7 @@ input-file: - Microsoft.Security/preview/2020-08-06-preview/iotRecommendations.json - Microsoft.Security/preview/2020-08-06-preview/iotRecommendationTypes.json - Microsoft.Security/stable/2021-01-01/alerts.json +- Microsoft.Security/stable/2021-06-01/settings.json # Needed when there is more than one input file override-info: