Skip to main content

lacework-global-550

4.3.8 Ensure 'Infrastructure double encryption' for PostgreSQL Database Server is 'Enabled' (Automated)

Profile Applicability

• Level 1

Description

Enable encryption at rest for PostgreSQL Databases.

Rationale

If Double Encryption is enabled, another layer of encryption is implemented at the hardware level before the storage or network level. Information will be encrypted before it is even accessed, preventing both interception of data in motion if the network layer encryption is broken and data at rest in system resources such as memory or processor cache. Encryption will also be in place for any backups taken of the database, so the key will secure access the data in all forms. For the most secure implementation of key based encryption, it is recommended to use a Customer Managed asymmetric RSA 2048 Key in Azure Key Vault.

Impact

The read and write speeds to the database will be impacted if both default encryption and Infrastructure Encryption are checked, as a secondary form of encryption requires more resource overhead for the cryptography of information. This cost is justified for information security. Customer managed keys are recommended for the most secure implementation, leading to overhead of key management. The key will also need to be backed up in a secure location, as loss of the key will mean loss of the information in the database.

Audit

From Azure Portal

  1. From Azure Home, click on more services.
  2. Click on Databases
  3. Click on Azure Database for PostgreSQL servers
  4. Select the database by clicking on its name.
  5. Go to Additional Settings.
  6. Ensure that 'Infrastructure encryption enabled' is 'checked'

From Azure CLI

  1. Enter the command
az postgres server configuration show --name <servername> --resource-group <resourcegroup> --query 'properties.infrastructureEncryption' -o tsv
  1. Verify that Infrastructure encryption is enabled.

Remediation

From Azure Portal

For the creation of a new server;

  1. Go through the normal process of database creation.
  2. On step 2 titled 'Additional settings' ensure that 'Infrastructure double encryption enabled' is 'checked'
  3. Acknowledge that you understand this will impact database performance.
  4. Finish database creation as normal.
  5. On the final 'Review + create' screen, ensure that at the very bottom of the database properties, that 'Infrastructure (Double) encryption' is 'enabled'.

For existing servers;

  1. From Azure Home, click on more services.
  2. Click on Databases
  3. Click on Azure Database for PostgreSQL servers
  4. Select the database by clicking on its name.
  5. Select the second from the left option 'Additional settings'.
  6. Check the box next to 'Infrastructure double encryption enabled'.

From Azure CLI

Creating a New Server with Infrastructure Encryption Enabled

Enter the command as follows;

az postgres server create --resource-group <resourcegroup> --name <servername> --location <location> --admin-user <adminusername> --admin-password <server_admin_password> --sku-name GP_Gen4_2 --version 11 --infrastructure-encryption 'Enabled'

Updating a Server's Configuration

az postgres server configuration set -g <resourcegroup>-s <servername> --infrastructure-encryption <Enabled> 

References

https://docs.microsoft.com/en-us/azure/postgresql/howto-double-encryption
https://docs.microsoft.com/en-us/azure/postgresql/concepts-infrastructure-double-encryption
https://docs.microsoft.com/en-us/azure/postgresql/concepts-data-encryption-postgresql
https://docs.microsoft.com/en-us/azure/key-vault/keys/byok-specification
https://docs.microsoft.com/en-us/azure/postgresql/howto-double-encryption
https://docs.microsoft.com/en-us/security/benchmark/azure/security-controls-v3-data-protection#dp-4-enable-data-at-rest-encryption-by-default

Additional Information

Flexible PostgreSQL Database Servers are still in preview. A recommendation will be created for Flexible Servers once the service is out of preview.