Skip to content

Commit 28bdaa1

Browse files
author
Steve Stein
authored
Merge pull request #7096 from MicrosoftDocs/release-ae-enclaves
merging AE enclaves content into the SQL release branch
2 parents 827135d + 0a693fd commit 28bdaa1

16 files changed

Lines changed: 1236 additions & 23 deletions
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: "Column encryption enclave type Server Configuration Option | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "09/24/2018"
5+
ms.prod: sql
6+
ms.prod_service: security
7+
ms.reviewer: ""
8+
ms.suite: "sql"
9+
ms.technology: configuration
10+
ms.tgt_pltfrm: ""
11+
ms.topic: conceptual
12+
caps.latest.revision: 11
13+
author: jaszymas
14+
ms.author: jaszymas
15+
manager: craigg
16+
monikerRange: ">= sql-server-ver15 || = sqlallproducts-allversions"
17+
---
18+
# column encryption enclave type Server Configuration Option
19+
[!INCLUDE[appliesto-ss-xxxx-xxxx-xxx-md](../../includes/appliesto-ss-xxxx-xxxx-xxx-md.md)]
20+
21+
Use the **column encryption enclave type** option to enable or disable a secure enclave for Always Encrypted. For more information, see [Always Encrypted with secure enclaves](../../relational-databases/security/encryption/always-encrypted-enclaves.md).
22+
23+
The following table lists the possible **column encryption enclave type** values:
24+
25+
|Value|Description|
26+
|-------------------|-----------------|
27+
|0|**No secure enclave**. The [!INCLUDE[ssDE](../../includes/ssde-md.md)] will not initialize the secure enclave for Always Encrypted. As a result, the functionality of Always Encrypted with secure enclaves will not be available.|
28+
|1|**Virtualization based security (VBS)**. The [!INCLUDE[ssDE](../../includes/ssde-md.md)] will initialize the secure enclave (a VBS secure memory enclave) for Always Encrypted.|
29+
30+
> [!IMPORTANT]
31+
> Changes to the **column encryption enclave type** do not take affect until you restart the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance.
32+
33+
34+
## Examples
35+
The following example enables the secure enclave:
36+
37+
```sql
38+
sp_configure 'column encryption enclave type', 1;
39+
GO
40+
RECONFIGURE;
41+
GO
42+
```
43+
44+
The following example disables the secure enclave:
45+
46+
```sql
47+
sp_configure 'column encryption enclave type', 0;
48+
GO
49+
RECONFIGURE;
50+
GO
51+
```
52+
53+
## See Also
54+
[sp_configure (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md)
55+
[RECONFIGURE (Transact-SQL)](../../t-sql/language-elements/reconfigure-transact-sql.md)
56+
[Server Configuration Options (SQL Server)](../../database-engine/configure-windows/server-configuration-options-sql-server.md)
57+
58+

docs/database-engine/configure-windows/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
href: clr-enabled-server-configuration-option.md
3737
- name: clr strict security Server Configuration Option
3838
href: clr-strict-security.md
39+
- name: column encryption enclave type Server Configuration Option
40+
href: configure-column-encryption-enclave-type.md
3941
- name: common criteria compliance enabled Server Configuration Option
4042
href: common-criteria-compliance-enabled-server-configuration-option.md
4143
- name: contained database authentication Server Configuration Option
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
---
2+
title: "Always Encrypted with Secure Enclaves (Database Engine) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "09/24/2018"
5+
ms.prod: sql
6+
ms.prod_service: "database-engine, sql-database"
7+
ms.reviewer: ""
8+
ms.suite: "sql"
9+
ms.technology: security
10+
ms.tgt_pltfrm: ""
11+
ms.topic: conceptual
12+
author: jaszymas
13+
ms.author: jaszymas
14+
manager: craigg
15+
monikerRange: ">= sql-server-ver15 || = sqlallproducts-allversions"
16+
---
17+
18+
# Always Encrypted with Secure Enclaves
19+
20+
Always Encrypted with secure enclaves provides additional functionality to the [Always Encrypted](always-encrypted-database-engine.md) feature.
21+
22+
Introduced in SQL Server 2016, Always Encrypted protects the confidentiality of sensitive data from malware and high-privileged *unauthorized* users of SQL Server. High-privileged unauthorized users are DBAs, computer admins, cloud admins, or anyone else who has legitimate access to server instances, hardware, etc., but who should not have access to some or all of the actual data.
23+
24+
Until now, Always Encrypted protected the data by encrypting it on the client side and never allowing the data or the corresponding cryptographic keys to appear in plaintext inside the SQL Server Engine. As a result, the functionality on encrypted columns inside the database was severely restricted. The only operation SQL Server could perform on encrypted data was equality comparisons (and equality comparisons were only available with deterministic encryption). All other operations, including cryptographic operations (initial data encryption or key rotation), or rich computations (for example, pattern matching) were not supported inside the database. Users needed to move the data outside of the database to perform these operations on the client-side.
25+
26+
Always Encrypted *with secure enclaves* addresses these limitations by allowing computations on plaintext data inside a secure enclave on the server side. A secure enclave is a protected region of memory within the SQL Server process, and acts as a trusted execution environment for processing sensitive data inside the SQL Server engine. A secure enclave appears as a black box to the rest of the SQL Server and other processes on the hosting machine. There is no way to view any data or code inside the enclave from the outside, even with a debugger.
27+
28+
29+
Always Encrypted uses secure enclaves as illustrated in the following diagram:
30+
31+
![data flow](./media/always-encrypted-enclaves/ae-data-flow.png)
32+
33+
34+
35+
When parsing an application's query, the SQL Server Engine determines if the query contains any operations on encrypted data that require the use of the secure enclave. For queries where the secure enclave needs to be accessed:
36+
37+
- The client driver sends the column encryption keys required for the operations to the secure enclave (over a secure channel).
38+
- Then, the client driver submits the query for execution along with the encrypted query parameters.
39+
40+
During query processing, the data or the column encryption keys are not exposed in plaintext in the SQL Server Engine outside of the secure enclaves. The SQL Server engine delegates cryptographic operations and computations on encrypted columns to the secure enclave. If needed, the secure enclave decrypts the query parameters and/or the data stored in encrypted columns and performs the requested operations.
41+
42+
## Why use Always Encrypted with secure enclaves?
43+
44+
With secure enclaves, Always Encrypted protects the confidentiality of sensitive data while providing the following benefits:
45+
46+
- **In-place encryption** – cryptographic operations on sensitive data, for example: initial data encryption or rotating a column encryption key, are performed inside the secure enclave and do not require moving the data outside of the database. You can issue in-place encryption using the ALTER TABLE Transact-SQL statement, and you do not need to use tools, such as the Always Encrypted wizard in SSMS or the Set-SqlColumnEncryption PowerShell cmdlet.
47+
48+
- **Rich computations (preview)** – operations on encrypted columns, including pattern matching (the LIKE predicate) and range comparisons, are supported inside the secure enclave, which unlocks Always Encrypted to a broad range of applications and scenarios that require such computations to be performed inside the database system.
49+
50+
> [!IMPORTANT]
51+
> In SQL Server 2019 CTP 2.0, rich computations are pending several performance optimizations, include limited functionality (no indexing, etc), and are currently disabled by default. To enable rich computations, see [Enable rich computations](configure-always-encrypted-enclaves.md#configure-a-secure-enclave).
52+
53+
In SQL Server 2019 CTP 2.0, Always Encrypted with secure enclaves uses [Virtualization-based Security (VBS)](https://docs.microsoft.com/windows-hardware/design/device-experiences/oem-vbs) secure memory enclaves (also known as Virtual Secure Mode, or VSM enclaves) in Windows.
54+
55+
## Secure Enclave Attestation
56+
57+
The secure enclave inside the SQL Server Engine can access sensitive data stored in encrypted database columns and the corresponding column encryption keys in plaintext. Before submitting a query that involves enclave computations to SQL Server, the client driver inside the application must verify the secure enclave is a genuine enclave based on a given technology (for example, VBS) and the code running inside the enclave has been signed for running inside the enclave.
58+
59+
The process of verifying the enclave is called **enclave attestation**, and it usually involves a client driver within the application (and sometimes also SQL Server) contacting an external attestation service. The specifics of the attestation process depend on the enclave technology and the attestation service.
60+
61+
The attestation process, SQL Server supports for VBS secure enclaves in SQL Server vNext CTP is Windows Defender System Guard runtime attestation, which uses Host Guardian Service (HGS) as an attestation service. You need to configure HGS in your environment and register the machine hosting your SQL Server instance in HGS. You also must configure you client applications or tools (for example, SQL Server Management Studio) with an HGS attestation.
62+
63+
## Secure Enclave Providers
64+
65+
To use Always Encrypted with secure enclaves, an application must use a client driver that supports the feature. In SQL Server 2019 CTP 2.0, your applications must use .NET Framework 4.7.2 and .NET Framework Data Provider for SQL Server. In addition, .NET applications must be configured with a **secure enclave provider** specific to the enclave type (for example, VBS) and the attestation service (for example, HGS), you are using. The supported enclave providers are shipped separately in a NuGet package, which you need to integrate with your application. An enclave provider implements the client-side logic for the attestation protocol and for establishing a secure channel with a secure enclave of a given type.
66+
67+
## Enclave-enabled Keys
68+
69+
Always Encrypted with secure enclaves introduces the concept of enclave-enabled keys:
70+
71+
- **Enclave-enabled column master key** – a column master key that has the ENCLAVE_COMPUTATIONS property specified in the column master key metadata object inside the database. The column master key metadata object must also contain a valid signature of the metadata properties.
72+
- **Enclave-enabled column encryption key** – a column encryption key that is encrypted with an enclave-enabled column master key.
73+
74+
When the SQL Server Engine determines operations, specified in a query, need to be performed inside the secure enclave, the SQL Server Engine requests the client driver shares the column encryption keys that are needed for the computations with the secure enclave. The client driver shares the column encryption keys only if the keys are enclave-enabled (that is, encrypted with enclave-enabled column master keys) and they are properly signed. Otherwise, the query fails.
75+
76+
## Enclave-enabled Columns
77+
78+
An enclave-enabled column is a database column encrypted with an enclave-enabled column encryption key. The functionality available for an enclave-enabled column depends on the encryption type the column is using.
79+
80+
- **Deterministic encryption** - Enclave-enabled columns using deterministic encryption support in-place encryption, but no other operations inside the secure enclave. Equality comparison is supported, but it is performed outside of the enclave, by comparing the ciphertext (outside of the enclave).
81+
- **Randomized encryption** - Enclave-enabled columns using randomized encryption support in-place encryption as well as rich computations inside the secure enclave. The supported rich computations are pattern matching and [comparison operators](https://docs.microsoft.com/sql/t-sql/language-elements/comparison-operators-transact-sql), including equality comparison.
82+
83+
For more information about encryption types, see [Always Encrypted Cryptography](always-encrypted-cryptography.md).
84+
85+
The following table summarizes the functionality available for encrypted columns, depending on whether the columns use enclave-enabled column encryption keys and an encryption
86+
type.
87+
88+
| **Operation**| **Column is NOT enclave-enabled** |**Column is NOT enclave-enabled**| **Column is enclave-enabled** |**Column is enclave-enabled** |
89+
|:---|:---|:---|:---|:---|
90+
| | **Randomized encryption** | **Deterministic encryption** | **Randomized encryption** | **Deterministic encryption** |
91+
| **In-place encryption** | Not Supported | Not Supported | Supported | Supported |
92+
| **Equality comparison** | Not Supported | Supported outside of the enclave | Supported (inside the enclave) | Supported outside of the enclave |
93+
| **Comparison operators beyond equality** | Not Supported | Not Supported | Supported | Not Supported |
94+
| **LIKE** | Not Supported | Not Supported | Supported | Not Supported |
95+
96+
In-place encryption includes support for the following operations inside the enclave:
97+
98+
- Initial encryption of data stored in an existing column.
99+
- Re-encrypting existing data in a column, for example:
100+
101+
- Rotating the column encryption key (re-encrypting the column with a new key).
102+
- Changing the encryption type.
103+
104+
- Decrypting data stored in an encrypted column (converting the column into a plaintext column).
105+
106+
For in-place encryption to be possible, the column encryption key (or keys), involved in the cryptographic operations, must be enclave-enabled:
107+
108+
- Initial encryption: the column encryption key for the column being encrypted must be enclave-enabled.
109+
- Re-encryption: both the current and the target column encryption key (if different than the current key) must be enclave-enabled.
110+
- Decryption: the current column encryption key of the column must be enclave-enabled.
111+
112+
## Known limitations
113+
114+
General limitations:
115+
116+
- All limitations listed for the current version of Always Encrypted at [Feature Details](https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine#feature-details) also apply to Always Encrypted with secure enclaves (to columns encrypted with enclave-enabled keys), except the restrictions that are removed by adding support for in-place encryption and rich computations.
117+
118+
- Equality comparison remains the only Transact-SQL operator supported with deterministic encryption and equality comparisons are performed by comparing ciphertext values outside of the enclave, regardless if the columns encryption key is enclave-enabled or not. The only new functionality that gets unlocked with enclave-enabled column encryption keys for deterministic encryption, are in-place cryptographic operations. If you have a column that is encrypted using deterministic encryption (and a key that is not enclave-enabled), to enable rich computations (pattern matching, comparison operations), you need to re-encrypt the column using randomized encryption.
119+
120+
- The existing restriction on using collations apply to columns encrypted with enclave-enabled column encryption keys: character string columns (char, nchar, varchar, nvarchar) encrypted using deterministic encryption must use collations with a binary2 sort order (BIN2 collations). Character string columns using non-BIN2 collations can be encrypted using randomized encryption – however the only new functionality that is enabled for such columns (if they are encrypted with enclave-enabled column encryption keys) is in-place encryption. **To support rich computations (pattern matching, comparison operations), a column must use a BIN2 collation** (and the column must be encrypted using randomized encryption and an enclave-enabled column encryption key).
121+
122+
- Using enclave-enabled keys for columns in in-memory tables is not supported.
123+
124+
- In-place cryptographic operations cannot be combined with any other changes of column metadata, except collation and nullability changes. For example, you cannot encrypt, re-encrypt, or decrypt, a column AND change a data type of the column in a single ALTER TABLE or ALTER COLUMN Transact-SQL statement. You need to use two separate statements.
125+
126+
The following limitations apply to the current Preview, but are on the roadmap to be addressed:
127+
128+
- Enclave-enabled columns using randomized encryptions cannot be indexed, which means that comparison operations or LIKE operations require table scans.
129+
130+
- The only client driver supporting Always Encrypted with secure enclaves is .NET Framework Data Provider for SQL Server (ADO.NET) in .NET Framework 4.7.2. There is no ODBC/JDBC support.
131+
132+
- The only supported key stores for storing enclave-enabled column master keys are Windows Certificate Store and Azure Key Vault.
133+
134+
- Tooling support for Always Encrypted with secure enclaves is currently incomplete. To trigger an in-place cryptographic operation via an ALTER TABLE Transact-SQL statement, you need to issue the statement using a query window in SSMS, or you can write your own program that issues the statement. The Set-SqlColumnEncryption cmdlet in the SqlServer PowerShell module and the Always Encrypted wizard in SQL Server Management Studio do not support in-place encryption yet - both tools currently move the data out of the database for cryptographic operations, event the column encryption keys used for the operations are enclave-enabled.
135+
136+
## Known issues
137+
138+
- For rich computations, a BIN2 collation must be set at the database level.

0 commit comments

Comments
 (0)