Skip to main content

sql_vulnerability_assessment_scans

Creates, updates, deletes, gets or lists a sql_vulnerability_assessment_scans resource.

Overview

Namesql_vulnerability_assessment_scans
TypeResource
Idazure.security.sql_vulnerability_assessment_scans

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
databasestringThe database name.
endTimestring (date-time)Scan results are valid until end time (UTC).
highSeverityFailedRulesCountintegerThe number of failed rules with high severity.
isBaselineAppliedbooleanBaseline created for this database, and has one or more rules.
lastScanTimestring (date-time)Last scan time.
lowSeverityFailedRulesCountintegerThe number of failed rules with low severity.
mediumSeverityFailedRulesCountintegerThe number of failed rules with medium severity.
serverstringThe server name.
sqlVersionstringThe SQL version.
startTimestring (date-time)The scan start time (UTC).
statestringThe scan status. Known values are: "Failed", "FailedToRun", "InProgress", and "Passed". (Failed, FailedToRun, InProgress, Passed)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
totalFailedRulesCountintegerThe number of total failed rules.
totalPassedRulesCountintegerThe number of total passed rules.
totalRulesCountintegerThe number of total rules assessed.
triggerTypestringThe scan trigger type. Known values are: "OnDemand" and "Recurring". (OnDemand, Recurring)
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscan_id, resource_iddatabaseNameGets the scan details of a single scan record. Gets the scan details of a single scan record.
get_scan_operation_resultselectresource_id, operation_iddatabaseNameGets the result of a scan operation initiated by the InitiateScan action. Gets the result of a scan operation initiated by the InitiateScan action.
listselectresource_iddatabaseNameGets a list of scan records. Gets a list of scan records.
initiate_scanexecresource_iddatabaseNameInitiates a vulnerability assessment scan. Initiates a vulnerability assessment scan.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
operation_idstringRequired.
resource_idstringRequired.
scan_idstringThe scan Id. Type 'latest' to get the scan record for the latest scan. Required.
databaseNamestringDefault value is None.

SELECT examples

Gets the scan details of a single scan record. Gets the scan details of a single scan record.

SELECT
id,
name,
database,
endTime,
highSeverityFailedRulesCount,
isBaselineApplied,
lastScanTime,
lowSeverityFailedRulesCount,
mediumSeverityFailedRulesCount,
server,
sqlVersion,
startTime,
state,
systemData,
totalFailedRulesCount,
totalPassedRulesCount,
totalRulesCount,
triggerType,
type
FROM azure.security.sql_vulnerability_assessment_scans
WHERE scan_id = '{{ scan_id }}' -- required
AND resource_id = '{{ resource_id }}' -- required
AND databaseName = '{{ databaseName }}'
;

Lifecycle Methods

Initiates a vulnerability assessment scan. Initiates a vulnerability assessment scan.

EXEC azure.security.sql_vulnerability_assessment_scans.initiate_scan 
@resource_id='{{ resource_id }}' --required,
@databaseName='{{ databaseName }}'
;