SQL DB Instance Backup Disabled
- Query id: cf3c7631-cd1e-42f3-8801-a561214a6e79
- Query name: SQL DB Instance Backup Disabled
- Platform: Terraform
- Severity: High
- Category: Backup
- URL: Github
Description¶
Checks if backup configuration is enabled for all Cloud SQL Database instances
Documentation
Code samples¶
Code samples with security vulnerabilities¶
Postitive test num. 1 - tf file
resource "google_sql_database_instance" "positive1" {
name = "master-instance"
database_version = "POSTGRES_11"
region = "us-central1"
settings {
tier = "db-f1-micro"
}
}
resource "google_sql_database_instance" "positive2" {
name = "master-instance"
database_version = "POSTGRES_11"
region = "us-central1"
settings {
tier = "db-f1-micro"
backup_configuration{
binary_log_enabled = true
}
}
}
resource "google_sql_database_instance" "positive3" {
name = "master-instance"
database_version = "POSTGRES_11"
region = "us-central1"
settings {
backup_configuration{
enabled = false
}
}
}