Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release/2.0] Fix | Fix Enclave Session Cache Issue with Azure Database #628

Merged
merged 12 commits into from
Jul 21, 2020

Conversation

karinazhou
Copy link
Member

This PR is to fix the issue when connecting to Azure SQL databases with secure enclaves.

The initial enclave session cache key only contains the enclave attestation URL and the server name. It works well with on-prem SQL Servers if we switch between various databases under the same server. However, this will fail for Azure SQL. Sharing the same enclave session among different databases under the same logic Azure server will cause the Azure attestation to fail.

To fix this issue, the database name is also added to the enclave session cache key.

@cheenamalhotra cheenamalhotra changed the title Fix | Fix Enclave Session Cache Issue wit Azure Database Fix | Fix Enclave Session Cache Issue with Azure Database Jul 6, 2020
@cheenamalhotra
Copy link
Member

cc @Xtrimmer

@cheenamalhotra cheenamalhotra added this to the 2.0.1 milestone Jul 7, 2020
karinazhou and others added 7 commits July 7, 2020 14:23
…ent/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs

Co-authored-by: Cheena Malhotra <v-chmalh@microsoft.com>
…t/SimulatorEnclaveProvider.cs


Extended parameter description

Co-authored-by: Cheena Malhotra <v-chmalh@microsoft.com>
…ent/EnclaveDelegate.NetStandard.cs


Extended parameter description

Co-authored-by: Cheena Malhotra <v-chmalh@microsoft.com>
…ent/EnclaveDelegate.NetCoreApp.cs


Updated parameter description

Co-authored-by: Cheena Malhotra <v-chmalh@microsoft.com>
…veProvider.xml


Updated parameter description

Co-authored-by: Cheena Malhotra <v-chmalh@microsoft.com>
…veProvider.xml


Updated parameter description

Co-authored-by: Cheena Malhotra <v-chmalh@microsoft.com>
@cheenamalhotra cheenamalhotra changed the title Fix | Fix Enclave Session Cache Issue with Azure Database [Release/2.0] Fix | Fix Enclave Session Cache Issue with Azure Database Jul 8, 2020
@@ -42,8 +42,9 @@ internal class EnclaveDelegate
/// <param name="enclaveType">enclave type</param>
/// <param name="serverName">server name</param>
/// <param name="enclaveAttestationUrl">url for attestation endpoint</param>
/// <param name="database">The database that SqlClient contacts to.</param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Pending]

@@ -159,11 +160,12 @@ private byte[] GetUintBytes(string enclaveType, int intValue, string variableNam
/// <param name="enclaveType">enclave type</param>
/// <param name="serverName">servername</param>
/// <param name="attestationUrl">attestation url for attestation service endpoint</param>
/// <param name="database">The database that SqlClient contacts to.</param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Pending]

@cheenamalhotra cheenamalhotra merged commit 0c80751 into dotnet:2.0-servicing Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants