Back to Checks
RDS instances have automated backup enabled
rds_backup_enabled
Service: rdsSeverity: high
OfficialBuilt-inVerified
Categories:resilience
Resource Type:NotDefined
Ensure that Huawei Cloud Relational Database Service (RDS) instances have automatic backup enabled to protect against data loss.
Risk
Without automatic backups, data loss from accidental deletion, corruption, or hardware failure cannot be recovered, potentially leading to permanent data loss.
Run this check with Prowler
Run in Prowler CloudRun
prowler huaweicloud --checks rds_backup_enabledRecommendation
Enable automated backup for all RDS instances with an appropriate retention period.
Remediation
CLI
hcloud RDS SetBackupPolicy --instance_id=<instance_id> --backup_policy.keep_days=7 --backup_policy.start_time="01:00-02:00"Other
1Log on to the **Huawei Cloud console**.
2Navigate to **Relational Database Service**.
3Select the instance.
4Click the **Backup and Restoration** tab.
5Configure the **automatic backup** policy with a retention period.
6Click **Save**.
Check Code
from prowler.lib.check.models import Check, CheckReportHuaweiCloud
from prowler.providers.huaweicloud.services.rds.rds_client import rds_client
class rds_backup_enabled(Check):
"""Check if RDS instances have automated backup enabled."""
def execute(self) -> list[CheckReportHuaweiCloud]:
findings = []
for instance in rds_client.instances:
report = CheckReportHuaweiCloud(metadata=self.metadata(), resource=instance)
report.region = instance.region
report.resource_id = instance.id
report.resource_arn = f"huaweicloud:rds:{instance.region}:{rds_client.audited_account}:instance/{instance.id}"
if instance.backup_enabled:
report.status = "PASS"
report.status_extended = (
f"RDS instance {instance.name} ({instance.id}) "
f"has automated backup enabled."
)
else:
report.status = "FAIL"
report.status_extended = (
f"RDS instance {instance.name} ({instance.id}) "
f"does not have automated backup enabled."
)
findings.append(report)
return findings