Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Enable Infrastructure Double Encryption” in Azure using Azure Console, follow the below steps:
  1. Login to the Azure Portal (https://portal.azure.com/)
  2. Click on the “Virtual machines” option from the left-hand menu.
  3. Select the virtual machine that you want to remediate.
  4. Click on the “Disks” option from the left-hand menu.
  5. Select the disk that you want to remediate.
  6. Click on the “Disk Encryption” option from the left-hand menu.
  7. Click on the “Enable encryption” button.
  8. Select the key vault that you want to use for encryption.
  9. Click on the “Save” button to enable encryption.
By following these steps, you can remediate the misconfiguration “Enable Infrastructure Double Encryption” in Azure using Azure Console.

To remediate the misconfiguration of enabling infrastructure double encryption in AZURE using AZURE CLI, please follow the below steps:
  1. Open the AZURE CLI in your terminal or command prompt.
  2. Login to your AZURE account using the command “az login”.
  3. Select the subscription in which the infrastructure needs to be double encrypted using the command az account set --subscription <subscription-id>
  4. Enable the infrastructure double encryption by creating a new storage account with encryption enabled using the command az storage account create --name <storage-account-name> --resource-group <resource-group-name> --location <location> --sku Standard_LRS --encryption-services blob --encryption blob.
  5. Verify that the infrastructure double encryption is enabled by checking the encryption status of the storage account using the command az storage account show --name <storage-account-name> --resource-group <resource-group-name> --query "encryption.services.blob.enabled".
By doing the above steps, you have successfully remediated the misconfiguration of enabling infrastructure double encryption in AZURE using AZURE CLI.
To enable Infrastructure Double Encryption in Azure using Python, you can follow these steps:
  1. Install the Azure SDK for Python using pip:
  2. Import the necessary modules:
  3. Set up the Azure credentials:
  4. Create a StorageManagementClient object:
  5. Get the storage account that you want to enable Infrastructure Double Encryption for:
  6. Create an Encryption object with the necessary properties:
  7. Create a StorageAccountUpdateParameters object with the Encryption object:
  8. Update the storage account with the StorageAccountUpdateParameters object:
These steps will enable Infrastructure Double Encryption for the specified storage account in Azure using Python.
Replace POSTGRES_SERVER_NAME, POSTGRES_ADMIN_USERNAME, and POSTGRES_ADMIN_PASSWORD with your values, and wire the resource group as appropriate.Note: infrastructure_encryption_enabled can only be set at creation time; enabling it on an existing azurerm_postgresql_server forces replacement of the server (and thus a brief outage and data migration requirement). Plan this change accordingly.To verify, terraform plan should show a + create for a new azurerm_postgresql_server (and -/+ or - destroy for the old one if it already exists) with infrastructure_encryption_enabled: "false" => "true".