Sql Vulnerability Assessment Baseline Rules - Add

Add a list of baseline rules. Will overwrite any previously existing results (for all rules).

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

URI Parameters

Name In Required Type Description
resourceId
path True

string

The identifier of the resource.

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

object

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

Responses

Name Type Description
200 OK

RulesResults

Successfully removed the database 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 for all rules
Create a baseline for all rules using the latest scan results

Create a baseline for all rules

Sample request

POST 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?workspaceId=55555555-6666-7777-8888-999999999999&api-version=2023-02-01-preview

{
  "latestScan": false,
  "results": {
    "VA1234": [
      [
        "userA",
        "SELECT"
      ],
      [
        "userB",
        "SELECT"
      ]
    ],
    "VA5678": [
      [
        "Test",
        "0.0.0.0",
        "125.125.125.125"
      ]
    ]
  }
}

Sample response

{
  "value": [
    {
      "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"
          ]
        ]
      }
    },
    {
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA5678",
      "name": "VA5678",
      "type": "Microsoft.Security/sqlVulnerabilityAssessments/baselineRules",
      "properties": {
        "results": [
          [
            "Test",
            "0.0.0.0",
            "125.125.125.125"
          ]
        ]
      }
    }
  ]
}

Create a baseline for all rules using the latest scan results

Sample request

POST 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?workspaceId=55555555-6666-7777-8888-999999999999&api-version=2023-02-01-preview

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

Sample response

{
  "value": [
    {
      "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"
          ]
        ]
      }
    },
    {
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA5678",
      "name": "VA5678",
      "type": "Microsoft.Security/sqlVulnerabilityAssessments/baselineRules",
      "properties": {
        "results": [
          [
            "Test",
            "0.0.0.0",
            "125.125.125.125"
          ]
        ]
      }
    }
  ]
}

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.

RuleResultsProperties

Rule results properties.

RulesResults

A list of rules results.

RulesResultsInput

Rules results input.

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

RuleResultsProperties

Rule results properties.

Name Type Description
results

string[]

Expected results in the baseline.

RulesResults

A list of rules results.

Name Type Description
value

RuleResults[]

List of rule results.

RulesResultsInput

Rules results input.

Name Type Description
latestScan

boolean

Take results from latest scan.

results

object

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