From b0171817e82537a88008f685d59c0a10a691c56e Mon Sep 17 00:00:00 2001 From: shahafal Date: Mon, 6 Jun 2022 14:41:04 +0300 Subject: [PATCH 1/4] Adds base for updating Microsoft.Security from version stable/2021-07-01 to version 2022-05-01 --- .../examples/Settings/GetSetting_example.json | 20 ++ .../Settings/GetSettings_example.json | 50 +++ .../Settings/UpdateSetting_example.json | 26 ++ .../stable/2022-05-01/settings.json | 305 ++++++++++++++++++ 4 files changed, 401 insertions(+) create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json new file mode 100644 index 000000000000..1ac66c2d42d9 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2021-07-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/2022-05-01/examples/Settings/GetSettings_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json new file mode 100644 index 000000000000..220cdf57cfea --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "api-version": "2021-07-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/WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW", + "name": "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW", + "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/2022-05-01/examples/Settings/UpdateSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json new file mode 100644 index 000000000000..659eca933372 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2021-07-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/2022-05-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json new file mode 100644 index 000000000000..05dc6de07299 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json @@ -0,0 +1,305 @@ +{ + "swagger": "2.0", + "info": { + "title": "Microsoft Defender for Cloud", + "description": "API spec for Microsoft.Security (Microsoft Defender for Cloud) resource provider", + "version": "2021-07-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 Microsoft Defender for Cloud", + "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 Microsoft Defender for Cloud", + "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 Microsoft Defender for Cloud", + "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", + "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW", + "Sentinel" + ], + "x-ms-enum": { + "name": "SettingName", + "modelAsString": true + }, + "x-ms-parameter-location": "method" + }, + "Setting": { + "name": "setting", + "in": "body", + "required": true, + "description": "Setting object", + "schema": { + "$ref": "#/definitions/Setting" + }, + "x-ms-parameter-location": "method" + } + } +} From 2d4379ccc61341af8d26c6e054e5be1b825c0bb1 Mon Sep 17 00:00:00 2001 From: shahafal Date: Mon, 6 Jun 2022 14:41:07 +0300 Subject: [PATCH 2/4] Updates readme --- .../security/resource-manager/readme.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/specification/security/resource-manager/readme.md b/specification/security/resource-manager/readme.md index c226518fb3a2..a5509f28b9a4 100644 --- a/specification/security/resource-manager/readme.md +++ b/specification/security/resource-manager/readme.md @@ -66,18 +66,27 @@ These are the global settings for the Security API. title: SecurityCenter description: API spec for Microsoft.Security (Azure Security Center) resource provider openapi-type: arm -tag: package-composite-v3 +tag: package-2022-05 ``` ### Composite packages The following packages may be composed from multiple api-versions. + +### Tag: package-2022-05 + +These settings apply only when `--tag=package-2022-05` is specified on the command line. + +```yaml $(tag) == 'package-2022-05' +input-file: + - Microsoft.Security/stable/2022-05-01/settings.json +``` ### Tag: package-2021-11 These settings apply only when `--tag=package-2021-11` is specified on the command line. -```yaml $(tag) == 'package-2021-11' +``` yaml $(tag) == 'package-2021-11' input-file: - Microsoft.Security/stable/2021-11-01/alerts.json ``` @@ -86,7 +95,7 @@ input-file: These settings apply only when `--tag=package-2022-03` is specified on the command line. -```yaml $(tag) == 'package-2022-03' +``` yaml $(tag) == 'package-2022-03' input-file: - Microsoft.Security/stable/2022-03-01/pricings.json ``` @@ -95,7 +104,7 @@ input-file: These settings apply only when `--tag=package-preview-2021-12-only` is specified on the command line. -```yaml $(tag) == 'package-preview-2021-12' +``` yaml $(tag) == 'package-preview-2021-12' input-file: - Microsoft.Security/preview/2021-12-01-preview/securityConnectors.json - Microsoft.Security/preview/2015-06-01-preview/operations.json @@ -592,4 +601,4 @@ See configuration in [readme.ruby.md](./readme.ruby.md) ## Java -See configuration in [readme.java.md](./readme.java.md) \ No newline at end of file +See configuration in [readme.java.md](./readme.java.md) From c54a944e8d8ba84eaffed2840be0d490cabba0c2 Mon Sep 17 00:00:00 2001 From: shahafal Date: Mon, 6 Jun 2022 14:41:09 +0300 Subject: [PATCH 3/4] Updates API version in new specs and examples --- .../stable/2022-05-01/examples/Settings/GetSetting_example.json | 2 +- .../2022-05-01/examples/Settings/GetSettings_example.json | 2 +- .../2022-05-01/examples/Settings/UpdateSetting_example.json | 2 +- .../Microsoft.Security/stable/2022-05-01/settings.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json index 1ac66c2d42d9..8b1bf4870def 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-07-01", + "api-version": "2022-05-01", "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", "settingName": "MCAS" }, diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json index 220cdf57cfea..c1e87e6af987 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-07-01", + "api-version": "2022-05-01", "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" }, "responses": { diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json index 659eca933372..238c382d74db 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-07-01", + "api-version": "2022-05-01", "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", "settingName": "MCAS", "setting": { diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json index 05dc6de07299..430f14f379a4 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json @@ -3,7 +3,7 @@ "info": { "title": "Microsoft Defender for Cloud", "description": "API spec for Microsoft.Security (Microsoft Defender for Cloud) resource provider", - "version": "2021-07-01" + "version": "2022-05-01" }, "host": "management.azure.com", "schemes": [ From d848e852553c43fd68932c3aed6134416b2b9c59 Mon Sep 17 00:00:00 2001 From: Shahaf Alkaslassy Date: Mon, 6 Jun 2022 15:01:06 +0300 Subject: [PATCH 4/4] add Microsoft.Security Settings API version 2022-05-01 --- .../examples/Settings/GetSettings_example.json | 9 +++++++++ .../stable/2022-05-01/settings.json | 1 + .../security/resource-manager/readme.md | 18 +++++++++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json index c1e87e6af987..0acd5c2a6fa6 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json @@ -34,6 +34,15 @@ "enabled": false } }, + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP_UNIFIED_SOLUTION", + "name": "WDATP_UNIFIED_SOLUTION", + "kind": "DataExportSettings", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": false + } + }, { "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/Sentinel", "name": "Sentinel", diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json index 430f14f379a4..d3ded47b6d9e 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/settings.json @@ -283,6 +283,7 @@ "MCAS", "WDATP", "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW", + "WDATP_UNIFIED_SOLUTION", "Sentinel" ], "x-ms-enum": { diff --git a/specification/security/resource-manager/readme.md b/specification/security/resource-manager/readme.md index a5509f28b9a4..2709578ab5fe 100644 --- a/specification/security/resource-manager/readme.md +++ b/specification/security/resource-manager/readme.md @@ -66,7 +66,7 @@ These are the global settings for the Security API. title: SecurityCenter description: API spec for Microsoft.Security (Azure Security Center) resource provider openapi-type: arm -tag: package-2022-05 +tag: package-composite-v3 ``` ### Composite packages @@ -78,7 +78,7 @@ The following packages may be composed from multiple api-versions. These settings apply only when `--tag=package-2022-05` is specified on the command line. -```yaml $(tag) == 'package-2022-05' +``` yaml $(tag) == 'package-2022-05' input-file: - Microsoft.Security/stable/2022-05-01/settings.json ``` @@ -264,7 +264,7 @@ input-file: - Microsoft.Security/preview/2020-07-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations.json - Microsoft.Security/preview/2020-07-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations.json - Microsoft.Security/stable/2021-11-01/alerts.json -- Microsoft.Security/stable/2021-07-01/settings.json +- Microsoft.Security/stable/2022-05-01/settings.json - Microsoft.Security/preview/2021-01-15-preview/ingestionSettings.json - Microsoft.Security/preview/2021-05-01-preview/softwareInventories.json - Microsoft.Security/preview/2021-07-01-preview/securityConnectors.json @@ -541,6 +541,18 @@ override-info: title: SecurityCenter ``` +### Tag: package-2021-07-only + +These settings apply only when `--tag=package-2021-07-only` is specified on the command line. This tag is used for Ruby SDK. + +``` yaml $(tag) == 'package-2021-07-only' +input-file: +- Microsoft.Security/stable/2021-07-01/settings.json +# Needed when there is more than one input file +override-info: + title: SecurityCenter +``` + ### Tag: package-preview-2021-07-preview-only These settings apply only when `--tag=package-preview-2021-07-preview-only` is specified on the command line.