|
| 1 | +--- |
| 2 | +title: How to ensure validation of the Azure Database for PostgreSQL - Data encryption |
| 3 | +description: Learn how to validate the encryption of the Azure Database for PostgreSQL - Data encryption using the customers managed key. |
| 4 | +author: kummanish |
| 5 | +ms.author: manishku |
| 6 | +ms.service: postgresql |
| 7 | +ms.topic: conceptual |
| 8 | +ms.date: 04/28/2020 |
| 9 | +--- |
| 10 | + |
| 11 | +# Validating data encryption for Azure Database for PostgreSQL |
| 12 | + |
| 13 | +This articles helps you validate that data encryption using customer managed key for Azure Database for PostgreSQL is working as expected. |
| 14 | + |
| 15 | +## Check the encryption status |
| 16 | + |
| 17 | +### From portal |
| 18 | + |
| 19 | +* If you want to verify that the customer's key is used for encryption, follow these steps: |
| 20 | + |
| 21 | + 1. In the Azure portal, navigate to the **Azure Key Vault** -> **Keys** |
| 22 | + 2. Select the key used for server encryption. |
| 23 | + 3. Set the status of the key **Enabled** to **No**. |
| 24 | + |
| 25 | + After some time (**~15 min**), the Azure Database for PostgreSQL server **Status** should be **Inaccessible**. Any I/O operation done against the server will fail which validates that the server is indeed encrypted with customers key and the key is currently not valid. |
| 26 | + |
| 27 | + In order to make the server **Available** against, you can revalidate the key. |
| 28 | + |
| 29 | + 4. Set the status of the key in the Key Vault to **Yes**. |
| 30 | + 4. On the server **Data Encryption** select **Revalidate key**. |
| 31 | + 5. After the revalidation of the key is successful, the server resumes its normal functionality. |
| 32 | + |
| 33 | +* On the Azure Portal if can ensure that the encryption key is set this would mean that the data is encrypted using the key used in the Azure portal. |
| 34 | + |
| 35 | +  |
| 36 | + |
| 37 | + This ensures that the data encryption using the customers key in the Azure key vault is being used. |
| 38 | + |
| 39 | + |
| 40 | +### From CLI |
| 41 | + |
| 42 | +* We can use *az cli* command to validate the key resources being used for the Azure Database for PostgreSQL server. |
| 43 | + |
| 44 | + ```azurecli-interactive |
| 45 | + az postgres server key list --name '<server_name>' -g '<resource_group_name>' |
| 46 | + ``` |
| 47 | +
|
| 48 | + For a server without Data encryption set, this command will results in empty set []. |
| 49 | +
|
| 50 | +* [Audit Reports](https://servicetrust.microsoft.com) can also be reviewed that provides information about the compliance with data protection standards and regulatory requirements. |
| 51 | +
|
| 52 | +## Next steps |
| 53 | +
|
| 54 | +To learn more about data encryption, see [Azure Database for PostgreSQL Single server data encryption with customer-managed key](concepts-data-encryption-postgresql.md). |
0 commit comments