microsoft / SQLServerPSModule

This repo is the home of SQL Server PowerShell Module development.
MIT License
45 stars 1 forks source link

Enclave enabled keys in a database without an enclave #67

Open Pietervanhove opened 7 months ago

Pietervanhove commented 7 months ago

When creating a column master key you can specify if the key should be enclave enabled or not.

$cmkSettings = New-SqlAzureKeyVaultColumnMasterKeySettings -KeyURL $akvKey.ID -AllowEnclaveComputations -KeyVaultAccessToken $keyVaultAccessToken

$cmkName = "CMK1" New-SqlColumnMasterKey -Name $cmkName -InputObject $database -ColumnMasterKeySettings $cmkSettings

At the moment, you can create an enclave enabled key in a database that doesn't has an enclave. I would expect that the PowerShell command returns an error message since there is no enclave enabled on the database. This is not possible in SSMS for example.

Matteo-T commented 5 months ago

Thanks @Pietervanhove. I've assigned this one to @DBarmanMS (feel free to do that yourself the next time around).