From b01fe0a89507c7ecfa288908c42a19951feb8c5f Mon Sep 17 00:00:00 2001 From: kunchawla <74390470+kunchawla@users.noreply.github.com> Date: Mon, 17 May 2021 21:37:29 -0700 Subject: [PATCH] New Microsoft.Security proxy rp type of ingestionSettings (#14226) * New Microsoft.Security proxy rp type of ingestionSettings * PR feedback * Feedback * Fix check error * PR Feedback for list tokens * Fix example description * Remove suppressions from readme.md Co-authored-by: Kunal Chawla --- .../CreateIngestionSetting_example.json | 17 + .../DeleteIngestionSetting_example.json | 11 + .../GetIngestionSetting_example.json | 16 + .../GetIngestionSettings_example.json | 24 ++ .../ListConnectionStrings_example.json | 23 ++ .../ListTokensIngestionSetting_example.json | 14 + .../2021-01-15-preview/ingestionSettings.json | 375 ++++++++++++++++++ .../security/resource-manager/readme.md | 23 ++ 8 files changed, 503 insertions(+) create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/ingestionSettings.json diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json new file mode 100644 index 000000000000..37a9405975b2 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2021-01-15-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ingestionSettingName": "default", + "ingestionSetting": {} + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default", + "name": "default", + "type": "Microsoft.Security/ingestionSettings" + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json new file mode 100644 index 000000000000..476c7350eef0 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-01-15-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ingestionSettingName": "default" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json new file mode 100644 index 000000000000..0796b0e912f7 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "api-version": "2021-01-15-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ingestionSettingName": "default" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default", + "name": "default", + "type": "Microsoft.Security/ingestionSettings" + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json new file mode 100644 index 000000000000..d84ed1d45653 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2021-01-15-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default", + "name": "default", + "type": "Microsoft.Security/ingestionSettings" + }, + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default2", + "name": "default2", + "type": "Microsoft.Security/ingestionSettings" + } + ] + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json new file mode 100644 index 000000000000..faedb75b6012 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "api-version": "2021-01-15-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ingestionSettingName": "default" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "location": "CUS", + "value": "InstrumentationKey=7f0bf72c-835a-48d2-b71116dcdc23;IngestionEndpoint=https://centralus2-1.in.applicationinsights.azure.com/" + }, + { + "location": "WEU", + "value": "InstrumentationKey=8f0bf72c-835a-48d2-b71116dcdc23;IngestionEndpoint=https://westeu-1.in.applicationinsights.azure.com/" + } + ] + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json new file mode 100644 index 000000000000..c94a4467d6fa --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2021-01-15-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ingestionSettingName": "default" + }, + "responses": { + "200": { + "body": { + "token": "20ff7fc3-e762-44dd-bd96-b71116dcdc23.c54d4cde-1e22-467c-a70a-3f3876bc1ca8" + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/ingestionSettings.json b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/ingestionSettings.json new file mode 100644 index 000000000000..593b245f7cd6 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/ingestionSettings.json @@ -0,0 +1,375 @@ +{ + "swagger": "2.0", + "info": { + "title": "Security Center", + "description": "API spec for Microsoft.Security (Azure Security Center) resource provider", + "version": "2021-01-15-preview" + }, + "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/ingestionSettings": { + "get": { + "x-ms-examples": { + "Get ingestion settings on subscription": { + "$ref": "./examples/IngestionSettings/GetIngestionSettings_example.json" + } + }, + "tags": [ + "Ingestion Settings" + ], + "description": "Settings for ingesting security data and logs to correlate with resources associated with the subscription.", + "operationId": "IngestionSettings_List", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/IngestionSettingList" + } + }, + "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/ingestionSettings/{ingestionSettingName}": { + "get": { + "x-ms-examples": { + "Get a ingestion setting on subscription": { + "$ref": "./examples/IngestionSettings/GetIngestionSetting_example.json" + } + }, + "tags": [ + "Ingestion Settings" + ], + "description": "Settings for ingesting security data and logs to correlate with resources associated with the subscription.", + "operationId": "IngestionSettings_Get", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/IngestionSettingName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/IngestionSetting" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + }, + "put": { + "x-ms-examples": { + "Create an ingestion setting for subscription": { + "$ref": "./examples/IngestionSettings/CreateIngestionSetting_example.json" + } + }, + "tags": [ + "Ingestion Settings" + ], + "description": "Create setting for ingesting security data and logs to correlate with resources associated with the subscription.", + "operationId": "IngestionSettings_Create", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/IngestionSettingName" + }, + { + "$ref": "#/parameters/IngestionSetting" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/IngestionSetting" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + }, + "delete": { + "x-ms-examples": { + "Delete an ingestion setting for the subscription": { + "$ref": "./examples/IngestionSettings/DeleteIngestionSetting_example.json" + } + }, + "tags": [ + "Ingestion Settings" + ], + "description": "Deletes the ingestion settings for this subscription.", + "operationId": "IngestionSettings_Delete", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/IngestionSettingName" + } + ], + "responses": { + "200": { + "description": "The resource was deleted successfully" + }, + "204": { + "description": "The resource was not found" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens": { + "post": { + "x-ms-examples": { + "List ingestion setting tokens": { + "$ref": "./examples/IngestionSettings/ListTokensIngestionSetting_example.json" + } + }, + "tags": [ + "Ingestion Settings" + ], + "description": "Returns the token that is used for correlating ingested telemetry with the resources in the subscription.", + "operationId": "IngestionSettings_ListTokens", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/IngestionSettingName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/IngestionSettingToken" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings": { + "post": { + "x-ms-examples": { + "List connection strings for ingesting security data and logs": { + "$ref": "./examples/IngestionSettings/ListConnectionStrings_example.json" + } + }, + "tags": [ + "Connection Strings" + ], + "description": "Connection strings for ingesting security scan logs and data.", + "operationId": "IngestionSettings_ListConnectionStrings", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/IngestionSettingName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ConnectionStrings" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } + } + }, + "definitions": { + "IngestionSettingList": { + "description": "List of ingestion settings", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "description": "List of ingestion settings", + "items": { + "$ref": "#/definitions/IngestionSetting" + } + }, + "nextLink": { + "readOnly": true, + "type": "string", + "description": "The URI to fetch the next page." + } + } + }, + "IngestionSetting": { + "type": "object", + "description": "Configures how to correlate scan data and logs with resources associated with the subscription.", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Ingestion setting data", + "$ref": "#/definitions/IngestionSettingProperties" + } + }, + "allOf": [ + { + "$ref": "../../../common/v1/types.json#/definitions/Resource" + } + ] + }, + "IngestionSettingToken": { + "type": "object", + "description": "Configures how to correlate scan data and logs with resources associated with the subscription.", + "properties": { + "token": { + "type": "string", + "x-ms-secret": true, + "readOnly": true, + "description": "The token is used for correlating security data and logs with the resources in the subscription." + } + } + }, + "IngestionSettingProperties": { + "type": "object", + "description": "Ingestion setting data" + }, + "IngestionConnectionString": { + "type": "object", + "description": "Connection string for ingesting security data and logs", + "properties": { + "location": { + "type": "string", + "readOnly": true, + "description": "The region where ingested logs and data resides" + }, + "value": { + "type": "string", + "readOnly": true, + "x-ms-secret": true, + "description": "Connection string value" + } + } + }, + "ConnectionStrings": { + "description": "Connection string for ingesting security data and logs", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "description": "Connection strings", + "items": { + "$ref": "#/definitions/IngestionConnectionString" + } + } + } + } + }, + "parameters": { + "IngestionSettingName": { + "name": "ingestionSettingName", + "in": "path", + "required": true, + "type": "string", + "description": "Name of the ingestion setting", + "x-ms-parameter-location": "method" + }, + "IngestionSetting": { + "name": "ingestionSetting", + "in": "body", + "required": true, + "description": "Ingestion setting object", + "schema": { + "$ref": "#/definitions/IngestionSetting" + }, + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/security/resource-manager/readme.md b/specification/security/resource-manager/readme.md index 0f5776819074..c33b0b69ec7d 100644 --- a/specification/security/resource-manager/readme.md +++ b/specification/security/resource-manager/readme.md @@ -60,6 +60,14 @@ directive: from: onPremiseIotSensors.json where: $.definitions.OnPremiseIotSensor reason: The resource is managed in a subscription level (instead of inside a resource group) + - suppress: SECRET_PROPERTY + from: ingestionSettings.json + where: $.definitions.IngestionSettingToken.properties.token + reason: Secrets are OK to return in a POST response. + - suppress: SECRET_PROPERTY + from: ingestionSettings.json + where: $.definitions.IngestionConnectionString.properties.value + reason: Secrets are OK to return in a POST response. ``` ### Basic Information @@ -113,6 +121,7 @@ input-file: - Microsoft.Security/preview/2015-06-01-preview/allowedConnections.json - Microsoft.Security/preview/2015-06-01-preview/adaptiveNetworkHardenings.json - Microsoft.Security/preview/2019-01-01-preview/alertsSuppressionRules.json +- Microsoft.Security/preview/2021-01-15-preview/ingestionSettings.json # Needed when there is more than one input file override-info: @@ -156,6 +165,7 @@ input-file: - Microsoft.Security/preview/2015-06-01-preview/allowedConnections.json - Microsoft.Security/preview/2015-06-01-preview/adaptiveNetworkHardenings.json - Microsoft.Security/preview/2019-01-01-preview/alertsSuppressionRules.json +- Microsoft.Security/preview/2021-01-15-preview/ingestionSettings.json # Needed when there is more than one input file override-info: @@ -218,6 +228,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/preview/2021-01-15-preview/ingestionSettings.json # Needed when there is more than one input file override-info: @@ -433,6 +444,18 @@ override-info: title: SecurityCenter ``` +### Tag: package-2021-01-preview-only + +These settings apply only when `--tag=package-2021-01-preview-only` is specified on the command line. This tag is used for Ruby SDK. + +``` yaml $(tag) == 'package-2021-01-preview-only' +input-file: +- Microsoft.Security/preview/2021-01-15-preview/ingestionSettings.json +# Needed when there is more than one input file +override-info: + title: SecurityCenter +``` + --- # Code Generation