From 7d4b12082dad92e53be927e0186300c5d6cfad1e Mon Sep 17 00:00:00 2001 From: tarosler <52041458+tarosler@users.noreply.github.com> Date: Thu, 20 Jun 2019 17:24:42 +0300 Subject: [PATCH 01/14] create assessmentMetadata.json --- .../assessmentsMetadata.json | 227 ++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json new file mode 100644 index 000000000000..0228d859e5db --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -0,0 +1,227 @@ +{ + "swagger": "2.0", + "info": { + "title": "Security Center", + "description": "API spec for Microsoft.Security (Azure Security Center) resource provider", + "version": "2019-01-01-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": { + "/providers/Microsoft.Security/assessmentsMetadata": { + "get": { + "x-ms-examples": { + "List security assessments": { + "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json" + } + }, + "tags": ["Assessments Metadata"], + "description": "Get metadata information on all assessment types", + "operationId": "AssessmentsMetadata_List", + "parameters": [{ + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SecurityAssessmentMetadataList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}": { + "get": { + "x-ms-examples": { + "Get security recommendation task from security data location": { + "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json" + } + }, + "tags": ["Assessments Metadata"], + "description": "Get metadata information on an assessment type", + "operationId": "AssessmentsMetadata_Get", + "parameters": [{ + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/AssessmentsMetadataName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SecurityAssessmentMetadata" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } + } + }, + "definitions": { + "SecurityAssessmentMetadataList": { + "type": "object", + "description": "List of security assessment metadata", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/SecurityAssessmentMetadata" + } + }, + "nextLink": { + "readOnly": true, + "type": "string", + "description": "The URI to fetch the next page." + } + } + }, + "SecurityAssessmentMetadata": { + "type": "object", + "description": "Security assessment metadata", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/SecurityAssessmentMetadataProperties" + } + }, + "allOf": [{ + "$ref": "../../../common/v1/types.json#/definitions/Resource" + }] + }, + "SecurityAssessmentMetadataProperties": { + "type": "object", + "description": "Describes properties of an assessment metadata.", + "properties": { + "displayName": { + "readOnly": true, + "type": "string", + "description": "User friendly display name of the assessment" + }, + "policyDefinitionId": { + "readOnly": true, + "type": "string", + "description": "Azure resource ID of the policy definition that turns this assessment calculation on" + }, + "description": { + "readOnly": true, + "type": "string", + "description": "Human readable description of the assessment" + }, + "remediationDescription": { + "readOnly": true, + "type": "string", + "description": "Human readable description of what you should do to mitigate this security issue" + }, + "category": { + "readOnly": true, + "type": "array", + "items": { + "type": "string", + "description": "The category of resource that is at risk when the assessment is unhealthy", + "enum": ["Compute", "Network", "Data", "IdentityAndAccess", "IoT"], + "x-ms-enum": { + "name": "category", + "modelAsString": true, + "values": [{ + "value": "Compute" + }, + { + "value": "Network" + }, + { + "value": "Data" + }, + { + "value": "IdentityAndAccess" + }, + { + "value": "IoT" + } + ] + } + } + }, + "secureScoreWeight": { + "readOnly": true, + "type": "integer", + "description": "Weight for the security score calculation. the higher this number, this severity of this assessment is higher" + }, + "requiredPricingBundle": { + "readOnly": true, + "type": "array", + "items": { + "type": "string", + "description": "The required Azure Security Center pricing bundle name. One of the bundles must be Standard. Empty list is a free assessment.", + "enum": ["VirtualMachines", "SqlServers", "AppServices", "StorageAccounts"], + "x-ms-enum": { + "name": "requiredPricingBundle", + "modelAsString": true, + "values": [{ + "value": "VirtualMachines" + }, + { + "value": "SqlServers" + }, + { + "value": "AppServices" + }, + { + "value": "StorageAccounts" + } + ] + } + } + }, + "preview": { + "readOnly": true, + "type": "boolean", + "description": "True if this assessment is in preview release status" + } + } + } + }, + "parameters": { + "AssessmentsMetadataName": { + "name": "assessmentsMetadataName", + "in": "path", + "required": true, + "type": "string", + "description": "The Assessment Key - Unique key for the assessment type", + "x-ms-parameter-location": "method" + } + } +} From 59d31c793148e793e9e204c08d732e39dc70a31b Mon Sep 17 00:00:00 2001 From: tarosler <52041458+tarosler@users.noreply.github.com> Date: Mon, 24 Jun 2019 11:48:31 +0300 Subject: [PATCH 02/14] update --- .../assessmentsMetadata.json | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index 0228d859e5db..5f9e6136e3e0 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -88,6 +88,71 @@ } } } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata": { + "get": { + "x-ms-examples": { + "List security assessments": { + "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json" + } + }, + "tags": ["Assessments Metadata"], + "description": "Get metadata information on all assessment types", + "operationId": "AssessmentsMetadata_List", + "parameters": [{ + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SecurityAssessmentMetadataList" + } + }, + "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/assessmentsMetadata/{assessmentsMetadataName}": { + "get": { + "x-ms-examples": { + "Get security recommendation task from security data location": { + "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json" + } + }, + "tags": ["Assessments Metadata"], + "description": "Get metadata information on an assessment type", + "operationId": "AssessmentsMetadata_Get", + "parameters": [{ + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/AssessmentsMetadataName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SecurityAssessmentMetadata" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } } }, "definitions": { @@ -210,6 +275,11 @@ "readOnly": true, "type": "boolean", "description": "True if this assessment is in preview release status" + }, + "BuiltIn": { + "readOnly": true, + "type": "boolean", + "description": "True if this assessment is an built in Azure Security Center assessment" } } } From 069fa751a8cd4b2d0da354eded74cb32258e06d5 Mon Sep 17 00:00:00 2001 From: tarosler <52041458+tarosler@users.noreply.github.com> Date: Mon, 24 Jun 2019 11:51:02 +0300 Subject: [PATCH 03/14] update --- .../preview/2019-01-01-preview/assessmentsMetadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index 5f9e6136e3e0..8ae33f1774f3 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -97,7 +97,7 @@ } }, "tags": ["Assessments Metadata"], - "description": "Get metadata information on all assessment types", + "description": "Get metadata information on all assessment types in a specific subscription", "operationId": "AssessmentsMetadata_List", "parameters": [{ "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -129,7 +129,7 @@ } }, "tags": ["Assessments Metadata"], - "description": "Get metadata information on an assessment type", + "description": "Get metadata information on an assessment type in a specific subscription", "operationId": "AssessmentsMetadata_Get", "parameters": [{ "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" From c1cc69905c2d3f46d9752d3c1cd336eb9f28a767 Mon Sep 17 00:00:00 2001 From: tarosler <52041458+tarosler@users.noreply.github.com> Date: Mon, 24 Jun 2019 13:36:06 +0300 Subject: [PATCH 04/14] update --- .../assessmentsMetadata.json | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index 8ae33f1774f3..6eea771b0e9e 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -92,16 +92,21 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata": { "get": { "x-ms-examples": { - "List security assessments": { + "List security assessment metadata for subscription": { "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json" } }, "tags": ["Assessments Metadata"], "description": "Get metadata information on all assessment types in a specific subscription", - "operationId": "AssessmentsMetadata_List", - "parameters": [{ + "operationId": "AssessmentsMetadata_Subscription_List", + "parameters": [ + { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" - }], + }, + { + "$ref": "#/parameters/SubscriptionId" + } + ], "responses": { "200": { "description": "OK", @@ -124,18 +129,21 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}": { "get": { "x-ms-examples": { - "Get security recommendation task from security data location": { + "Get security assessment metadata for subscription": { "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json" } }, "tags": ["Assessments Metadata"], "description": "Get metadata information on an assessment type in a specific subscription", - "operationId": "AssessmentsMetadata_Get", + "operationId": "AssessmentsMetadata_Subscription_Get", "parameters": [{ "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" }, { "$ref": "#/parameters/AssessmentsMetadataName" + }, + { + "$ref": "#/parameters/SubscriptionId" } ], "responses": { @@ -292,6 +300,14 @@ "type": "string", "description": "The Assessment Key - Unique key for the assessment type", "x-ms-parameter-location": "method" + }, + "SubscriptionId": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Azure subscription ID. Regex pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$", + "x-ms-parameter-location": "method" } } } From cba198c09518a5851055932647818addcddb1b93 Mon Sep 17 00:00:00 2001 From: tarosler <52041458+tarosler@users.noreply.github.com> Date: Mon, 24 Jun 2019 13:38:32 +0300 Subject: [PATCH 05/14] update --- .../preview/2019-01-01-preview/assessmentsMetadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index 6eea771b0e9e..199aea47e09e 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -27,7 +27,7 @@ "/providers/Microsoft.Security/assessmentsMetadata": { "get": { "x-ms-examples": { - "List security assessments": { + "List security assessment metadata": { "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json" } }, @@ -59,7 +59,7 @@ "/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}": { "get": { "x-ms-examples": { - "Get security recommendation task from security data location": { + "Get security assessment metadata": { "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json" } }, From bb13beb9f0775ae2c4f43b3261b7314750d97ba7 Mon Sep 17 00:00:00 2001 From: tarosler <52041458+tarosler@users.noreply.github.com> Date: Tue, 25 Jun 2019 18:57:32 +0300 Subject: [PATCH 06/14] update --- .../assessmentsMetadata.json | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index 199aea47e09e..f35bf14536c0 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -284,10 +284,22 @@ "type": "boolean", "description": "True if this assessment is in preview release status" }, - "BuiltIn": { + "assessmentType": { "readOnly": true, - "type": "boolean", - "description": "True if this assessment is an built in Azure Security Center assessment" + "type": "string", + "description": "BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition" + "enum": ["BuiltIn", "Custom"], + "x-ms-enum": { + "name": "assessmentType", + "modelAsString": true, + "values": [{ + "value": "BuiltIn" + }, + { + "value": "Custom" + } + ] + } } } } From ce7047a9a3448543f59faee784aca27ce6f2874a Mon Sep 17 00:00:00 2001 From: tarosler <52041458+tarosler@users.noreply.github.com> Date: Tue, 25 Jun 2019 19:00:27 +0300 Subject: [PATCH 07/14] fix --- .../preview/2019-01-01-preview/assessmentsMetadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index f35bf14536c0..58c8d5a6b789 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -287,7 +287,7 @@ "assessmentType": { "readOnly": true, "type": "string", - "description": "BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition" + "description": "BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition", "enum": ["BuiltIn", "Custom"], "x-ms-enum": { "name": "assessmentType", From 94e9adc82e6261ee38815f29369715612a8d2767 Mon Sep 17 00:00:00 2001 From: Tal Rosler Date: Tue, 25 Jun 2019 19:13:38 +0300 Subject: [PATCH 08/14] Add examples --- .../GetAssessmentsMetadata_example.json | 24 ++++++++++ .../ListAssessmentsMetadata_example.json | 44 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json new file mode 100644 index 000000000000..864d7f9ed3b5 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2019-01-01-preview", + "assessmentsMetadataName": "21300918-b2e3-0346-785f-c77ff57d243b" + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b", + "name": "21300918-b2e3-0346-785f-c77ff57d243b", + "type": "Microsoft.Security/assessmentMetadata", + "properties": { + "displayName": "Install endpoint protection solution on virtual machine scale sets", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de", + "description": "Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities.", + "remediationDescription": "To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set", + "category": [ "Compute" ], + "secureScoreWeight": 15, + "assessmentType": "Custom" + } + } + } + } +} \ No newline at end of file diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json new file mode 100644 index 000000000000..a029973a42c4 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2019-01-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b", + "name": "21300918-b2e3-0346-785f-c77ff57d243b", + "type": "Microsoft.Security/assessmentMetadata", + "properties": { + "displayName": "Install endpoint protection solution on virtual machine scale sets", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de", + "description": "Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities.", + "remediationDescription": "To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set", + "category": [ "Compute" ], + "requiredPricingBundle": [ "VirtualMachines" ], + "secureScoreWeight": 15, + "assessmentType": "BuiltIn" + } + }, + { + "id": "/providers/Microsoft.Security/assessmentMetadata/bc303248-3d14-44c2-96a0-55f5c326b5fe", + "name": "bc303248-3d14-44c2-96a0-55f5c326b5fe", + "type": "Microsoft.Security/assessmentMetadata", + "properties": { + "displayName": "Close management ports on your virtual machines", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/22730e10-96f6-4aac-ad84-9383d35b5917", + "description": "Open remote management ports expose your VM to a high level of risk from internet-based attacks that attempt to brute force credentials to gain admin access to the machine.", + "remediationDescription": "We recommend that you edit the inbound rules of the below virtual machines to restrict access to specific source ranges.
To restrict the access to your virtual machines: 1. Click on a VM from the list below 2. At the 'Networking' blade, click on each of the rules that allow management ports (e.g. RDP-3389, WINRM-5985, SSH-22) 3. Change the 'Action' property to 'Deny' 4. Click 'Save'", + "category": [ "Networking" ], + "requiredPricingBundle": [ "VirtualMachines" ], + "secureScoreWeight": 10, + "preview": true, + "assessmentType": "Custom" + } + } + ] + } + } + } +} \ No newline at end of file From 1083840be9b633292066549bfc575e3374065089 Mon Sep 17 00:00:00 2001 From: Tal Rosler Date: Thu, 27 Jun 2019 14:30:07 +0300 Subject: [PATCH 09/14] fix CR comments --- .../assessmentsMetadata.json | 105 ++++++++++++------ 1 file changed, 73 insertions(+), 32 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index 58c8d5a6b789..81d674d0b284 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -6,12 +6,22 @@ "version": "2019-01-01-preview" }, "host": "management.azure.com", - "schemes": ["https"], - "consumes": ["application/json"], - "produces": ["application/json"], - "security": [{ - "azure_auth": ["user_impersonation"] - }], + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], "securityDefinitions": { "azure_auth": { "type": "oauth2", @@ -31,12 +41,16 @@ "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json" } }, - "tags": ["Assessments Metadata"], + "tags": [ + "Assessments Metadata" + ], "description": "Get metadata information on all assessment types", "operationId": "AssessmentsMetadata_List", - "parameters": [{ - "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" - }], + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + } + ], "responses": { "200": { "description": "OK", @@ -63,10 +77,13 @@ "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json" } }, - "tags": ["Assessments Metadata"], + "tags": [ + "Assessments Metadata" + ], "description": "Get metadata information on an assessment type", "operationId": "AssessmentsMetadata_Get", - "parameters": [{ + "parameters": [ + { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" }, { @@ -89,23 +106,25 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata": { "get": { "x-ms-examples": { "List security assessment metadata for subscription": { "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json" } }, - "tags": ["Assessments Metadata"], + "tags": [ + "Assessments Metadata" + ], "description": "Get metadata information on all assessment types in a specific subscription", "operationId": "AssessmentsMetadata_Subscription_List", "parameters": [ { - "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" - }, - { - "$ref": "#/parameters/SubscriptionId" - } + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/SubscriptionId" + } ], "responses": { "200": { @@ -133,10 +152,13 @@ "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json" } }, - "tags": ["Assessments Metadata"], + "tags": [ + "Assessments Metadata" + ], "description": "Get metadata information on an assessment type in a specific subscription", "operationId": "AssessmentsMetadata_Subscription_Get", - "parameters": [{ + "parameters": [ + { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" }, { @@ -191,9 +213,11 @@ "$ref": "#/definitions/SecurityAssessmentMetadataProperties" } }, - "allOf": [{ - "$ref": "../../../common/v1/types.json#/definitions/Resource" - }] + "allOf": [ + { + "$ref": "../../../common/v1/types.json#/definitions/Resource" + } + ] }, "SecurityAssessmentMetadataProperties": { "type": "object", @@ -225,11 +249,18 @@ "items": { "type": "string", "description": "The category of resource that is at risk when the assessment is unhealthy", - "enum": ["Compute", "Network", "Data", "IdentityAndAccess", "IoT"], + "enum": [ + "Compute", + "Network", + "Data", + "IdentityAndAccess", + "IoT" + ], "x-ms-enum": { "name": "category", "modelAsString": true, - "values": [{ + "values": [ + { "value": "Compute" }, { @@ -259,11 +290,17 @@ "items": { "type": "string", "description": "The required Azure Security Center pricing bundle name. One of the bundles must be Standard. Empty list is a free assessment.", - "enum": ["VirtualMachines", "SqlServers", "AppServices", "StorageAccounts"], + "enum": [ + "VirtualMachines", + "SqlServers", + "AppServices", + "StorageAccounts" + ], "x-ms-enum": { "name": "requiredPricingBundle", "modelAsString": true, - "values": [{ + "values": [ + { "value": "VirtualMachines" }, { @@ -284,15 +321,19 @@ "type": "boolean", "description": "True if this assessment is in preview release status" }, - "assessmentType": { + "assessmentType": { "readOnly": true, "type": "string", "description": "BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition", - "enum": ["BuiltIn", "Custom"], + "enum": [ + "BuiltIn", + "Custom" + ], "x-ms-enum": { "name": "assessmentType", "modelAsString": true, - "values": [{ + "values": [ + { "value": "BuiltIn" }, { @@ -322,4 +363,4 @@ "x-ms-parameter-location": "method" } } -} +} \ No newline at end of file From 439b920cf86a2edb6cd80fa6fa89da0acfc65006 Mon Sep 17 00:00:00 2001 From: Tal Rosler Date: Sun, 30 Jun 2019 13:37:01 +0300 Subject: [PATCH 10/14] build fixes --- .../assessmentsMetadata.json | 4 +- .../GetAssessmentsMetadata_example.json | 6 ++- ...essmentsMetadata_subscription_example.json | 27 ++++++++++ .../ListAssessmentsMetadata_example.json | 20 ++++--- ...essmentsMetadata_subscription_example.json | 53 +++++++++++++++++++ 5 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index 81d674d0b284..0448a73bbd34 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -110,7 +110,7 @@ "get": { "x-ms-examples": { "List security assessment metadata for subscription": { - "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json" + "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json" } }, "tags": [ @@ -149,7 +149,7 @@ "get": { "x-ms-examples": { "Get security assessment metadata for subscription": { - "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json" + "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json" } }, "tags": [ diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json index 864d7f9ed3b5..f3d3156b17a0 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json @@ -14,9 +14,11 @@ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de", "description": "Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities.", "remediationDescription": "To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set", - "category": [ "Compute" ], + "category": [ + "Compute" + ], "secureScoreWeight": 15, - "assessmentType": "Custom" + "assessmentType": "Custom" } } } diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json new file mode 100644 index 000000000000..613069051527 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2019-01-01-preview", + "subcriptionId": "0980887d-03d6-408c-9566-532f3456804e", + "assessmentsMetadataName": "21300918-b2e3-0346-785f-c77ff57d243b" + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b", + "name": "21300918-b2e3-0346-785f-c77ff57d243b", + "type": "Microsoft.Security/assessmentMetadata", + "properties": { + "displayName": "Install endpoint protection solution on virtual machine scale sets", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de", + "description": "Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities.", + "remediationDescription": "To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set", + "category": [ + "Compute" + ], + "secureScoreWeight": 15, + "assessmentType": "Custom" + } + } + } + } +} \ No newline at end of file diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json index a029973a42c4..4f4581798203 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json @@ -15,10 +15,14 @@ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de", "description": "Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities.", "remediationDescription": "To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set", - "category": [ "Compute" ], - "requiredPricingBundle": [ "VirtualMachines" ], + "category": [ + "Compute" + ], + "requiredPricingBundle": [ + "VirtualMachines" + ], "secureScoreWeight": 15, - "assessmentType": "BuiltIn" + "assessmentType": "BuiltIn" } }, { @@ -30,11 +34,15 @@ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/22730e10-96f6-4aac-ad84-9383d35b5917", "description": "Open remote management ports expose your VM to a high level of risk from internet-based attacks that attempt to brute force credentials to gain admin access to the machine.", "remediationDescription": "We recommend that you edit the inbound rules of the below virtual machines to restrict access to specific source ranges.
To restrict the access to your virtual machines: 1. Click on a VM from the list below 2. At the 'Networking' blade, click on each of the rules that allow management ports (e.g. RDP-3389, WINRM-5985, SSH-22) 3. Change the 'Action' property to 'Deny' 4. Click 'Save'", - "category": [ "Networking" ], - "requiredPricingBundle": [ "VirtualMachines" ], + "category": [ + "Networking" + ], + "requiredPricingBundle": [ + "VirtualMachines" + ], "secureScoreWeight": 10, "preview": true, - "assessmentType": "Custom" + "assessmentType": "Custom" } } ] diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json new file mode 100644 index 000000000000..a31cfebb0cb5 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "api-version": "2019-01-01-preview", + "subcriptionId": "0980887d-03d6-408c-9566-532f3456804e" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b", + "name": "21300918-b2e3-0346-785f-c77ff57d243b", + "type": "Microsoft.Security/assessmentMetadata", + "properties": { + "displayName": "Install endpoint protection solution on virtual machine scale sets", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de", + "description": "Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities.", + "remediationDescription": "To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set", + "category": [ + "Compute" + ], + "requiredPricingBundle": [ + "VirtualMachines" + ], + "secureScoreWeight": 15, + "assessmentType": "BuiltIn" + } + }, + { + "id": "/providers/Microsoft.Security/assessmentMetadata/bc303248-3d14-44c2-96a0-55f5c326b5fe", + "name": "bc303248-3d14-44c2-96a0-55f5c326b5fe", + "type": "Microsoft.Security/assessmentMetadata", + "properties": { + "displayName": "Close management ports on your virtual machines", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/22730e10-96f6-4aac-ad84-9383d35b5917", + "description": "Open remote management ports expose your VM to a high level of risk from internet-based attacks that attempt to brute force credentials to gain admin access to the machine.", + "remediationDescription": "We recommend that you edit the inbound rules of the below virtual machines to restrict access to specific source ranges.
To restrict the access to your virtual machines: 1. Click on a VM from the list below 2. At the 'Networking' blade, click on each of the rules that allow management ports (e.g. RDP-3389, WINRM-5985, SSH-22) 3. Change the 'Action' property to 'Deny' 4. Click 'Save'", + "category": [ + "Networking" + ], + "requiredPricingBundle": [ + "VirtualMachines" + ], + "secureScoreWeight": 10, + "preview": true, + "assessmentType": "Custom" + } + } + ] + } + } + } +} \ No newline at end of file From 566c1c154410ae5cdc25246902bfc024d60937fd Mon Sep 17 00:00:00 2001 From: Tal Rosler Date: Sun, 30 Jun 2019 13:41:01 +0300 Subject: [PATCH 11/14] fix build --- .../GetAssessmentsMetadata_subscription_example.json | 2 +- .../ListAssessmentsMetadata_subscription_example.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json index 613069051527..e7e6e70b96d9 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2019-01-01-preview", - "subcriptionId": "0980887d-03d6-408c-9566-532f3456804e", + "subscriptionId": "0980887d-03d6-408c-9566-532f3456804e", "assessmentsMetadataName": "21300918-b2e3-0346-785f-c77ff57d243b" }, "responses": { diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json index a31cfebb0cb5..46f77128133c 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2019-01-01-preview", - "subcriptionId": "0980887d-03d6-408c-9566-532f3456804e" + "subscriptionId": "0980887d-03d6-408c-9566-532f3456804e" }, "responses": { "200": { From 97b1d9b497b8f909936cc4267bac779607590215 Mon Sep 17 00:00:00 2001 From: Tal Rosler Date: Mon, 1 Jul 2019 14:55:29 +0300 Subject: [PATCH 12/14] add API to readme --- specification/security/resource-manager/readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/security/resource-manager/readme.md b/specification/security/resource-manager/readme.md index 4c49299eb991..edcbe3728c0f 100644 --- a/specification/security/resource-manager/readme.md +++ b/specification/security/resource-manager/readme.md @@ -52,6 +52,7 @@ These settings apply only when `--tag=package-composite-v1` is specified on the ```yaml $(tag) == 'package-composite-v1' input-file: - Microsoft.Security/preview/2019-01-01-preview/regulatoryCompliance.json +- Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json - Microsoft.Security/preview/2017-08-01-preview/pricings.json - Microsoft.Security/preview/2017-08-01-preview/securityContacts.json - Microsoft.Security/preview/2017-08-01-preview/workspaceSettings.json @@ -84,6 +85,7 @@ These settings apply only when `--tag=package-composite-v2` is specified on the ```yaml $(tag) == 'package-composite-v2' input-file: - Microsoft.Security/preview/2019-01-01-preview/regulatoryCompliance.json +- Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json - Microsoft.Security/stable/2018-06-01/pricings.json - Microsoft.Security/preview/2017-08-01-preview/securityContacts.json - Microsoft.Security/preview/2017-08-01-preview/workspaceSettings.json @@ -134,6 +136,7 @@ input-file: - Microsoft.Security/preview/2017-08-01-preview/securityContacts.json - Microsoft.Security/preview/2017-08-01-preview/workspaceSettings.json - Microsoft.Security/preview/2019-01-01-preview/regulatoryCompliance.json +- Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json # Needed when there is more than one input file override-info: From 89482dcf8578b1e202146f6251591f87eadf19e3 Mon Sep 17 00:00:00 2001 From: Tal Rosler Date: Mon, 1 Jul 2019 15:01:38 +0300 Subject: [PATCH 13/14] fix unit test --- .../2019-01-01-preview/assessmentsMetadata.json | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index 0448a73bbd34..cc8df634d054 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -123,7 +123,7 @@ "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" }, { - "$ref": "#/parameters/SubscriptionId" + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" } ], "responses": { @@ -165,7 +165,7 @@ "$ref": "#/parameters/AssessmentsMetadataName" }, { - "$ref": "#/parameters/SubscriptionId" + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" } ], "responses": { @@ -353,14 +353,6 @@ "type": "string", "description": "The Assessment Key - Unique key for the assessment type", "x-ms-parameter-location": "method" - }, - "SubscriptionId": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "Azure subscription ID. Regex pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$", - "x-ms-parameter-location": "method" } } } \ No newline at end of file From 0e6a90361fc68bf9a5438901b496cca25c4be270 Mon Sep 17 00:00:00 2001 From: Tal Rosler Date: Mon, 1 Jul 2019 15:20:11 +0300 Subject: [PATCH 14/14] fix operation id --- .../preview/2019-01-01-preview/assessmentsMetadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json index cc8df634d054..ebb8b15997ce 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json @@ -117,7 +117,7 @@ "Assessments Metadata" ], "description": "Get metadata information on all assessment types in a specific subscription", - "operationId": "AssessmentsMetadata_Subscription_List", + "operationId": "AssessmentsMetadataSubscription_List", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -156,7 +156,7 @@ "Assessments Metadata" ], "description": "Get metadata information on an assessment type in a specific subscription", - "operationId": "AssessmentsMetadata_Subscription_Get", + "operationId": "AssessmentsMetadataSubscription_Get", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion"