Sql Vulnerability Assessment Baseline Rules - Create Or Update

Creates a Baseline for a rule in a database. Will overwrite any previously existing results.

PUT https://management.azure.com/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}?workspaceId={workspaceId}&api-version=2023-02-01-preview

URI Parameters

Name In Required Type Description
resourceId
path True

string

The identifier of the resource.

ruleId
path True

string

The rule Id.

api-version
query True

string

The api version.

workspaceId
query True

string

The workspace Id.

Request Body

Name Type Description
latestScan

boolean

Take results from latest scan.

results

string[]

Expected results to be inserted into the baseline. Leave this field empty it LatestScan == true.

Responses

Name Type Description
200 OK

RuleResults

Successfully set the vulnerability assessment rule baseline.

Other Status Codes

CloudError

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create a baseline
Create a baseline using the latest scan results

Create a baseline

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234?workspaceId=55555555-6666-7777-8888-999999999999&api-version=2023-02-01-preview

{
  "latestScan": false,
  "results": [
    [
      "userA",
      "SELECT"
    ],
    [
      "userB",
      "SELECT"
    ]
  ]
}

Sample response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234",
  "name": "VA1234",
  "type": "Microsoft.Security/sqlVulnerabilityAssessments/baselineRules",
  "properties": {
    "results": [
      [
        "userA",
        "SELECT"
      ],
      [
        "userB",
        "SELECT"
      ]
    ]
  }
}

Create a baseline using the latest scan results

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234?workspaceId=55555555-6666-7777-8888-999999999999&api-version=2023-02-01-preview

{
  "latestScan": true,
  "results": []
}

Sample response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234",
  "name": "VA1234",
  "type": "Microsoft.Security/sqlVulnerabilityAssessments/baselineRules",
  "properties": {
    "results": [
      [
        "userA",
        "SELECT"
      ],
      [
        "userB",
        "SELECT"
      ]
    ]
  }
}

Definitions

Name Description
CloudError

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

CloudErrorBody

The error detail.

ErrorAdditionalInfo

The resource management error additional info.

RuleResults

Rule results.

RuleResultsInput

Rule results input.

RuleResultsProperties

Rule results properties.

CloudError

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

Name Type Description
error.additionalInfo

ErrorAdditionalInfo[]

The error additional info.

error.code

string

The error code.

error.details

CloudErrorBody[]

The error details.

error.message

string

The error message.

error.target

string

The error target.

CloudErrorBody

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

CloudErrorBody[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

RuleResults

Rule results.

Name Type Description
id

string

Resource Id

name

string

Resource name

properties

RuleResultsProperties

Rule results properties.

type

string

Resource type

RuleResultsInput

Rule results input.

Name Type Description
latestScan

boolean

Take results from latest scan.

results

string[]

Expected results to be inserted into the baseline. Leave this field empty it LatestScan == true.

RuleResultsProperties

Rule results properties.

Name Type Description
results

string[]

Expected results in the baseline.