Skip to content

Commit e0916d0

Browse files
committed
SGX Demo Modifications
1 parent 8961b96 commit e0916d0

9 files changed

Lines changed: 27 additions & 41 deletions

File tree

samples/features/security/always-encrypted-with-secure-enclaves/azure-sql-database-sgx/README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,20 @@ You also need to make sure the following software is installed on your machine:
3131

3232
1. PowerShell modules:
3333

34-
1. Az version 5.6 or later. For details on how to install the Az PowerShell module, see [Install the Azure Az PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps). To determine the version of the Az module installed on your machine, run the following command from a PowerShell session.
34+
1. Az version 9.3 or later. For details on how to install the Az PowerShell module, see [Install the Azure Az PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps). To determine the version of the Az module installed on your machine, run the following command from a PowerShell session.
3535

3636
```powershell
3737
Get-InstalledModule -Name Az
3838
```
3939
40-
2. Az.Attestation 0.1.8 or later. For details on how to install the Az.Attestation PowerShell module, see [Install Az.Attestation PowerShell module](https://docs.microsoft.com/azure/attestation/quickstart-powershell#install-azattestation-powershell-module). To determine the version of the Az.Attestation module installed on your machine, run the following command from a PowerShell session.
41-
42-
```powershell
43-
Get-InstalledModule -Name Az.Attestation
44-
```
45-
46-
3. SqlServer version 21.1.18245 or later. For details on how to install the SqlServer PowerShell module, see [Installing or updating the SqlServer module](https://docs.microsoft.com/sql/powershell/download-sql-server-ps-module#installing-or-updating-the-sqlserver-module). To determine the version the SqlServer module installed on your machine, run the following command from a PowerShell session.
40+
2. SqlServer version 22.0.49-preview or later. For details on how to install the SqlServer PowerShell module, see [Installing or updating the SqlServer module](https://docs.microsoft.com/sql/powershell/download-sql-server-ps-module#installing-or-updating-the-sqlserver-module). To determine the version the SqlServer module installed on your machine, run the following command from a PowerShell session.
4741
4842
```powershell
4943
Get-InstalledModule -Name SqlServer
5044
```
5145
52-
1. [Bicep](https://docs.microsoft.com/azure/azure-resource-manager/templates/bicep-overview) version 0.4.63 or later. You need to install Bicep and ensure it can be invoked from PowerShell. The recommended way to achieve that is to [install Bicep manually with PowerShell](https://docs.microsoft.com/azure/azure-resource-manager/templates/bicep-install?tabs=azure-powershell#manual-with-powershell).
53-
1. [SQL Server Management Studio](https://msdn.microsoft.com/en-us/library/mt238290.aspx) - version 18.9.1 or later is recommended.
46+
1. [Bicep](https://docs.microsoft.com/azure/azure-resource-manager/templates/bicep-overview) version 0.13.1 or later. You need to install Bicep and ensure it can be invoked from PowerShell. The recommended way to achieve that is to [install Bicep manually with PowerShell](https://docs.microsoft.com/azure/azure-resource-manager/templates/bicep-install?tabs=azure-powershell#manual-with-powershell).
47+
1. [SQL Server Management Studio](https://msdn.microsoft.com/en-us/library/mt238290.aspx) - version 19 or later is recommended.
5448
5549
## Setup
5650
@@ -156,7 +150,7 @@ Perform the below steps before each demo presentation.
156150

157151
### Key Takeaways
158152

159-
Always Encrypted with secure enclaves requires specific hardware that is exposed in Azure SQL Database as the DC-series hardware configuration. Microsoft Azure Attestation is a Platform-as-a-Service solution for attestation enclaves in Azure. Enclaves are attested against a policy, you define and control.
153+
Always Encrypted with Intel SGX enclaves requires specific hardware that is exposed in Azure SQL Database as the DC-series hardware configuration. Microsoft Azure Attestation is a Platform-as-a-Service solution for attestation enclaves in Azure. Enclaves are attested against a policy, you define and control.
160154

161155
## Demo 2
162156

@@ -272,7 +266,7 @@ Perform the below steps before you show the demo.
272266

273267
![Connection Properties](./img/ssms-connect-to-server-connection-properties-page.png)
274268

275-
1. Select the **Always Encrypted** tab. Make sure the **Enable Always Encrypted** checkbox **is** selected. Enter your attestation URL.
269+
1. Select the **Always Encrypted** tab. Make sure the **Enable Always Encrypted** and the **Enable secure enclaves** checkbox are selected. Set the Enclave attestation Protocol to **Microsoft Azure Attestation** and enter your attestation URL.
276270

277271
![Always Encrypted disabled](./img/ssms-connect-to-server-always-encrypted-enabled.png)
278272

0 Bytes
Loading
Loading
Loading

samples/features/security/always-encrypted-with-secure-enclaves/azure-sql-database-sgx/setup/AttestationPolicy.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authorizationrules
33
{
44
[ type=="x-ms-sgx-is-debuggable", value==false ]
55
&& [ type=="x-ms-sgx-product-id", value==4639 ]
6-
&& [ type=="x-ms-sgx-svn", value>= 0 ]
6+
&& [ type=="x-ms-sgx-svn", value>= 2 ]
77
&& [ type=="x-ms-sgx-mrsigner", value=="e31c9e505f37a58de09335075fc8591254313eb20bb1a27e5443cc450b6e33e5"]
88
=> permit();
99
};

samples/features/security/always-encrypted-with-secure-enclaves/azure-sql-database-sgx/setup/azuredeploy.bicep

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ param location string = resourceGroup().location
3030

3131
// Create the server
3232
var SQLServerName_var = '${projectName}server'
33-
resource Server_Name_resource 'Microsoft.Sql/servers@2019-06-01-preview' = {
33+
resource Server_Name_resource 'Microsoft.Sql/servers@2022-05-01-preview' = {
3434
name: SQLServerName_var
3535
location: location
3636
tags: {}
@@ -47,7 +47,7 @@ resource Server_Name_resource 'Microsoft.Sql/servers@2019-06-01-preview' = {
4747
}
4848

4949
// Allow Azure services and resources to access this server
50-
resource Server_Name_AllowAllWindowsAzureIps 'Microsoft.Sql/servers/firewallRules@2015-05-01-preview' = {
50+
resource Server_Name_AllowAllWindowsAzureIps 'Microsoft.Sql/servers/firewallRules@2022-05-01-preview' = {
5151
name: '${Server_Name_resource.name}/AllowAllWindowsAzureIps'
5252
properties: {
5353
endIpAddress: '0.0.0.0'
@@ -56,7 +56,7 @@ resource Server_Name_AllowAllWindowsAzureIps 'Microsoft.Sql/servers/firewallRule
5656
}
5757

5858
// Allow Client IP to access this server
59-
resource Server_Name_AllowClientIP 'Microsoft.Sql/servers/firewallRules@2015-05-01-preview' = {
59+
resource Server_Name_AllowClientIP 'Microsoft.Sql/servers/firewallRules@2022-05-01-preview' = {
6060
name: '${Server_Name_resource.name}/AllowClientIP'
6161
properties: {
6262
endIpAddress: clientIP
@@ -65,7 +65,7 @@ resource Server_Name_AllowClientIP 'Microsoft.Sql/servers/firewallRules@2015-05-
6565
}
6666

6767
// Make the user an Azure AD administrator for the server, so that the user can connect with universal authentication
68-
resource Server_Name_activeDirectory 'Microsoft.Sql/servers/administrators@2019-06-01-preview' = {
68+
resource Server_Name_activeDirectory 'Microsoft.Sql/servers/administrators@2022-05-01-preview' = {
6969
name: '${Server_Name_resource.name}/activeDirectory'
7070
properties: {
7171
administratorType: 'ActiveDirectory'
@@ -80,7 +80,7 @@ resource Server_Name_activeDirectory 'Microsoft.Sql/servers/administrators@2019-
8080
// Create the ContosoHR database using the DC-series hardware configuration //
8181
//////////////////////////////////////////////////////////////////////////////
8282

83-
resource Database_Resource 'Microsoft.Sql/servers/databases@2020-08-01-preview' = {
83+
resource Database_Resource 'Microsoft.Sql/servers/databases@2022-05-01-preview' = {
8484
name: '${Server_Name_resource.name}/ContosoHR'
8585
location: location
8686
tags: {}
@@ -96,7 +96,7 @@ resource Database_Resource 'Microsoft.Sql/servers/databases@2020-08-01-preview'
9696
///////////////////////////////////////
9797

9898
// Create the attestation provider
99-
resource attestationProviderName_resource 'Microsoft.Attestation/attestationProviders@2020-10-01' = {
99+
resource attestationProviderName_resource 'Microsoft.Attestation/attestationProviders@2021-06-01-preview' = {
100100
name: '${projectName}attest'
101101
location: location
102102
properties: {}
@@ -107,7 +107,7 @@ resource attestationProviderName_resource 'Microsoft.Attestation/attestationProv
107107
///////////////////////////////////
108108

109109
// Create an App Service plan
110-
resource WebAppServicePlan_Resource 'Microsoft.Web/serverfarms@2021-01-01' = {
110+
resource WebAppServicePlan_Resource 'Microsoft.Web/serverfarms@2022-03-01' = {
111111
name: '${projectName}plan'
112112
location: location
113113
properties: {}
@@ -117,7 +117,7 @@ resource WebAppServicePlan_Resource 'Microsoft.Web/serverfarms@2021-01-01' = {
117117
}
118118

119119
// Create the App Service
120-
resource WebApp_Resource 'Microsoft.Web/sites@2021-01-01' = {
120+
resource WebApp_Resource 'Microsoft.Web/sites@2022-03-01' = {
121121
name: '${projectName}app'
122122
location: location
123123
identity: {
@@ -147,11 +147,13 @@ resource WebApp_Resource 'Microsoft.Web/sites@2021-01-01' = {
147147
}
148148

149149
// Deploy the application
150-
resource sourceControl 'Microsoft.Web/sites/sourcecontrols@2021-01-01' = {
150+
resource sourceControl 'Microsoft.Web/sites/sourcecontrols@2022-03-01' = {
151151
name: '${projectName}app/web'
152152
properties: {
153-
repoUrl: 'https://github.com/microsoft/sql-server-samples.git'
154-
branch: 'master'
153+
//repoUrl: 'https://github.com/microsoft/sql-server-samples.git'
154+
//branch: 'master'
155+
repoUrl: 'https://github.com/Pietervanhove/sql-server-samples.git'
156+
branch: 'AEVBSDemo'
155157
isManualIntegration: true
156158
}
157159
dependsOn: [
@@ -164,7 +166,7 @@ resource sourceControl 'Microsoft.Web/sites/sourcecontrols@2021-01-01' = {
164166
//////////////////////////////////////
165167

166168
// Create a key vault and assign key permissions to the user, so that the user can manage the keys
167-
resource KeyVault_Resource 'Microsoft.KeyVault/vaults@2019-09-01' = {
169+
resource KeyVault_Resource 'Microsoft.KeyVault/vaults@2022-07-01' = {
168170
name: '${projectName}vault'
169171
location: location
170172
tags: {}
@@ -197,7 +199,7 @@ resource KeyVault_Resource 'Microsoft.KeyVault/vaults@2019-09-01' = {
197199
}
198200

199201
// Assign key permissions to the web app
200-
resource KeyVaultWebAppAccessPolicy_Resource 'Microsoft.KeyVault/vaults/accessPolicies@2019-09-01' = {
202+
resource KeyVaultWebAppAccessPolicy_Resource 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = {
201203
name: any('${KeyVault_Resource.name}/add')
202204
properties: {
203205
accessPolicies: [
@@ -218,7 +220,7 @@ resource KeyVaultWebAppAccessPolicy_Resource 'Microsoft.KeyVault/vaults/accessPo
218220
}
219221

220222
// Create a key
221-
resource Key_Resource 'Microsoft.KeyVault/vaults/keys@2019-09-01' = {
223+
resource Key_Resource 'Microsoft.KeyVault/vaults/keys@2022-07-01' = {
222224
name: '${KeyVault_Resource.name}/CMK'
223225
tags: {}
224226
properties: {

samples/features/security/always-encrypted-with-secure-enclaves/azure-sql-database-sgx/setup/setup.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
Import-Module "Az" -MinimumVersion "5.6"
2-
Import-Module "Az.Attestation" -MinimumVersion "0.1.8"
3-
Import-Module "SqlServer" -MinimumVersion "21.1.18235"
1+
Import-Module "Az" -MinimumVersion "9.3"
2+
Import-Module "SqlServer" #-Version "22.0.49-preview"
43

54
######################################################################
65
# Prompt the user to enter the values of deployment parameters
@@ -143,7 +142,7 @@ $policy=Get-Content -path $policyFile -Raw
143142
Set-AzAttestationPolicy -Name $attestationProviderName -ResourceGroupName $resourceGroupName -Tee $teeType -Policy $policy -PolicyFormat $policyFormat
144143

145144
# Get the attestation URL
146-
$attestationProvider = Get-AzAttestation -Name $attestationProviderName -ResourceGroupName $resourceGroupName
145+
$attestationProvider = Get-AzAttestationProvider -Name $attestationProviderName -ResourceGroupName $resourceGroupName
147146
$attestationUrl = $attestationProvider.AttestUri
148147

149148
######################################################################

samples/features/security/always-encrypted-with-secure-enclaves/azure-sql-database-vbs/setup/AttestationPolicy.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

samples/features/security/always-encrypted-with-secure-enclaves/azure-sql-database-vbs/setup/setup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Import-Module "Az" -MinimumVersion "9.3"
2-
Import-Module "SqlServer"
2+
Import-Module "SqlServer" -Version "22.0.49-preview"
33

44
######################################################################
55
# Prompt the user to enter the values of deployment parameters

0 commit comments

Comments
 (0)