-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add subscription scope to assessment metadata API #6445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7d4b120
create assessmentMetadata.json
tarosler 59d31c7
update
tarosler 069fa75
update
tarosler c1cc699
update
tarosler cba198c
update
tarosler bb13beb
update
tarosler ce7047a
fix
tarosler 94e9adc
Add examples
1083840
fix CR comments
439b920
build fixes
566c1c1
fix build
97b1d9b
add API to readme
89482dc
fix unit test
0e6a903
fix operation id
d5d23f1
Merge branch 'master' into master
tarosler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
358 changes: 358 additions & 0 deletions
358
...y/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessmentsMetadata.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,358 @@ | ||
| { | ||
| "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 assessment metadata": { | ||
| "$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 assessment metadata": { | ||
| "$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" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata": { | ||
| "get": { | ||
| "x-ms-examples": { | ||
| "List security assessment metadata for subscription": { | ||
| "$ref": "./examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Assessments Metadata" | ||
| ], | ||
| "description": "Get metadata information on all assessment types in a specific subscription", | ||
| "operationId": "AssessmentsMetadataSubscription_List", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" | ||
| } | ||
| ], | ||
| "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 assessment metadata for subscription": { | ||
| "$ref": "./examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Assessments Metadata" | ||
| ], | ||
| "description": "Get metadata information on an assessment type in a specific subscription", | ||
| "operationId": "AssessmentsMetadataSubscription_Get", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/AssessmentsMetadataName" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" | ||
| } | ||
| ], | ||
| "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" | ||
| }, | ||
| "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" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "assessmentType", | ||
| "modelAsString": true, | ||
| "values": [ | ||
| { | ||
| "value": "BuiltIn" | ||
| }, | ||
| { | ||
| "value": "Custom" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "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" | ||
| } | ||
| } | ||
| } | ||
26 changes: 26 additions & 0 deletions
26
...eview/2019-01-01-preview/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "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. <a href=\"https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-faq#how-do-i-turn-on-antimalware-in-my-virtual-machine-scale-set\">Follow the instructions in How do I turn on antimalware in my virtual machine scale set</a>", | ||
| "category": [ | ||
| "Compute" | ||
| ], | ||
| "secureScoreWeight": 15, | ||
| "assessmentType": "Custom" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.