Događaj
31. mar 23 - 2. apr 23
Najveći SKL, Fabric i Pover BI događaj učenja. 31. mart – 2. april. Koristite kod FABINSIDER da uštedite $400.
Registrujte se već danasOvaj pregledač više nije podržan.
Nadogradite na Microsoft Edge biste iskoristili najnovije funkcije, bezbednosne ispravke i tehničku podršku.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
Always Encrypted uses two types of cryptographic keys to protect your data - one key to encrypt your data, and another key to encrypt the key that encrypts your data. The column encryption key encrypts your data, the column master key encrypts the column encryption key. This article provides a detailed overview for managing these encryption keys.
When discussing Always Encrypted keys and key management it's important to understand the distinction between the actual cryptographic keys, and the metadata objects that describe the keys. We use the terms column encryption key and column master key to refer to the actual cryptographic keys, and we use column encryption key metadata and column master key metadata to refer to the Always Encrypted key descriptions in the database.
Column encryption keys are content-encryption keys used to encrypt data. As the name implies, you use column encryption keys to encrypt data in database columns. You can encrypt one or more columns with the same column encryption key, or you can use multiple column encryption keys depending on your application requirements. The column encryption keys are themselves encrypted, and only the encrypted values of the column encryption keys are stored in the database (as part of the column encryption key metadata). The column encryption key metadata is stored in the sys.column_encryption_keys (Transact-SQL) and sys.column_encryption_key_values (Transact-SQL) catalog views. Column encryption keys used with the AES-256 algorithm are 256-bit long.
Column master keys are key-protecting keys used to encrypt column encryption keys. Column master keys must be stored in a trusted key store, such as Windows Certificate Store, Azure Key Vault, or a hardware security module. The database only contains metadata about column master keys (the type of key store and location). The column master key metadata is stored in the sys.column_master_keys (Transact-SQL) catalog view.
It's important to note that the key metadata in the database system doesn't contain plaintext column master keys or plaintext column encryption keys. The database only contains information about the type and location of column master keys, and encrypted values of column encryption keys. This means that plaintext keys are never exposed to the database system ensuring that data protected using Always Encrypted is safe, even if the database system gets compromised. To ensure the database system can't gain access to the plaintext keys, be sure to run your key management tools on a different machine than the one hosting your database - review the Security Considerations for Key Management section below for details.
Because the database only contains encrypted data (in Always Encrypted protected columns), and can't access the plaintext keys, it can't decrypt the data. This means that querying Always Encrypted columns will simply return encrypted values, so client applications that need to encrypt or decrypt protected data must be able to access the column master key, and related column encryption keys. For details, see Develop Applications using Always Encrypted.
The process of managing keys can be divided into the following high-level tasks:
Key provisioning - Creating the physical keys in a trusted key store (for example, in the Windows Certificate Store, Azure Key Vault, or a hardware security module), encrypting column encryption keys with column master keys, and creating metadata for both types of keys in the database.
Key rotation - Periodically replacing an existing key with a new key. You may need to rotate a key if the key has been compromised, or in order to comply with your organization's policies or compliance regulations that mandate cryptographic keys must be rotated.
There are two distinct roles of users who manage Always Encrypted keys; Security Administrators and Database Administrators (DBAs):
Considering the above roles, there are two different ways to perform key management tasks for Always Encrypted; with role separation, and without role separation. Depending on the needs of your organization you can select the key management process that best suits your requirements.
When Always Encrypted keys are managed with role separation, different people in an organization assume the Security Administrator and DBA roles. A key management process with role separation ensures DBAs have no access to the keys or key stores holding the actual keys, and Security Administrators have no access to the database containing sensitive data. Managing keys with role separation is recommended if your goal is to ensure DBAs in your organization can't access sensitive data.
Note: Security Administrators generate and work with the plaintext keys, so they should never perform their tasks on the same computers hosting a database system, or computers that can be accessed by DBAs or anyone else who might be potential adversaries.
When Always Encrypted keys are managed without role separation, a single person can assume both Security Administrator and DBA roles, which imply that person needs to be able to access and manage both the keys/key stores and the key metadata. Managing keys without role separation can be recommended for organizations using the DevOps model, or if the database is hosted in the cloud and the primary goal is to restrict cloud administrators (but not on-premises DBAs), from accessing sensitive data.
Always Encrypted keys can be managed using SQL Server Management Studio (SSMS) and PowerShell:
SQL Server Management Studio (SSMS) - provides dialogs and wizards that combine tasks involving key store access and database access, so SSMS doesn't support role separation, but it makes configuring your keys easy. For more information about managing keys using SSMS, see:
SQL Server PowerShell - includes cmdlets for managing Always Encrypted keys with and without role separation. For more information, see:
The primary objective of Always Encrypted is to ensure sensitive data stored in a database is safe, even if the database system or its hosting environment gets compromised. Examples of security attacks where Always Encrypted can help prevent sensitive data leaks include:
To ensure Always Encrypted is effective in preventing these types of attacks, your key management process must ensure the column master keys and column encryption keys, and credentials to a key store containing the column master keys, are never revealed to a potential attacker. Here are a few guidelines, you should follow:
Događaj
31. mar 23 - 2. apr 23
Najveći SKL, Fabric i Pover BI događaj učenja. 31. mart – 2. april. Koristite kod FABINSIDER da uštedite $400.
Registrujte se već danasObuka
Certifikacija
Microsoft Certified: Azure Database Administrator Associate - Certifications
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.
Dokumentacija
Always Encrypted - How queries against encrypted columns work - SQL Server
Learn about how queries against encrypted columns work in the Always Encrypted feature in SQL Server and Azure SQL.
Tutorial: Getting started with Always Encrypted - SQL Server
This tutorial teaches you how to encrypt columns using Always Encrypted and how to query encrypted columns in SQL Server, Azure SQL Database, and Azure SQL Managed Instance.
Create & store column master keys for Always Encrypted - SQL Server
Learn how to select a key store and create column master keys for SQL Server Always Encrypted.