Ensure regular backups are enabled for Azure MariaDB Server

MEDIUM

Description

Enabling automatic backups can help prevent data loss for a MariaDB server. Azure can create and save backups in either locally redundant or geo-redundant storage for greater resiliency. The maximum retention period for MariaDB backup storage is 35 days and they are encrypted by default. For more information, see the Azure documentation.
References:
https://learn.microsoft.com/en-us/azure/mariadb/concepts-backup

Remediation

In Azure Console -

  1. Open the Azure Portal and go to Azure Database for MariaDB servers.
  2. Choose the MariaDB server you wish to edit.
  3. Under Pricing tier, set Backup Retention Period to a value defined by the organization.
  4. Set Locally Redundant - Recover from data loss within region as Backup redundancy option
  5. Select Apply

In Terraform -

  1. In the azurerm_mariadb_server resource, set backup_retention_days to a value defined by the organization.

References:
https://learn.microsoft.com/en-us/azure/mariadb/howto-restore-server-portal
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mariadb_server#backup_retention_days

Policy Details

Rule Reference ID: AC_AZURE_0139
CSP: Azure
Remediation Available: Yes
Domain: Resilience
Resource Category: Database
Resource Type: MariaDB

Frameworks