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 |
---|---|---|---|---|
resource
|
path | True |
string |
The identifier of the resource. |
api-version
|
query | True |
string |
The api version. |
workspace
|
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 |
Successfully removed the database vulnerability assessment rule baseline. |
|
Other Status Codes |
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 |
---|---|
Cloud |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
Cloud |
The error detail. |
Error |
The resource management error additional info. |
Rule |
Rule results. |
Rule |
Rule results properties. |
Rules |
A list of rules results. |
Rules |
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 |
The error additional info. |
|
error.code |
string |
The error code. |
error.details |
The error details. |
|
error.message |
string |
The error message. |
error.target |
string |
The error target. |
CloudErrorBody
The error detail.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
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 |
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 |
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. |