2024-04-11 14:23:07 +00:00
|
|
|
id: rds-backup-enable
|
|
|
|
info:
|
|
|
|
name: RDS Automated Backup Check
|
|
|
|
author: princechaddha
|
|
|
|
severity: high
|
|
|
|
description: |
|
|
|
|
Ensure that your Amazon RDS database instances have automated backups enabled for point-in-time recovery.
|
|
|
|
impact: |
|
|
|
|
Lack of automated backups can lead to data loss in case of accidental deletion or database corruption.
|
|
|
|
remediation: |
|
|
|
|
Enable automated backups for RDS instances by setting the backup retention period to a value other than 0.
|
|
|
|
reference:
|
|
|
|
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html
|
2024-06-07 10:04:29 +00:00
|
|
|
metadata:
|
|
|
|
max-request: 2
|
2024-04-11 14:23:07 +00:00
|
|
|
tags: cloud,devops,aws,amazon,rds,aws-cloud-config
|
|
|
|
variables:
|
|
|
|
region: "ap-northeast-1"
|
|
|
|
|
|
|
|
flow: |
|
|
|
|
code(1)
|
|
|
|
for(let DBInstances of iterate(template.instances)){
|
|
|
|
set("db", DBInstances)
|
|
|
|
code(2)
|
|
|
|
}
|
|
|
|
|
|
|
|
self-contained: true
|
|
|
|
code:
|
|
|
|
- engine:
|
|
|
|
- sh
|
|
|
|
- bash
|
|
|
|
source: |
|
|
|
|
aws rds describe-db-instances --region $region --output json --query 'DBInstances[*].DBInstanceIdentifier'
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: json
|
|
|
|
name: instances
|
|
|
|
internal: true
|
|
|
|
json:
|
|
|
|
- '.[]'
|
|
|
|
|
|
|
|
- engine:
|
|
|
|
- sh
|
|
|
|
- bash
|
|
|
|
source: |
|
|
|
|
aws rds describe-db-instances --region $region --db-instance-identifier $db --query 'DBInstances[*].BackupRetentionPeriod'
|
|
|
|
|
|
|
|
matchers:
|
|
|
|
- type: word
|
|
|
|
words:
|
|
|
|
- '0'
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: dsl
|
|
|
|
dsl:
|
|
|
|
- '"Automated backups are not enabled for " + db + " RDS database instance"'
|
2024-04-11 14:25:25 +00:00
|
|
|
# digest: 490a0046304402202cafc27efb26d112eaeeda54182636abc27e1c7d4c685250eee139e6016ad0e00220696ff967f5e74543e24b1f563a48870e20c7a651ebf098221cb3aa53d92d0a4a:922c64590222798bb761d5b6d8e72950
|