You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/postgresql/flexible-server/concepts-data-encryption.md
+351-3Lines changed: 351 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,8 @@ The DEKs, encrypted with the KEKs, are stored separately. Only an entity with ac
50
50
51
51
Azure Active Directory [user- assigned managed identity](../../active-directory/managed-identities-azure-resources/overview.md) will be used to connect and retrieve customer-managed key. Follow this [tutorial](../../active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm.md) to create identity.
52
52
53
-
For a PostgreSQL server to use customer-managed keys stored in Key Vault for encryption of the DEK, a Key Vault administrator gives the following access rights to the server:
53
+
54
+
For a PostgreSQL server to use customer-managed keys stored in Key Vault for encryption of the DEK, a Key Vault administrator gives the following **access rights** to the managed identity created above:
54
55
55
56
-**get**: For retrieving, the public part and properties of the key in the key Vault.
56
57
@@ -61,6 +62,9 @@ For a PostgreSQL server to use customer-managed keys stored in Key Vault for enc
61
62
-**unwrapKey**: To be able to decrypt the DEK. Azure Database for PostgreSQL needs the decrypted DEK to encrypt/decrypt the data
62
63
63
64
The key vault administrator can also [enable logging of Key Vault audit events](../../key-vault/general/howto-logging.md?tabs=azure-cli), so they can be audited later.
65
+
> [!IMPORTANT]
66
+
> Not providing above access rights to the Key Vault to managed identity for access to KeyVault may result in failure to fetch encryption key and subsequent failed setup of the Customer Managed Key (CMK) feature.
67
+
64
68
65
69
When the server is configured to use the customer-managed key stored in the key Vault, the server sends the DEK to the key Vault for encryptions. Key Vault returns the encrypted DEK stored in the user database. Similarly, when needed, the server sends the protected DEK to the key Vault for decryption. Auditors can use Azure Monitor to review Key Vault audit event logs, if logging is enabled.
66
70
@@ -72,7 +76,7 @@ The following are requirements for configuring Key Vault:
72
76
73
77
- The key Vault must be set with 90 days for 'Days to retain deleted vaults'. If the existing key Vault has been configured with a lower number, you'll need to create a new key vault as it can't be modified after creation.
74
78
75
-
- Enable the soft-delete feature on the key Vault, to protect from data loss if an accidental key (or Key Vault) deletion happens. Soft-deleted resources are retained for 90 days unless the user recovers or purges them in the meantime. The recover and purge actions have their own permissions associated with a Key Vault access policy. The soft-delete feature is off by default, but you can enable it through PowerShell or the Azure CLI (note that you can't enable it through the Azure portal).
79
+
-**Enable the soft-delete feature on the key Vault**, to protect from data loss if an accidental key (or Key Vault) deletion happens. Soft-deleted resources are retained for 90 days unless the user recovers or purges them in the meantime. The recover and purge actions have their own permissions associated with a Key Vault access policy. The soft-delete feature is off by default, but you can enable it through PowerShell or the Azure CLI (note that you can't enable it through the Azure portal).
76
80
77
81
- Enable Purge protection to enforce a mandatory retention period for deleted vaults and vault objects
78
82
@@ -115,7 +119,7 @@ Here are recommendations for configuring a customer-managed key:
115
119
116
120
It might happen that someone with sufficient access rights to Key Vault accidentally disables server access to the key by:
117
121
118
-
- Revoking the Key Vault's list, get, wrapKey, and unwrapKey permissions from the identity used to retrieve key in KeyVault.
122
+
- Revoking the Key Vault's **list**, **get**, **wrapKey**, and **unwrapKey** permissions from the identity used to retrieve key in KeyVault.
119
123
120
124
- Deleting the key.
121
125
@@ -238,6 +242,9 @@ Follow the steps below to update CMK on CMK enabled Flexible Server using Azure
238
242
239
243
### CLI
240
244
245
+
The Azure command-line interface (Azure CLI) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation.
246
+
247
+
241
248
Prerequisites:
242
249
- You must have an Azure subscription and be an administrator on that subscription.
243
250
- Key Vault with key in region where Postgres Flex Server will be created. Follow this [tutorial](../../key-vault/general/quick-create-portal.md) to create Key Vault and generate key.
@@ -251,6 +258,347 @@ Follow the steps below to change\rotate key or identity after creation of server
ARM templates are a form of infrastructure as code, a concept where you define the infrastructure you need to be deployed.
264
+
Using ARM templates in managing your Azure environment has many benefits, as declarative syntax removes the requirement of writing complicated deployment scripts to handle multiple deployment scenarios. For more on ARM templates see this [doc](../../azure-resource-manager/templates/overview.md)
265
+
266
+
Prerequisites:
267
+
- You must have an Azure subscription and be an administrator on that subscription.
268
+
- Key Vault with key in region where Postgres Flex Server will be created. Follow this [tutorial](../../key-vault/general/quick-create-portal.md) to create Key Vault and generate key.
269
+
270
+
Following is an example Azure ARM template that creates server with Customer MANAGED kEY (CMK) based encryption as defined in *dataEncryptionData* section of ARM template
0 commit comments