Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
啟動弱點評估掃描。
語法
Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
[-InstanceName] <String>
[-DatabaseName] <String>
[-AsJob]
[-ScanId <String>]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
-InputObject <AzureSqlManagedDatabaseModel>
[-AsJob]
[-ScanId <String>]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan Cmdlet 會觸發具有 ScanId 標識符的掃描。
掃描結果會儲存在 Update-AzSqlInstanceVulnerabilityAssessmentSetting Cmdlet 所定義的記憶體底下,在 scans/{ManagedInstanceName}/{ManagedDatabaseName}/scan_{ScanId}.json 您可以使用 get-AzSqlInstanceDatabaseVulnerabilityAssessmentScanRecord Cmdlet,並查看 State 傳回的參數來監視
範例
範例 1:啟動弱點評估掃描
Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
-DatabaseName "Database01" `
-ScanId "myScan"
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
DatabaseName : Database01
ScanId : myScan
TriggerType : OnDemand
State : Fail
StartTime : 6/11/2018 1:57:27 PM
EndTime : 6/11/2018 1:57:31 PM
Errors : {}
ScanResultsLocationPath : https://myaccount.blob.core.windows.net/vulnerability-assessment
scans/ManagedInstance01/Database01/scan_myScan.json
NumberOfFailedSecurityChecks : 9
範例 2:在沒有特定掃描標識符的情況下啟動弱點評估掃描
Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
-DatabaseName "Database01"
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
DatabaseName : Database01
ScanId : 20180611_135726
TriggerType : OnDemand
State : Fail
StartTime : 6/11/2018 1:57:27 PM
EndTime : 6/11/2018 1:57:31 PM
Errors : {}
ScanResultsLocationPath : https://myaccount.blob.core.windows.net/vulnerability-assessment
scans/ManagedInstance01/Database01/scan_myScan.json
NumberOfFailedSecurityChecks : 9
此命令會從 UTC 日期時間產生格式為 「yyyyMMdd_HHmmss」 的掃描識別碼。
範例 3:在背景啟動弱點評估掃描
$scanJob = Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
-DatabaseName "Database01" `
-ScanId "myScan" `
-AsJob
$scanJob | Wait-Job
$scanJob | Receive-Job
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
DatabaseName : Database01
ScanId : myScan
TriggerType : OnDemand
State : Fail
StartTime : 6/11/2018 1:57:27 PM
EndTime : 6/11/2018 1:57:31 PM
Errors : {}
ScanResultsLocationPath : https://myaccount.blob.core.windows.net/vulnerability-assessment
scans/ManagedInstance01/Database01/scan_myScan.json
NumberOfFailedSecurityChecks : 9
範例 4:使用受控資料庫對象啟動弱點評估掃描
Get-AzSqlInstanceDatabase `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
-Name "Database01" `
| Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
DatabaseName : Database01
ScanId : 20180611_135726
TriggerType : OnDemand
State : Fail
StartTime : 6/11/2018 1:57:27 PM
EndTime : 6/11/2018 1:57:31 PM
Errors : {}
ScanResultsLocationPath : https://myaccount.blob.core.windows.net/vulnerability-assessment
scans/ManagedInstance01/Database01/scan_myScan.json
NumberOfFailedSecurityChecks : 9
範例 5:在受控實例下的所有資料庫上啟動弱點評估掃描
Get-AzSqlInstanceDatabase `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
| Where-Object {$_.Name -ne "master"} `
| Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
DatabaseName : Database01
ScanId : 20180611_135726
TriggerType : OnDemand
State : Fail
StartTime : 6/11/2018 1:57:27 PM
EndTime : 6/11/2018 1:57:31 PM
Errors : {}
ScanResultsLocationPath : https://myaccount.blob.core.windows.net/vulnerability-assessment
scans/ManagedInstance01/Database01/scan_myScan.json
NumberOfFailedSecurityChecks : 9
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
DatabaseName : Database02
ScanId : 20180611_135726
TriggerType : OnDemand
State : Fail
StartTime : 6/11/2018 1:57:27 PM
EndTime : 6/11/2018 1:57:31 PM
Errors : {}
ScanResultsLocationPath : https://myaccount.blob.core.windows.net/vulnerability-assessment
scans/ManagedInstance01/Database02/scan_myScan.json
NumberOfFailedSecurityChecks : 9
參數
-AsJob
在背景執行 Cmdlet
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DatabaseName
SQL 受控資料庫名稱。
類型: | String |
Position: | 2 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-InputObject
要取得弱點評估設定的Managed資料庫物件
類型: | AzureSqlManagedDatabaseModel |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-InstanceName
SQL 受控實例名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
資源群組的名稱。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ScanId
指定掃描標識碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |