More Info:
Ensure that Microsoft Azure SQL databases have a sufficient Point in Time Restore (PITR) backup retention period configured for security and compliance purposes. Azure SQL service automatically creates database backups that are kept between 7 and 35 days. The SQL service uses Azure read-access geo-redundant storage (RA-GRS) to ensure that the backups are preserved even if the primary datacenter becomes unavailable. Prior to running this rule by the Cloud Conformity engine, the PITR backup retention period must configured within the rule settings, on the Cloud Conformity account dashboard. The supported values are: 1, 7, 14, 21, 28 and 35 days. Azure default backup short term retention days setting is 7Risk Level
MediumAddress
SecurityCompliance Standards
GDPRTriage and Remediation
- Remediation
Remediation
Using Console
Using Console
Sure, here are the step-by-step instructions to remediate the issue of insufficient Point-in-Time Restore (PITR) backup retention period in Azure:
- Log in to the Azure portal and navigate to the Recovery Services vault that contains the protected resources.
- In the Recovery Services vault, click on the Backup items tab from the left-hand side menu.
- Select the backup item for which you want to check the PITR retention period.
- In the Backup item’s menu, click on the Backup policy option.
- In the Backup policy section, scroll down to the Retention tab and check the PITR retention period.
- If the PITR retention period is less than the required period, click on the Edit button.
- In the Edit backup policy window, update the PITR retention period as per your requirement.
- Once you have updated the PITR retention period, click on the Save button to save the changes.
- After saving the changes, Azure will automatically update the backup policy for the selected backup item.
- Repeat the same steps for all the backup items that require a longer PITR retention period.
Using CLI
Using CLI
To remediate the misconfiguration related to insufficient Point In Time Restore (PITR) backup retention period in Azure, you can follow the below steps using Azure CLI:
- Open the Azure CLI in your preferred environment.
-
Check the current PITR backup retention period for your Azure database by running the following command:
-
If the value returned by the above command is less than the required retention period, then update the PITR backup retention period by running the following command:
Replace
<resource-group-name>,<server-name>,<database-name>, and<required-retention-period>with the appropriate values. -
After running the above command, verify that the PITR backup retention period has been updated by running the following command:
The value returned by this command should be equal to the
<required-retention-period>specified in the previous step.
Using Python
Using Python
To remediate the misconfiguration of insufficient Point In Time Restore (PITR) backup retention period in Azure, you can use the following steps using Python:By following these steps, you can remediate the misconfiguration of insufficient Point In Time Restore (PITR) backup retention period in Azure using Python.
- First, you need to import the necessary modules to access Azure resources using Python. You can use the
azure.identitymodule to authenticate your Azure account andazure.mgmt.sqlmodule to access the Azure SQL resources.
- Next, you need to create an instance of the
SqlManagementClientclass by passing the Azure subscription ID and the credential object.
- Once you have created the
SqlManagementClientinstance, you can use thebackup_long_term_retention_policies.list_by_servermethod to get the backup retention policies for all the databases in the Azure SQL server.
- After getting the backup policies, you can iterate through them and check if the retention period is sufficient or not. If the retention period is less than the required period, you can update the policy using the
backup_long_term_retention_policies.create_or_updatemethod.
- Finally, you can print a message indicating that the remediation has been completed successfully.

