-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Assessments API (Azure Security Center) #7678
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
3 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
|
|
@@ -1602,6 +1602,7 @@ VMQS | |
| vmsizes | ||
| VMSS | ||
| VMSSVM | ||
| vmuuid | ||
| vmware | ||
| vmwaretools | ||
| VMXNET | ||
|
|
||
374 changes: 374 additions & 0 deletions
374
.../security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/assessments.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,374 @@ | ||
| { | ||
| "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": { | ||
| "/{scope}/providers/Microsoft.Security/assessments": { | ||
| "get": { | ||
| "x-ms-examples": { | ||
| "List security assessments": { | ||
| "$ref": "./examples/Assessments/ListAssessments_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Assessments" | ||
| ], | ||
| "description": "Get security assessments on all your scanned resources inside a scope", | ||
| "operationId": "Assessments_List", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/Scope" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/SecurityAssessmentList" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "../../../common/v1/types.json#/definitions/CloudError" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-pageable": { | ||
| "nextLinkName": "nextLink" | ||
| } | ||
| } | ||
| }, | ||
| "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}": { | ||
| "get": { | ||
| "x-ms-examples": { | ||
| "Get security recommendation task from security data location": { | ||
| "$ref": "./examples/Assessments/GetAssessment_example.json" | ||
| }, | ||
| "Get security recommendation task from security data location with expand parameter": { | ||
| "$ref": "./examples/Assessments/GetAssessmentWithExpand_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Assessments" | ||
| ], | ||
| "description": "Get a security assessment on your scanned resource", | ||
| "operationId": "Assessments_Get", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceId" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/AssessmentName" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ExpandAssessments" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/SecurityAssessment" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "../../../common/v1/types.json#/definitions/CloudError" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "put": { | ||
| "x-ms-examples": { | ||
| "Create security recommendation task on a resource": { | ||
| "$ref": "./examples/Assessments/PutAssessment_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Assessments" | ||
| ], | ||
| "description": "Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result", | ||
| "operationId": "Assessments_CreateOrUpdate", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceId" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/AssessmentName" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/AssessmentBody" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "201": { | ||
| "description": "Created", | ||
| "schema": { | ||
| "$ref": "#/definitions/SecurityAssessment" | ||
| } | ||
| }, | ||
| "200": { | ||
chlahav marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "description": "OK - Updated", | ||
| "schema": { | ||
| "$ref": "#/definitions/SecurityAssessment" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "../../../common/v1/types.json#/definitions/CloudError" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "delete": { | ||
| "x-ms-examples": { | ||
| "Delete a security recommendation task on a resource": { | ||
| "$ref": "./examples/Assessments/DeleteAssessment_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Assessments" | ||
| ], | ||
| "description": "Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result", | ||
| "operationId": "Assessments_Delete", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceId" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/AssessmentName" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK - Assessment was deleted" | ||
| }, | ||
| "204": { | ||
| "description": "No Content - Assessment does not exist" | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "../../../common/v1/types.json#/definitions/CloudError" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "SecurityAssessmentList": { | ||
| "type": "object", | ||
| "description": "Page of a security assessments list", | ||
| "properties": { | ||
| "value": { | ||
| "description": "Collection of security assessments in this page", | ||
| "readOnly": true, | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/SecurityAssessment" | ||
| } | ||
| }, | ||
| "nextLink": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The URI to fetch the next page." | ||
| } | ||
| } | ||
| }, | ||
| "SecurityAssessment": { | ||
| "type": "object", | ||
| "description": "Security assessment on a resource", | ||
| "properties": { | ||
| "properties": { | ||
| "x-ms-client-flatten": true, | ||
| "$ref": "#/definitions/SecurityAssessmentProperties" | ||
| } | ||
| }, | ||
| "allOf": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/definitions/Resource" | ||
| } | ||
| ] | ||
| }, | ||
| "SecurityAssessmentProperties": { | ||
| "type": "object", | ||
| "description": "Describes properties of an assessment.", | ||
| "properties": { | ||
| "resourceDetails": { | ||
| "$ref": "../../../common/v1/types.json#/definitions/ResourceDetails" | ||
| }, | ||
| "displayName": { | ||
| "readOnly": true, | ||
pilor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "type": "string", | ||
| "description": "User friendly display name of the assessment" | ||
| }, | ||
| "status": { | ||
| "$ref": "#/definitions/AssessmentStatus" | ||
| }, | ||
| "additionalData": { | ||
| "type": "object", | ||
pilor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "description": "Additional data regarding the assessment", | ||
| "additionalProperties": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "links": { | ||
| "$ref": "#/definitions/AssessmentLinks" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "resourceDetails", | ||
| "status" | ||
| ] | ||
| }, | ||
| "AssessmentLinks": { | ||
| "type": "object", | ||
| "description": "Links relevant to the assessment", | ||
| "readOnly": true, | ||
| "properties": { | ||
| "azurePortalUri": { | ||
| "type": "string", | ||
| "description": "Link to assessment in Azure Portal", | ||
| "readOnly": true | ||
| } | ||
| } | ||
| }, | ||
| "AssessmentStatus": { | ||
| "type": "object", | ||
| "description": "The result of the assessment", | ||
| "properties": { | ||
| "code": { | ||
| "type": "string", | ||
| "description": "Programmatic code for the status of the assessment", | ||
| "enum": [ | ||
| "Healthy", | ||
| "Unhealthy", | ||
| "NotApplicable" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "AssessmentStatusCode", | ||
| "modelAsString": true, | ||
| "values": [ | ||
| { | ||
| "value": "Healthy", | ||
| "description": "The resource is healthy" | ||
| }, | ||
| { | ||
| "value": "Unhealthy", | ||
| "description": "The resource has a security issue that needs to be addressed" | ||
| }, | ||
| { | ||
| "value": "NotApplicable", | ||
| "description": "Assessment for this resource did not happen" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "cause": { | ||
| "type": "string", | ||
| "description": "Programmatic code for the cause of the assessment status" | ||
| }, | ||
| "description": { | ||
| "type": "string", | ||
| "description": "Human readable description of the assessment status" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "code" | ||
| ] | ||
| } | ||
| }, | ||
| "parameters": { | ||
| "ExpandAssessments": { | ||
| "name": "$expand", | ||
| "in": "query", | ||
| "required": false, | ||
| "type": "string", | ||
| "description": "OData expand. Optional.", | ||
| "x-ms-parameter-location": "method", | ||
| "enum": [ | ||
| "links", | ||
| "metadata" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "ExpandEnum", | ||
| "modelAsString": true, | ||
| "values": [ | ||
| { | ||
| "value": "links", | ||
| "description": "All links associated with an assessment" | ||
| }, | ||
| { | ||
| "value": "metadata", | ||
| "description": "Assessment metadata" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "AssessmentName": { | ||
| "name": "assessmentName", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The Assessment Key - Unique key for the assessment type", | ||
| "x-ms-parameter-location": "method" | ||
| }, | ||
| "AssessmentBody": { | ||
| "name": "assessment", | ||
| "in": "body", | ||
| "required": true, | ||
| "schema": { | ||
| "$ref": "#/definitions/SecurityAssessment" | ||
| }, | ||
| "description": "Calculated assessment on a pre-defined assessment metadata", | ||
| "x-ms-parameter-location": "method" | ||
| } | ||
| } | ||
| } | ||
11 changes: 11 additions & 0 deletions
11
...ft.Security/preview/2019-01-01-preview/examples/Assessments/DeleteAssessment_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,11 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2019-01-01-preview", | ||
| "resourceId": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", | ||
| "assessmentName": "8bb8be0a-6010-4789-812f-e4d661c4ed0e" | ||
| }, | ||
| "responses": { | ||
| "200": {}, | ||
| "204": {} | ||
| } | ||
| } |
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.