Always encrypted is a new feature introduced to encrypt the in rest as well as during transport. It’s been quite long time the feature has been released to general public. In this encryption method the encryption will be done at the client side. Encryption keys can be stored in Azure vault, Windows certificate store in client server or in hardware module. Since the encryption keys doesn’t sit in the database engine it doesn’t reveal the actual data and even this is applicable for an administrators.
In the existing world the business team worries about sensitive data visibility to administrators and this feature will be a way to start protecting against it. Let me write a quick over view about this feature as what it can do and what not!
|Use this type for the columns used in Joins, group, lookup and search predicates
|Use for confidential PII or PCI data. Not supported to use the column in joins or search predicates
|Requires string data type to be in *_Bin2 collation (for example Latin1_General_BIN2) . No other collation supported for string data types||Collation change is not required
|Initial change is slower as it has to lock the table to change the collation and to perform the encryption. Down time may be required based on the table size.||Initial change is slower . Down time may be required based on the table size.|
As of now it supports only AEAD_AES_256_CBC_HMAC_SHA_256 encryption algorithm.
It’s pretty straight forward. Any one of the below tools can be used.
To View & Modify certificates
GRANT ALTER ANY COLUMN MASTER KEY TO USERRole GRANT ALTER ANY COLUMN ENCRYPTION KEY TO USERRole
To View all the columns (irrespective of actual data)
GRANT VIEW ANY COLUMN MASTER KEY DEFINITION TO USERRole GRANT VIEW ANY COLUMN ENCRYPTION KEY DEFINITION TO USERRole
Users without VIEW ANY definition permission won’t be able to query all columns from the table. They can query un-encrypted columns but if they query the encrypted column they will be ended up with error. If the encryption is enabled for an existing table then this might be a breaking change, proper testing need to be performed.
Users with VIEW ANY definition can view unencrypted data when they connect as normal. However if they use “Column Encryption Setting = Enabled” in their connection string then they will be able to view the actual data.
Alter can’t be done on encrypted columns. However it allows to add\modify any other unencrypted columns.
RW can be performed from the application for all the columns included encrypted columns.
Only read can be performed for all the columns and RW can be performed to unencrypted columns through SSMS by adding “Column Encryption Setting = Enabled” connection string parameter.
Using deterministic encryption method allows to use the encrypted columns in JOIN clause however it also requires the other table column to be encrypted, need to be wise in choosing the encryption columns.
More details in the upcoming articles as soon as Im done exploring this feature.